Re: Import, how to change sys.path on Windows, and module naming?

2008-03-03 Thread bockman
On 1 Mar, 20:17, Steve Holden [EMAIL PROTECTED] wrote: Jeremy Nicoll - news posts wrote: Jeremy Nicoll - news posts [EMAIL PROTECTED] wrote: If I understand correctly, when I import something under Windows, Python searches the directory that the executing script was loaded from, then

Re: Import, how to change sys.path on Windows, and module naming?

2008-03-03 Thread bockman
On 3 Mar, 17:12, [EMAIL PROTECTED] wrote: (unless of course I _did_ miss something and my guess is completely wrong; I should have done some experiment before posting, but I'm too lazy for that). Ciao --- FB- Nascondi testo tra virgolette - - Mostra testo tra virgolette - Oops... I

Re: Import, how to change sys.path on Windows, and module naming?

2008-03-03 Thread Gabriel Genellina
En Mon, 03 Mar 2008 14:39:20 -0200, [EMAIL PROTECTED] escribió: On 3 Mar, 17:12, [EMAIL PROTECTED] wrote: Oops... I tried removing python25.zip from sys.path, and I can still import packages from zip files ... Yes, python25.zip is in sys.path by default, not to enable zipimport (which is

Re: Import, how to change sys.path on Windows, and module naming?

2008-03-02 Thread Tim Roberts
Jeremy Nicoll - news posts [EMAIL PROTECTED] wrote: Does every Windows user have: 2 C:\WINDOWS\system32\python25.zip in their sys.path? What's the point of having a zip in the path? Starting with Python 2.4, Python is able to import modules directly from a zip, as if it were a directory. It's

Import, how to change sys.path on Windows, and module naming?

2008-03-01 Thread Jeremy Nicoll - news posts
If I understand correctly, when I import something under Windows, Python searches the directory that the executing script was loaded from, then other directories as specified in sys.path. I assume there are standard locations inside my installed Python - in my case inside: C:\Program

Re: Import, how to change sys.path on Windows, and module naming?

2008-03-01 Thread Steve Holden
Jeremy Nicoll - news posts wrote: If I understand correctly, when I import something under Windows, Python searches the directory that the executing script was loaded from, then other directories as specified in sys.path. Technically, I believe it just puts the script's directory at the start

Re: Import, how to change sys.path on Windows, and module naming?

2008-03-01 Thread Jeremy Nicoll - news posts
Jeremy Nicoll - news posts [EMAIL PROTECTED] wrote: If I understand correctly, when I import something under Windows, Python searches the directory that the executing script was loaded from, then other directories as specified in sys.path. Sorry to followup my own question, but I ran for

Re: Import, how to change sys.path on Windows, and module naming?

2008-03-01 Thread Steve Holden
Jeremy Nicoll - news posts wrote: Jeremy Nicoll - news posts [EMAIL PROTECTED] wrote: If I understand correctly, when I import something under Windows, Python searches the directory that the executing script was loaded from, then other directories as specified in sys.path. Sorry to

Re: how to change sys.path?

2006-05-25 Thread per9000
also se topic named 'problem(s) with import from parent dir: from ../brave.py import sir_robin ' I use this every day now: sys.path.append(../../py_scripts) best wishes, Per -- http://mail.python.org/mailman/listinfo/python-list

RE: how to change sys.path?

2006-05-25 Thread Michael Yanowitz
PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of per9000 Sent: Thursday, May 25, 2006 4:07 AM To: python-list@python.org Subject: Re: how to change sys.path? also se topic named 'problem(s) with import from parent dir: from ../brave.py import sir_robin ' I use this every day now: sys.path.append

Re: how to change sys.path?

2006-05-25 Thread Ziga Seilnacht
Michael Yanowitz wrote: Is there something like a .pythoninitrc which can run whenever we start Python that can load a file with many sys.path.append(), etc? If not is there some way to modify the Python shell constructor and destructor? Thanks in advance: Michael yanowitz Yes, there is

Re: how to change sys.path?

2006-05-25 Thread John Salerno
Dennis Lee Bieber wrote: On Wed, 24 May 2006 17:24:08 GMT, John Salerno [EMAIL PROTECTED] declaimed the following in comp.lang.python: Dennis Lee Bieber wrote: I may have gotten slightly confused That's my job. :) Okay: You have gotten me slightly confused G

Re: how to change sys.path?

2006-05-24 Thread Steve Holden
Ju Hui wrote: yes, we can change PYTHONPATH to add some path to sys.path value, but how to remove item from sys.path? That would be del sys.path[3] for example. Of course you may need to search sys.path to determine the exact element you need to delete, but sys.path is just like any other

Re: how to change sys.path?

2006-05-24 Thread John Salerno
Dennis Lee Bieber wrote: On Tue, 23 May 2006 20:21:10 GMT, John Salerno [EMAIL PROTECTED] declaimed the following in comp.lang.python: I meant actually adding the PYTHONPATH variable to the environment variables list. You're looking at editing the Windows registry for that... I

Re: how to change sys.path?

2006-05-24 Thread Andrew Robert
Dennis Lee Bieber wrote: On Wed, 24 May 2006 14:45:55 GMT, John Salerno [EMAIL PROTECTED] declaimed the following in comp.lang.python: I just right-clicked on My Computer -- Properties -- Advanced -- Environment Variables, and added a new one called PYTHONPATH. I don't know if that edits

Re: how to change sys.path?

2006-05-24 Thread John Salerno
Dennis Lee Bieber wrote: I may have gotten slightly confused That's my job. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: how to change sys.path?

2006-05-24 Thread Ju Hui
yes, we can add path to PYTHONPATH,but how to remove some items? my sys.path: import sys for x in sys.path: ... print x ... D:\usr\local\lib\site-packages\setuptools-0.6a11-py2.4.egg D:\usr\local\lib\site-packages\clientcookie-1.3.0-py2.4.egg c:\temp C:\WINDOWS\system32\python24.zip

Re: how to change sys.path?

2006-05-24 Thread [EMAIL PROTECTED]
sys.append(write path of the module u r importing) Bye. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to change sys.path?

2006-05-24 Thread [EMAIL PROTECTED]
sys.path.append(path containing module to be imported) eg. sys.path.append(/home/webdoc) -- http://mail.python.org/mailman/listinfo/python-list

how to change sys.path?

2006-05-23 Thread Ju Hui
is python search module by paths in sys.path? how to change it manuallly? -- http://mail.python.org/mailman/listinfo/python-list

Re: how to change sys.path?

2006-05-23 Thread bruno at modulix
Ju Hui wrote: is python search module by paths in sys.path? sys.path is the list of path where the Python interpreter will search modules, yes. how to change it manuallly? manually ?-) You mean dynamically, by code ? If yes, it's just a list. You can modify it like you'd do for any other

Re: how to change sys.path?

2006-05-23 Thread Ju Hui
yes, I mean I want change the sys.path value and save it for next using. I can change the value of sys.path, but I can't save it permanently. There is no python_path environment on my pc, what the relationship between it and the sys.path? -- http://mail.python.org/mailman/listinfo/python-list

Re: how to change sys.path?

2006-05-23 Thread John Salerno
Ju Hui wrote: yes, I mean I want change the sys.path value and save it for next using. I can change the value of sys.path, but I can't save it permanently. There is no python_path environment on my pc, what the relationship between it and the sys.path? In Windows, at least, you can create

Re: how to change sys.path?

2006-05-23 Thread Jarek Zgoda
John Salerno napisał(a): yes, I mean I want change the sys.path value and save it for next using. I can change the value of sys.path, but I can't save it permanently. There is no python_path environment on my pc, what the relationship between it and the sys.path? In Windows, at least, you

Re: how to change sys.path?

2006-05-23 Thread John Salerno
Jarek Zgoda wrote: John Salerno napisał(a): yes, I mean I want change the sys.path value and save it for next using. I can change the value of sys.path, but I can't save it permanently. There is no python_path environment on my pc, what the relationship between it and the sys.path? In

Re: how to change sys.path?

2006-05-23 Thread Bruno Desthuilliers
Ju Hui a écrit : yes, I mean I want change the sys.path value and save it for next using. I can change the value of sys.path, but I can't save it permanently. No. There is no python_path environment on my pc, sorry, I meant PYTHONPATH (all caps, no underscore). Like all environnement

Re: how to change sys.path?

2006-05-23 Thread Ben Finney
Bruno Desthuilliers [EMAIL PROTECTED] writes: Ju Hui a écrit : what the relationship between it and the sys.path? Don't you guess ? He's following sound Python philosophy :-) -- \Hercules Grytpype-Thynne: Well, Neddie, I'm going to be | `\ frank. Ned Seagoon: Right,

Re: how to change sys.path?

2006-05-23 Thread Ju Hui
yes, we can change PYTHONPATH to add some path to sys.path value, but how to remove item from sys.path? -- http://mail.python.org/mailman/listinfo/python-list

Re: how to change sys.path?

2006-05-23 Thread Ben Finney
[Please provide some context when you respond in an existing discussion, by quoting the original message and removing any parts irrelevant to your reply.] Ju Hui [EMAIL PROTECTED] writes: yes, we can change PYTHONPATH to add some path to sys.path value, but how to remove item from sys.path?