Desktop launcher app, raspbian, Python

Thread Starter

Vindhyachal Takniki

Joined Nov 3, 2014
598
1. I am using raspberry pi 2 board with raspbian loaded.
2. I have made python program which have multiple files.
Like I have adc.py which calls spi library for RPi.
3. Then time library is used to call functions like time.sleep() & Some of my own files.
4. Now I want to create a desktop laucnher for that app. So that it appear on desktop & on double click it runs.
5. I have made below code by commandline but it don't work. How to do this.
6. I think problem is I have written only main.py in below code, but in actual code I have 8 .py files.

Code:
[Desktop Entry]
Encoding=UTF-8
Version=1.0                                     # version of an app.
Name[en_US]=yEd                                 # name of an app.
GenericName=GUI Port Scanner                    # longer name of an app.
Exec=python  /home/main.py                      # command used to launch an app.
Terminal=false                                  # whether an app requires to be run in a terminal.
Icon[en_US]=/home/yicon32.png                   # location of icon file.
Type=Application                                # type.
Categories=Application;Network;Security;        # categories in which this app should be listed.
Comment[en_US]=yEd Graph Editor                 # comment which appears as a tooltip.
 

strantor

Joined Oct 3, 2010
6,875
I don't know what I'm talking about because I've never used RPI (though I have one, and want to) or Linux (though I want to), but maybe I can still be of help.
Have a look at this. Specifically, this:
Python project scripts
If you’ve made a cool game or project in Python that you want to show off, then you’ll need to make sure your Python script (ending in .py) also contains the all-important shebang. Open your Python script in your favourite text editor and add the following as the very first line:

#!/usr/bin/env python

Now just save the file as usual, exit and away you go!
 
Top