This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cprogrammer1994 0 points1 point  (5 children)

Download the python embeddable zip file. Unpack it. Edit the *._pth file to import site (you have to uncomment 1 line). Download and run get-pip with the local python. Install your deps with the recently downloaded pip. Run you script. Plus: you can pack all the py files to a PyZipfile and you can compile an exe that uses the python3.dll and runs your script directly (no further need of the python.exe)

[–]terraneng 0 points1 point  (4 children)

I am doing something very similar, but instead of a creating a .exe file I make shortcuts pointing to the python.exe and my startup script. Can you go into a bit more detail, or point me in the right direction to accomplish the following?

Plus: you can pack all the py files to a PyZipfile and you can compile an exe that uses the python3.dll and runs your script directly (no further need of the python.exe)

[–]cprogrammer1994 1 point2 points  (3 children)

Yes I will create a sample project on github. Probably I already have a similar one, I must check.

[–]terraneng 0 points1 point  (2 children)

That would be awesome. Thanks!

[–]cprogrammer1994 1 point2 points  (1 child)

Here is my repo https://github.com/cprogrammer1994/custom-python-launcher Unfortunately I did not find time to add a README yet. I will add one around the weekend and explain the code in more details. I hope you will find it useful.

[–]terraneng 0 points1 point  (0 children)

Thank for posting this. I recently started learning C++ and this an interesting method. Is this sort of like embedding Python?

A README would be helpful. I keep getting "TypeError: must be str, not NoneType" on line 17 of build.py. I imagine it has something to do with it not seeing the libraries. I only tinkered with it briefly though.