Python Forum
Convert script into an exe file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Convert script into an exe file
#1
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:
Reply
#2
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
Reply
#3
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/
Reply
#4
(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.
Reply
#5
Whhat problems are you having?
http://python-forum.io/Thread-Building-a...ith-Py2exe
Recommended Tutorials:
Reply
#6
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.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#7
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.
Reply
#8
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:
Reply
#9
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!

Reply
#10
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).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question [SOLVED] Correct way to convert file from cp-1252 to utf-8? Winfried 8 921 Feb-29-2024, 12:30 AM
Last Post: Winfried
  Convert File to Data URL michaelnicol 3 1,184 Jul-08-2023, 11:35 AM
Last Post: DeaD_EyE
  Python Script to convert Json to CSV file chvsnarayana 8 2,553 Apr-26-2023, 10:31 PM
Last Post: DeaD_EyE
  Convert Excel file into csv with Pipe symbol.. mg24 4 1,348 Oct-18-2022, 02:59 PM
Last Post: Larz60+
  Need Help: Convert .pcl file to .pdf file ManuRaval 6 2,563 Sep-13-2022, 01:31 PM
Last Post: ManuRaval
Question convert autohotkey script to python / macro - press key when pixel get colour willson94d 1 3,672 Jan-01-2022, 08:13 PM
Last Post: Yoriz
  Convert legacy print file to XLSX file davidm 1 1,819 Oct-17-2021, 05:08 AM
Last Post: davidm
  Yahoo_fin, Pandas: how to convert data table structure in csv file detlefschmitt 14 7,815 Feb-15-2021, 12:58 PM
Last Post: detlefschmitt
  [split] How to convert the CSV text file into a txt file Pinto94 5 3,377 Dec-23-2020, 08:04 AM
Last Post: ndc85430
  CPC File Format (Cartesian Perceptual Compression) - Can Python Convert / Handle Them PSKrieger 2 2,487 Nov-11-2020, 02:57 PM
Last Post: PSKrieger

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020