I appreciate the response Spencer.

I understand your point that the whole interpreter is not bundled. However, 
is there still no way to run a separate script without importing a module 
like runpy?

For example (I am using PyQt5) if I call a script called submodule.py from 
main.py like so: QProcess.start(path_to_python.exe, ["submodule1", 
...args...]) is this no longer possible?

So this submodule would simply take command line arguments given to it by 
the main.py, but as of now without the sys.executable, etc. when I turn 
main.py into an .exe it obviously fails.

On Friday, July 26, 2019 at 3:48:24 AM UTC-4, Spencer Brown wrote:
>
> When you freeze an application with PyInstaller, it doesn't have all of 
> the interpreter - just the modules you use. What you should do is alter 
> your main script to take command line arguments, and then pass an argument 
> that makes it do whatever you would have called the interpreter to execute. 
> In other words call sys.executable to produce a clone of your application, 
> which runs whatever other command instead of your normal application. If 
> you're wanting to run any Python commands, that kinda defeats the purpose 
> of freezing. You might as well just install the whole interpreter and 
> provide your code as a script or something. 
>
> For running your command line args, you might want to look at the runpy, 
> and code modules - these implement -m execution and a REPL respectively.

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/58e4546f-070e-4618-b9a1-6c156f081510%40googlegroups.com.

Reply via email to