TeCoEd (Teaching Computing Education)
  • Home
    • Freelance
    • Book
    • Downloading
  • Python
    • Learn Python >
      • Python Modules
    • PyGame Zero
    • Python Programs >
      • Higher or Lower
      • Magic Calculator
      • Password Checker
      • Python Pit
    • What's News App
    • Pixels to Cells
    • Python Mosaics
    • Python OCR
    • L-1-AM
    • Web Scraping >
      • Scraping Trains
    • Weather App
    • Snakes and Windows
    • Python Web Server >
      • Flask
    • Python Picks
  • Raspberry Pi
    • All About the Pi
    • Getting Started
    • Remote Desktop and VNC
    • Static IP Address
    • Sonic Pi >
      • 3.14
    • Twitter Feed >
      • Tweepy
    • Android & Pi >
      • Advanced Apps
      • Odds
    • A.I on the the Pi
    • CRON
    • Pick Your Own
  • Pi Hardware
    • Pi HATS >
      • Sense Hat Hacks
      • AstroPi HAT
      • Unicorn-HAT >
        • Unicorn Alphabet Disco
        • Uni Codes / Programs
      • Skywriter
      • Piano HAT
    • STS Pi
    • Pi Camera >
      • Pi-Cam, Python & Email >
        • Time Lapse
      • Pi Noir
    • Pipsta >
      • Flask, Input & Printers
    • Raspberry Pi Power >
      • Energenie IR power
    • Pibrella
    • Distance Sensor
    • LCD Screen
    • Pi-Tooth
    • Robot Arm
    • PiGlow
    • PiFM
    • Accelerometer
    • PiFace >
      • Installing PiFace >
        • Python Commands
  • Pi-Hacks
    • Drone Hacks
    • Pi Glue Gun Hack
    • Blinkt!
    • Sonic Pixels
    • R2D2
    • Get to the chopper
    • Astro Bird
    • Twitter Translator
    • Hacking a Robot
    • Nature_Box >
      • Best Nature Photos
    • Wearable Tech >
      • Project New York
      • P.N.Y Part 2 Health
      • P.N.Y Part 3 Games
      • P.N.Y Part 4 Translation
    • Dino-Tweet
    • Other Links
  • Pi-Hacks 2
    • The Joker
    • Hologram Machine
    • Google Vision: Camera Tell
    • Yoda Tweets
    • Pi Phone
    • Darth Beats
    • Twitter Keyword Finder
    • Crimbo Lights Hack
    • Xmas Elf
    • Halloween 2016
    • Halloween Hack 2015
    • Socrative Zombie
    • Voice Translation
    • The Blue-Who Finder
    • GPIO, Twitter
    • Pi Chat Bot >
      • Dictionary Definitions
    • PiGlow & Email
    • Pibrella Alarm System
    • SMS with Python >
      • Spooking a Mobile
  • Pi-Hacks 3
    • Ferminal
    • Crypto Tracker
    • David Bowie
    • Lamp Prank >
      • TEST
    • Yoda FM
    • Retro Player
    • LED Pixel Art
    • TARDIS
    • Battleships
    • LED Board
    • Night Vision
    • Enviro+ Weather
  • Minecraft
    • Minecraft API
    • Minecraft Sweeper
    • PiGlove: Minecraft Power Up
    • Minecraft Photo-booth
    • Rendering Pixels
    • Speed Cube
    • Lucky Dip
  • Computing
    • Why Computing?
    • Can You Compute
    • micro:bit
    • Coding Resources
    • Learn to Code >
      • Coding with iPads
      • Apps Creation Tools
      • sKratchInn
      • Sound Editing
    • Cheat Sheets
    • Theory
    • HOUR OF CODING
    • BEBRAS Computing Challange
    • Computer Facts
    • Free Software and Links
  • Contact Me

What is it?


By now, you will probably have created a Python program that you may then wish to share with others.  They may not have Python and therefore the program will not run or they may have to install Python and all the required modules first.   This can be a stalling point and stop others from using your program.  There are however several packages that are available that will create a distributable file that will work on Windows, Mac or Lunix operating systems.  Your program can operate as a stand alone application or as an installable piece of software.

This section covers how to install and use cx_Freeze to create a stand-alone or installation version of your Python program.  First download the cx_Freeze version for your computer, make sure it is the correct version for the version of Python that you code with and the 32 or 64 bit compatibility.

The easiest way the use the cx_Freeze is to run it from the command line, this requires you to add Python to the command line so that you can access an use it from the command line.  Basically the simple instructions are to open the ‘advanced system settings’ (windows 7 search)  Control Panel, Systems and Security settings, Systems, Advanced system settings and environment Variables.  Then add the version of Python to the Path setting ;\C\Python27 (see video below)

Prepare your setup file, there are many templates available but the one included below was from Python School.  Enter the name of the application as you wish it to be called once the build process has completed.  Then select the file that you are going to build.  Ensure all other related files, images etc are also stored in the folder that the Freeze will use to build the final standalone application

Load the command line (cmd) navigate to the folder that contains the python program you wish to freeze.  I usually add this to the desktop so that you can easily find it. Use cd Desktop to move to the Desktop and then cd and the name of the folder that contains the Python programs and setup.py file

Run the command python setup.py build or python setup.py bdist_msi or install.  Build will build an application that will run but will not require installing, it will create a stand alone application.  The bdist_msi creates an installable version of the Python program that will install the program onto your computer once you open it.  It will behave similar to a software install allowing you to select which directory to save / install the software to. Mac users

Further information and commands can be found at the link here 

Powered by Create your own unique website with customizable templates.