python on Linux

Irmen de Jong irmen.NOSPAM at xs4all.nl
Fri Oct 10 08:31:04 CEST 2014


On 10-10-2014 6:21, Igor Korot wrote:
> Hi, ALL,
> When I am on Windows, I can write something like this:
> 
> sys.path.append('C:\Users\Igor\Documents\MyLib')

While this might work on your system, it may not work on others.

- you need to escape the backslashes (or just use forward slashes, they work on windows too)
- not all windows installations and versions have their user folders in
C:\Users\<username>. On windows too, you'll have to use something like %USERPROFILE% to
get to the correct directory if you want it to work correctly in all cases.


Irmen




More information about the Python-list mailing list