There are plenty of Linux resources on the internet but far fewer (or none, as far as I could see) that provide a simple set of steps for getting a Python application up and running on your PC. So, as much for my own reference as for anyone else’s benefit, this is what I’ve come up with.
Firstly, though, a disclaimer. The steps described below work but that is no guarantee that they represent the correct approach. If anyone does have any corrections, suggestions or improvements, all feedback is gratefully accepted.
And another disclaimer. Always check the repositories for your Linux distribution first. If the application can be installed using your package manager, then that is what you should do.
However, there are sometimes cases in which you have either commuted an act of Python yourself or the application you want isn’t yet available and you want it enough to resort to downloading tarballs.
A tarball file is an archive of files in a single file and will have an extension of .tar.gz, .tgz or .tar.bz2. Since this post is specifically about Python applications, it is safe to assume that we are talking about an archive of source files. I am going to further assume that you have downloaded the tarball to your Home folder.
So the first thing you will need to do is uncompress the tarball. Depending on the extension, you will need to use one of the following commands:
$ tar zxf ~/shinyapp.tar.gz
$ tar zxf ~/shinyapp.tgz
$ tar jxf ~/shinyapp.tar.bz2
$ tar jxf ~/shinyapp.tbz2
You will, of course, need to replace the text shinyapp with the actual name of your downloaded tarball. I will continue to use the term shinyapp for the rest of this post – replace as appropriate.
Because Python is an interpreted language, there is no need to compile it. But you will need to do a bit of set-up to ensure you can execute it as easily as everything else. To do this, you need to be root.
First of all, move your uncompressed folder to the /usr/local/src directory:
# mv ~/shinyapp /usr/local/src
Next you need a Bash script to launch the application. The location of this script matters and you can establish what it should be with the following command
$ echo $PATH
This will return a colon delimited list of folders. These are the places that your distro expects to find Bash scripts – putting it anywhere else isn’t going to work.
The folder /usr/local/bin/ is generally a sensible place to put your local scripts.
To create the script file using the Nano text editor:
# nano /usr/local/bin/shinyapp
And then, in Nano, edit your empty file so it looks something like this:
#! /bin/bash
python /usr/local/src/shinyapp/shinyapp.py
Return to the command line and make your script executable..
# chmod +x /usr/local/bin/shinyapp
Congratulations. You have just created a command. You can execute this command from within a terminal or by pressing Alt-F2 (in Gnome), you can also – and more usefully – either create a launcher or add it to a menu.

Talkback