fyears / electron-python-example

Electron as GUI of Python Applications
MIT License
2k stars 234 forks source link

Confused on how Python is bundled #2

Closed ckcollab closed 7 years ago

ckcollab commented 8 years ago

Heyoo, thanks so much for making this example!

I'm confused on how you'd bundle python -- at what point do you run PyInstaller? Can you tell Electron to run it as it's bundling things together? I want to make a little Python app that runs some Selenium tests, would I hook PyInstaller up to Electron, pass it some requirements.txt and my source files and it outputs a .exe/binary?

Sorry for bugging ya, thanks again for posting this :dancer:

fyears commented 8 years ago

@ckcollab

No, PyInstaller is not relevant with Electron.

When your computer has python environment:

electron  ─┬───>  display the "website"
           └───>  spawn a thread running .py scripts generating "website server"

When your computer does NOT have python environment, you have to bundle *.py scripts into standalone runnable application like *.exe in windows. Here is why I said you may need PyInstaller. However, it's totally Python-y distribution issue, not relevant with Electron.

electron  ─┬───>  display the "website"
           └───>  spawn a thread running .exe (packaged using pyinstaller) generating "website server"
ar7max commented 7 years ago

Linux: I think it is possible to prepare some Makefile for using it via make command to install all requirements for both NodeJS and Python. Windows: batch file with same actions

fyears commented 7 years ago

Hi,

If you still find it useful, or plan to use the same solution on future projects, you could check out the updated readme now.

Thank you for your interest. :-)