os.path.join and lists

Fredrik Lundh fredrik at pythonware.com
Wed Oct 17 16:45:02 EDT 2001


Dave Swegen wrote:
> It looks somthing like this:
>
> bar = [ "fred", "barney", "froo" ]
> foo = os.path.join(bar[1:2], "bob")

how about

    bar = [ "fred", "barney", "froo" ]
    baz = bar + [ "bob" ]
    foo = os.path.join(*baz)

(but please use "spam" and "egg" instead of "foo"
and "bar" -- this is a python newsgroup, after all)

> Basically, I guess the question is: How do I quote the values in a list
> (similiar to perl's, qw I guess)?

I have no idea what you're talking about here...

</F>

<!-- (the eff-bot guide to) the python standard library:
http://www.pythonware.com/people/fredrik/librarybook.htm
-->





More information about the Python-list mailing list