Python Forum

Full Version: Convert script into an exe file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey guys!

So I'm a teacher, and am learning Python alongside my kids in sort of a collaborative environment learning type. We're working with Python 3.5, and have been creating a simple programs.

Ideally they'd like to take these programs home show their parents without having to install any extra stuff on their own PC's at home, which I believe a simple executable file will allow them to do. The issue that I'm having trouble with is converting the script they have created into an exe file.

Doing this seems quite complicated. I've attempted using PyInstaller and Py2exe, but I think that because I'm using 3.5, it's more difficult than usual. Now I I'm not tech savvy by any stretch of the imagination, and I'm feeling my way through this as as I go.

I was wondering if someone could help me out, or point my in the right direction as to how to get this done. Ideally a step by step instruction would be fantastic, especially considering that I have little to no technical knowledge.


Cheers
:rolleyes:
You can use PyInstaller http://www.pyinstaller.org/
there are a lot of other packages, I have had good results with PyInstaller
see https://pypi.python.org/pypi?%3Aaction=s...mit=search

Not sure why you are having problems
what specific problems are you having?

Here's a tutorial http://excid3.com/blog/pyinstaller-a-simple-tutorial
To bring home and run exe from somewhat unknown source may not be welcome by some parents. Why not try cloud service like pythonanywhere or similar?

http://www.pythonanywhere.com/
http://c9.io/
http://pythonfiddle.com/
(Oct-13-2016, 10:52 AM)badteacher Wrote: [ -> ]take these programs home show their parents without having to install any extra stuff on their own PC's at home, which I believe a simple executable file will allow them to do.

.exe files are only helpful for Windows machines. Maybe many parents have such computers, but you should not presume so. Especially as a techer, I would encourage to also inform about Mac, Linux, etc. It seems like only Windows which does not come with Python already installed in the OS.

If you package an .exe with your python script, you essentially put the needed python installation files right alongside your (probably much smaller) code. This also means, if you want to show more than one .exe to the same people, you will always need to package and copy these larger files with all this extra stuff added each time. It seems indeed more intelligent to once install Python on Windows, and be done with it.

Then they can also show their parents the easy-to-read source code they wrote in Python, and it may get easier to understand, whereas this big binary .exe file will just be some form of magic, and can't even be adjusted on-the-fly if the parents have a nice tweaking idea they would like to see.

Maybe consider for future courses.

edit: Some nice feature-rich and easy Python installations for Windows include Python(x,y) or WinPython. They bring along lots of 3rd party modules you may or may not use in your course as well, also editing software, etc. etc.
The safest and more convinient way for students is to install Anaconda. The package is "isolated" full Python ecosystem with bunch of 3th party modules, package manage and so on.

Quote:Anaconda is a free, easy-to-install package manager, environment manager, Python distribution, and collection of over 720 open source packages with free community support. Hundreds more open source packages and their dependencies can be installed with a simple “conda install [packagename]”. It’s platform-agnostic, can be used on Windows, OS X and Linux. Or even easier, with new Anaconda Navigator for point and click install of environments and packages!

The students can run, test and do all they want with the code.
There are some School that use PythonAnywhere.
Quote:Start work at work or at school, and continue at home
Because PythonAnywhere is web-based,

it can follow you around on any computer (or iPad, or Chromebook) with a browser,
so you or your students can work from wherever you like.
Hey guys

Thank you for the barrage of new ideas and information. There are certainly a many ideas I will troll through.

I'm not currently on my computer where I do my coding on, so can't comment at the moment what the issue was. Though my vague memory suggests it had something to do with the installation of PyInstaller, specifically when it came to recognising(?) or finding(?) Python on my system. But really i can't confirm this until I perform the process again.

Until then I will investigate some of the more "noob friendly" options you guys have put forward and get back to you. 

:rolleyes:
So wanted to thank you guys again.

Though I haven't been able to (as yet) convert the files into .exe, I have explored other, more accessible, options you guys suggested and have settled on https://c9.io/. It's super cheap, easy to use and I can add as many kids as I want, but most of all they can access their work from home and show it working to whomever they wish.

Just in case anyone happens to search for this topic, here is a video from thenewboston on using cx_freeze to convert Python 3 into an .exe file. He has a tonne of video tutorials not just on Python, but a whole range of languages and other topics. When I did java at uni/college his videos often explained things better than any of the uni/college notes did.

Thanks again, and enjoy!

Glad you found something you like.
I will stick with PyCharm. I'm very familiar with it, and hate learning editors.
Should I ever change, it will probably be back to Emacs which I still use for many things,
and have been useing since Richard Stallman first wrote it back in the early 80's. It was
also the birth of GNU Which will be what Richard Stallman will forever be remembered for.

Personally I stay as much as possible away from 'The cloud'. In my humble opinion
it's one of the worst security risks ever taken. Kind if like letting you neighbor take care of
you're Gold (if your lucky enough to have any).
Pages: 1 2