subprocess problem

Andreas Paeffgen oegeeks at gmail.com
Thu Feb 9 09:34:20 EST 2017


Maybe i could use another trick to circumvent the problems in the 
frozen app? The frozen apps can be downloaded here: 
https://sourceforge.net/projects/panconvert/files/Newest/

@Cameron:

1. I use PyQT5 for a creating a gui app. To run the app on other 
systems, where no QT5 and PyQT5 is installed, a bundle is created with 
all relevant libraries, so it will start independently. This app 
bundle, is called a frozen app. Not only the source code, but all it 
dependencies are distributed including python3 itself.

2. In the test-environment pandoc is installed in /usr/local/bin/pandoc 
(Mac) or /bin/pandoc (Linux). Which returns the path correctly, at the 
terminal (shell), in Python and in the Gui-App Panconvert.

3. I am aware of the limitations of which. There is a fallback to 
manually insert the path. So the app will function anyway.  And i want 
to avoid to search the whole filesystem. This takes minutes on my test 
machines, so this is no option.

4. I suppose that something is different from executing the code in the 
frozen state. The app e.g. on Mac is not started from a python shell or 
a comand shell. But even on linux, when started from a shell it does 
not work.

5. I will try the hint with dev.null and the p.check_returncode()



@Wolfgang

1. The function should be executed only, if the path is unknown. If the 
user enters the path manually in the settings and pandoc exists, the 
function should not be executed to save computation time.

2. Only if the manually entered path is not correct or empty the 
function should be executed,  hence 'if not os.path.isfile(path_pandoc)'

3. The function fills in the path automatically if which returns a 
value. This works in the source code





More information about the Python-list mailing list