Answer the question
In order to leave comments, you need to log in
Python: how to make GUI and compile under UBUNTU?
Good day to all! I switched to Ubuntu yesterday and I immediately had a question: how to compile a .py file under Ubuntu. That is, so that I can click on the icon and it starts. On Win10 there is pyinstaller and py2exe, but what about Linux?
Answer the question
In order to leave comments, you need to log in
I drew the interface (for the GTK widget set) in GladeUIDesigner, then inserted the xml code into the file as a string, and loaded the interface from the string. well, in the file header (in the very first line) there should be something that will force the code to be executed in python:
and then you make it executable in the properties orchmod +r myfile.py
For the GUI, you can use tkinter or Qt for Python .
The correct way to create an application available to the user is to create a "shortcut" in the form of a .desctop file:
https://gist.github.com/nathakits/7efb09812902b533...
This will allow you to find the program through the main menu, add an icon, pin the icon to the panel.
Such a file should be placed in ~/.local/share/applications/
For educational tasks, in 99% of cases it is convenient to run the code from the IDE or console.
The main way to distribute programs under Ubuntu is deb packages. This is an archive with the necessary files and a built-in script that knows where in the system these files need to wait. Making them is not difficult, but long and dreary. For educational tasks, this is also redundant.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question