Path?

D

Dr. Pastor

I installed Python 2.5 on Windows XP.
I got the following system that works well.
---
Python 2.5b3 (r25b3:51041, Aug 3 2006, 09:35:06) [MSC v.1310 32 bit
(Intel)] on
win32 Type "copyright", "credits" or "license()" for more information.

IDLE 1.2b3['C:\\Python25\\Lib\\idlelib', 'C:\\WINDOWS\\system32\\python25.zip',
'C:\\Python25\\DLLs', 'C:\\Python25\\lib', 'C:\\Python25\\lib\\plat-win',
'C:\\Python25\\lib\\lib-tk', 'C:\\Python25',
'C:\\Python25\\lib\\site-packages',
'C:\\Python25\\lib\\site-packages\\wx-2.6-msw-ansi']---
Question: How did I end up with the second item in path?
Is that a zip file?
There is no such a file in system32.
What would be the correct way to set path to assist the search?
Thanks for any advice.
 
S

Steve Holden

Dr. Pastor said:
I installed Python 2.5 on Windows XP.
I got the following system that works well.
---
Python 2.5b3 (r25b3:51041, Aug 3 2006, 09:35:06) [MSC v.1310 32 bit
(Intel)] on
win32 Type "copyright", "credits" or "license()" for more information.

IDLE 1.2b3['C:\\Python25\\Lib\\idlelib', 'C:\\WINDOWS\\system32\\python25.zip',
'C:\\Python25\\DLLs', 'C:\\Python25\\lib', 'C:\\Python25\\lib\\plat-win',
'C:\\Python25\\lib\\lib-tk', 'C:\\Python25',
'C:\\Python25\\lib\\site-packages',
'C:\\Python25\\lib\\site-packages\\wx-2.6-msw-ansi']

That was added as a part of the interpreter's initialisation.
Is that a zip file?

Well, it would be ...
There is no such a file in system32.

.... if it existed! Python has been capable of importing from zip files
for quite a while.
What would be the correct way to set path to assist the search?

Well, that depends. If you want your modules to take precedence over
similarly-named modules in the standard library (which can be risky if
unexpected name clashes occur) then use

sys.path.insert(0, path)

where "path" holds the path of your choice. If you want to search other
directories once the standard list has been exhausted then you should use

sys.path.append(path)

regards
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top