[Tutor] What's up with Python 2.5.1's IDLE?
Alan Gauld
alan.gauld at btinternet.com
Tue Sep 4 11:35:24 CEST 2007
"Dick Moores" <rdm at rcblue.com> wrote
>>except you lose the flexibility of changing PYTHONPATH
>>dynamically during a session using SET.
>
> Could you show me how to use SET? And an example where it would be
> useful?
Imagine you are in a DOS command session
C:> SET PYTHONPATH=C:\MYNEWFOLDER;%PYTHONPATH%
prepends a folder to PYTHONPATH
Now next time you run Python it will pick up the extra folder
C:> SET PYTHONPATH
displays the current value
finally
C:>SET PYTHONPATH=%PYTHONPATH:Python25=Python24%
edits the existing path to substitute Python24 for each occurence of
python25
SET /P
allows multi line entry.
SET is quite surprisingly powerful.
Try HELP SET for more info
The big downside is that these changes only apply to the current
environment. (Which is the point of an *environment* variable after
all :-)
You still need to edit the variable if you want a permanant change
Alan G
More information about the Tutor
mailing list