1

I wrote an application to store data in the database using tkinter and python3. I can launch the application using the terminal by running databaseapp.py

I want to know if it is possible to have a launcher icon. So that i can run the application just by double clicking on the icon. My applcation will run on a debian linux

1

1 Answer 1

2

You can use desktop files. For your example, do this:

#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.0
Name=Database app
Comment=Launch the Database Application
Exec=bash -c "python3 /path/to/database.py"
Terminal=false
Type=Application
Categories=Application;

Place this file on your desktop. When you click it, you will be prompted if you want to run the file. Click 'Execute' and it should open your app.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks the approach works when i wrote a test program which is writtern only in one file but when i run a program which imports from other files this approach doesnot work
If you use other files do bash -c "cd directory_where_your_files_are; python3 database.py"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.