473,385 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Path?

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
>>import sys
sys.path
['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.

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Sep 6 '06 #1
2 1519
Dr. Pastor wrote:
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
>>import sys
>>sys.path
['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?
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
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

Sep 7 '06 #2
Many thanks, Sir.

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Sep 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

31
by: John Roth | last post by:
I'm adding a thread for comments on Gerrit Holl's pre-pep, which can be found here: http://tinyurl.com/2578q Frankly, I like the idea. It's about time that all of the file and directory stuff...
9
by: Bengt dePaulis | last post by:
I have a local directory that I want to include in my sys.path How to save it permanently? Regards /Bengt
70
by: Michael Hoffman | last post by:
Many of you are familiar with Jason Orendorff's path module <http://www.jorendorff.com/articles/python/path/>, which is frequently recommended here on c.l.p. I submitted an RFE to add it to the...
34
by: Reinhold Birkenfeld | last post by:
Hi, the arguments in the previous thread were convincing enough, so I made the Path class inherit from str/unicode again. It still can be found in CVS:...
2
by: Rob Cowie | last post by:
Hi, Given a string representing the path to a file, what is the best way to get at the filename? Does the OS module provide a function to parse the path? or is it acceptable to split the string...
1
by: William Stacey [MVP] | last post by:
I need a bullet proof way to combine a root and a relative path to form a FQ rooted path (similar to a VDir in IIS). Path.Combine alone will not do the job in all cases. I also need to be sure...
4
by: python | last post by:
Bad file names, i.e. filenames the OS considers illegal, will cause functions in the os.path module to raise an error. Example: import os.path print os.path.getsize( 'c:/pytest/*.py' ) On...
34
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File...
8
by: moondaddy | last post by:
I'm posting code for a user control ( FunctionConnectorSelector) below which has 3 content controls in it. each content control uses a style from a resource dictionary merged into the app.xaml...
6
by: bukzor | last post by:
I have to go into these convulsions to get the directory that the script is in whenever I need to use relative paths. I was wondering if you guys have a better way: from os.path import dirname,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.