On Wed, Dec 17, 2008 at 10:20 AM, ppaarrkk <simon_...@yahoo.co.uk> wrote:
>
> I can do this :
>
>>>> sys.path.append ( 'C:\dump1' )

Note you should use raw strings r'C:\dump1' or double backslash
'C:\\dump1' because the \ is a string escape character.

> but not :
>
>>>> x = 'C:\dir1'
>>>> sys.path.append(x)

That should work fine (other than the single \). What happens when you try it?

> or :

??

> but not :

>>>> x = ['C:\dir1']
>>>> sys.path.append(x)

Here you are appending a list of strings to sys.path, that will not do
what you want.

> Can I append variables to the path, rather than explicit strings ?

Sure.

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to