Sunday, April 1, 2018

Turning your scripts into executables

Sometimes you may want to distribute your python work as a single .exe file.   This post explains how to do it easily with PyScripter.

  • If you do not see “Install packages with pip” under Tools Tools you first need to create a new Tool that helps you to use pip from PyScripter as explained in a separate blog post.
  • Use the pip tool to install pyinstaller.
  • Setup a new tool to use PyInstaller using Tools, Configure Tools, Add and completing the dialog box as shown below:

Capture

  • Open in editor the script and invoke the new tool.  You can watch the pyinstaller output in the Output window.  After a short while and if everything goes smoothly your executable will be ready and can be found in a folder called “dist”, below your script.
  • You could create another tool to easily test the generated executable, but I will leave that as a little challenge.

No comments: