Alfred's New Ramblings

Creating a portable Python program

Creating a portable Python program or continuing from my adventures of starting to program in Python. I have pulled a repository that converts Cisco show inventory into Excel.

After tinkering around, I got the program working to extract the inventory from my Cisco config files. I have added a few interface hardware types, as these originally weren’t available.

I created an executable before, but the installer requires admin permissions to install some DLLs. That is not going to work on corporate computers.

It has to be in a portable format, so no installation is required. This requires the installation of PyInstaller.

pip install pyinstaller

Thereafter, compile the Python program

pyinstaller --onefile your_script_name.py

This will create the Windows executable in the DIST folder. The next step is to distribute the program without tripping the Antivirus or Email filters.

Link

Tagged on:



Leave a Reply

Your email address will not be published. Required fields are marked *