This repository contains JavaScript files to facilitate running Python scripts on Flipper Zero, a versatile multi-tool device. It includes two JavaScript files and an example Python script.
Flipper Zero is a powerful tool with the capability to run Python scripts. This repository provides easy-to-use JavaScript files to streamline the process of launching Python on Flipper Zero.
- Run_Python.js: This JavaScript file enables launching Python on Flipper Zero.
- Run_Python_Scripts.js: This JavaScript file launches Python on Flipper Zero and then executes an example Python script called
example.py
. - example.py: An example Python script to demonstrate the functionality of
Run_Python_Scripts.js
.
- Create a mass storage image on the flipper called Python that's 4gb
- Download the embedded python zip from here - https://www.python.org/ftp/python/3.11.8/python-3.11.8-embed-amd64.zip
- Mount the flippers Python image and extract the python zip into that drive
- Open this file in a text editor "python311._pth" and uncomment "import site" then save
- Put this file attached called "get_pip.py" in the python drive that has python.exe, can also download it from here - https://bootstrap.pypa.io/get-pip.py
- Next open a terminal in that drive and run ".\python.exe get_pip.py"
- This will install PIP on the portable python image
- Once this is done you can directly call PIP to install modules with a command like ".\Scripts\pip install cryptography" that is run from the main python directory in your flippers storage
- Now you just need to put the run_python.js script in the Scripts section of your flipper and run it.
For Run_Python_Scripts.js
, make sure to have example.py
in a directory called Payloads in the root of the Flippers mass storage.
Contributions are welcome! If you have any improvements or additional functionality to add, feel free to open a pull request or create an issue.
This project is licensed under the MIT License.