subprocess problem

Andreas Paeffgen oegeeks at gmail.com
Wed Feb 15 15:15:36 EST 2017


On 2017-02-11 02:23:12 +0000, Cameron Simpson said:

>   def your_function(.......):
>     with open('/path/to/your/logfile.txt', 'a') as logfp:
>       print("PATH=".os.environ['PATH'], file=logfp)
>       p=Popen(.......)
>       p.communicate(...)
>       print("p.returncode=%r" % (p.returncode))
> 
> and any other interesting values that occur to you. This is really simple, and
> doesn't require a terminal or using the logging module.
> 
> You can 'tail -f /path/to/your/logfile.txt' in another terminal to watch stuff
> happen as you exercise the program.

Thanks for the great advice.
I found out, that the frozen app does not pass the normal path 
variable. All the tricks with passing the correct environment did not 
work. I just hardcoded the existing standard path. After that it worked.

I think it is a problem with frozen apps in general. Cx_Freeze has 
other problems than Pyinstaller. But all need some workarounds for the 
problems.






More information about the Python-list mailing list