Interactive os.environ vs. os.environ in script

Peter Otten __peter__ at web.de
Tue Feb 27 05:05:35 EST 2007


boris.smirnov at gmail.com wrote:

> Probably I understood it not correctly. What did you mean was to put
> that code into my python script "shrink_bs_070226.py" and then calls
> script itself?

Yes.
 
> So I took my script "shrink_bs_070226.py" and it starts with:
> **********************************
> #!/usr/bin/env python
> import sys, re, glob, shutil
> import os
> 
> then I put your code in that script
> 
> if os.environ["LD_LIBRARY_PATH"].count('/path/Linux/rh_linux') !=1:
>    os.environ["LD_LIBRARY_PATH"]=os.environ["LD_LIBRARY_PATH"]+':'+'/
> path/Linux/rh_linux'
>    os.system("shrink_bs_070226.py")
>    raise SystemExit
> 
> and here continues my script:
> 
> from qt import *
> 
> .....
> ***********************
> 
> Is it correct?

Yes.
 
> BTW: On lines 3:18 I have comments, script description and
> modifications, therefore is "from qt import *" on the line 29

The problem must be something else, then.

Peter




More information about the Python-list mailing list