4

I have a bunch of code and one of the lines is this (in abc.py):

meow = subprocess.Popen("python ./Functions/cat.py")

Now when i use pyinstaller.exe --onefile .\abc.py

It makes me a single exe and it implements all the function but the function containing above line does not work.

How do i include cat.py in exe and use it with subprocess.popen?

My folder view is

    -Project x
             -abc.py
             -Functions
                      -cat.py
                      -me.py
                      -ow.py

Cat.py has a function which listens for input and runs forever till i have to stop it based on certain input.

I am running abc.py and based on certain input i have to run cat.py along with abc.py and on some another input i have to stop cat.py(using .kill()) and abc.py will still be running.

How do i implement this in a single exe using pyinstaller?

mehulj94
  • 73
  • 1
  • 6

1 Answers1

0

There are a couple of ways to handle this issue. I believe if you called cat.py with an import statement, it would package just fine. The other option is to create a .spec file, and then package cat.py as a data file (or the entire function folder using the Tree class). If you package it as a data file, check out this post for coding to call it while developing as well as once its packaged by --onefile.

jimmiesrustled
  • 691
  • 5
  • 6