How can I import a py script by its absolute path name?

Thorsten Kampe thorsten at thorstenkampe.de
Thu Jul 14 14:43:53 CEST 2005


* Edvard Majakari (2005-07-14 12:52 +0100)
> could ildg <could.net at gmail.com> writes:
>> I want to import c:\xxx\yyy\zzz.py into my programme,
>> What should I do?
>> Thank you~
> 
> import sys
> sys.path.append('c:\xxx\yyy')

"sys.path.append('c:\\xxx\\yyy')" or "sys.path.append('c:/xxx/yyy')"



More information about the Python-list mailing list