tags:

views:

63

answers:

1

I have mylist = [var1, var2, var3... varn].

os.path.join is called not one list, but with many vars.

I can't call os.path.join(mylist).

How to call os.path.join(var1, var2, var3... varn)?

+11  A: 

Try:

os.path.join(*mylist)
eumiro
This is called [unpacking argument lists](http://docs.python.org/tutorial/controlflow.html#unpacking-argument-lists).
Space_C0wb0y