This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Install Dependencies: Install pyinstaller, dpkg-dev, and debhelper. | |
| Create Executable: Use pyinstaller --onefile main.py to generate an executable. | |
| Create Package Directory Structure: Set up the directory structure for the .deb package (~/my_app_package/usr/local/bin and ~/my_app_package/DEBIAN). | |
| Move Executable: Move the main executable to the appropriate directory inside the package. | |
| Create Control File: Write the package metadata in the control file. | |
| Build the .deb Package: Use dpkg-deb --build to create the .deb package. | |
| Install the .deb Package: Use dpkg -i to install your package. | |
| Test the Executable: Run your executable to confirm it works. | |
| Clean Up: Optionally clean up the build files. | |
| Now, you have a .deb package for your Python application! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| In this Gist, we will create a simple REST API using Flask, a popular web framework for Python, and SQLAlchemy, an ORM (Object Relational Mapper) for managing database interactions. | |
| Prerequisites: | |
| Make sure you have the following installed: | |
| Python 3.x | |
| pip | |
| Flask | |
| Flask-SQLAlchemy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Update package lists | |
| sudo apt update | |
| # Install PostgreSQL and contrib packages | |
| sudo apt install postgresql postgresql-contrib | |
| # Start and enable PostgreSQL | |
| sudo systemctl start postgresql | |
| sudo systemctl enable postgresql |