Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running pyconcrete in Electron. #55

Closed
TaeyoonKwon opened this issue Feb 13, 2019 · 4 comments
Closed

Running pyconcrete in Electron. #55

TaeyoonKwon opened this issue Feb 13, 2019 · 4 comments

Comments

@TaeyoonKwon
Copy link

I am trying to use Electron as a GUI to run python scripts inside as child-processes.

Would it be possible to encrypt all .py files to .pye then run it in Electron?

Since .pye file has to be executed by pyconcrete.exe, I am guessing that I have to include pyconcrete.exe and run the codes when the process starts.

I am trying to distribute Electron apps to the users who have no Python installed.

But then I have to compile python codes with PyInstaller, which doesn't seem to be possible with .pye files.

Is there any way to accomplish both pyconcrete encryption and making the codes executable in Electron?

@Falldog
Copy link
Owner

Falldog commented Feb 14, 2019

Electron is JS framework right?
So you just want to distribute standalone python app which encrypt by pyconcrete

As I know, PyInstaller or py2exe or others, which will package all .py into a zip file
And the py loader is customized, the way is conflict with pyconcrete
So I think pyocncrte can't be used by PyInstaller or py2exe

If you use python3
Maybe zipapp is a solution, but I'm not sure the implementation solution is same as PyInstaller or not
and there is another issue talk about it Support for Python zipapp module #54

Need sometime to investigate it

@TaeyoonKwon
Copy link
Author

TaeyoonKwon commented Feb 15, 2019

Electron is JS framework right?

Yes, it is. I am trying to run some python modules as a child processes of ElectronJS.

The reason I am trying to use pyconcrete here is because algorithms inside my python modules are quite important. I am trying to do the best encryption I can do with Python (even though Python is not a good language for code hiding) and pyconcrete is the best possible way I've found.

So if PyInstaller(and other tools) is not compatible with pyconcrete, I guess I have to give up making them excutable and distribute Python and all dependencies seperately.

Then I have another question here,

If I start Python child process in electron, Is it cross-platform (Windows, Mac and Linux) to send system message "pyconcrete main.pye" to start a Python process? Will I need to run my Electron App as admin for it?

@Falldog
Copy link
Owner

Falldog commented Feb 17, 2019

If I start Python child process in electron, Is it cross-platform (Windows, Mac and Linux) to send

system message "pyconcrete main.pye" to start a Python process?
Reference https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback
It should be work with below code
exec('"pyconcrete main.pye', {cwd: "Your main.pye location dir"});

Will I need to run my Electron App as admin for it?

pycocnrete doesn't need admin privilege to do execution

@Falldog Falldog closed this as completed Jun 13, 2019
@erm3nda
Copy link

erm3nda commented May 28, 2022

Since .pye file has to be executed by pyconcrete.exe
This is a bit false, you can import pye modules from within python, importing pyconcrete. The pyconcrete.exe is meant to be used as facility launcher, and probably it's a strippped down binary of the module itself.

You need to add pye files as data in pyconcrete config, so the compiled program can import them later.

The version and password from your system pyconcrete install will be added to the compiled binary.
Be sure you install a pyconcrete with a password that satisfies you, because it has a default one :-) and you must setup it properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants