Roman
Roman

Reputation: 131058

How to make a user friendly start of a Python program?

I have a Python program (GUI application). I can run this program from the command prompt on Windows (command line on Linux). But it can be too complicated for users. Is there an easy way to initiate a start of the program with a click (double click) on a pictogram (a small image on the desktop)?

Upvotes: 1

Views: 4259

Answers (4)

Arkapravo
Arkapravo

Reputation: 4094

Use py2exe to make an exe and just to make it more 'user friendly' use Inno set up (www.jrsoftware.org/isinfo.php ) along with IStools to build up an installer which would integrate the GUI with sound, widgets, other elements etc and users who do not have python etc installed in their systems can also play your GUI perfectly fine !

By the way what GUI are you using ? pygame, tk, wx, PyQt ...etc ?

Upvotes: 1

Anurag Uniyal
Anurag Uniyal

Reputation: 88737

Linux: I am not sure, which linux distro and desktop you use but for gnome I create such files on desktop e.. create a myapp.desktop and put in on desktop

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=MyApp
Type=Application
Exec=python /home/anushri/display.anurag/xxx.py
TryExec=
Icon=/usr/share/pixmaps/gnome-qeye.png
X-GNOME-DocPath=
Terminal=false
Name[en_IN]=MyApp
GenericName[en_IN]=MyApp
Comment[en_IN]=MyApp
GenericName=MyApp
Comment=MyApp

Windows:

Right-click an open area on the desktop, point to New, and then click Shortcut, type the command line to start you program, Type a name for the shortcut

Upvotes: 1

jsn
jsn

Reputation: 163

What I've done in the past is use py2exe to create an executable from my python script. That embeds the interpreter and the source inside an EXE, that way it works just like a native executable and you don't have to have the users install python or anything complicated.

Upvotes: 0

Lay
Lay

Reputation: 151

I'm not sure if I understood the question well, but if you just need a way to simulate a command line input with a simply clickable icon, just create a simple .bat file (assuming windows) on the desktop, as a new text file containing something like

C:\[Pythonpath]\python C:\[MyPythonAppPath]\myapp.py

See http://en.wikipedia.org/wiki/Batch_file for more info.

Upvotes: 1

Related Questions