Busy with Linux!

Python and Linux (LOPORA and other Python programs)
Installation of Python in Windows was very simple and finished within 15 minutes. But that took many evenings in Linux. Linux is not for you mother in law! For Linux, you have to be quite a computer Nerd to install and configure the software.
I got an old PC without operating system. A perfect opportunity to try out Linux. I installed Ubuntu 12.04 LTS, was very easy to do. As a surprise, Python was also installed with Linux! And the more you do work with Linux, the easier it will be and the more you will appreciate Linux.
Here below the installation of the software and instructions for possible configurations will be described.

Software installation and configuration

Is there only one method in Windows, in Linux there are more ways to install software. I did that as described here below. But probably it is also possible with the application "Ubuntu Software Center".

Open a console window: CTRL+ALT+T or search for "Terminal" with the Dash Home (can be found on top in the Launcher). Or for the real Linux Nerds: CTRL+ALT+F1, but then your Desktop environment has gone and you cannot scroll the console window anymore. And my keyboard gave strange characters.

Installation of Python if that has not been done, type the following commands+Enter:
sudo apt-get install python

Installation of Numpy, type the following commands+Enter:
sudo apt-get install python-numpy

Installation of the PIL library, type the following commands+Enter:
sudo apt-get install python-imaging python-imaging-tk

(The command "sudo" will give you the required rights to install the software as administrator, "apt-get install" is the command to download and install the software.)

And close the console window by typing EXIT or clicking the red little cross of the console window (or CTRL+ALT+F7 if you opened it with CTRL+ALT+F1).

The next steps will be done in the Desktop environment:

Installation of Python audio:
Open the webbrowser and download from the site "":
"python-pyaudio_xxxx.deb" and click on the file (xxxx is the applicable version).
Then it will be installed automatically by the Ubuntu Software Center.
During a 2nd installation of Linux, it turned out that "pyaudio" could also be installed with the Ubuntu Software Center by searching for "pyaudio".

Installation of Python IDLE:
Search with the Ubuntu Software Center "Python for IDLE(using Python-2.7)" and install it. This is the developement environment / editor for Python, but there are also others available.

Of course we have to control the audio. Lock the Sound application
to the Launcher, then you do not have to search for the application all the time.

And we want to control the audio very easily.
Search with the Dash Home (can be found on top in the Launcher): Applications ==> "Sound" and lock to Launcher.
This locking can be done by starting the application "Sound". The icon will appear in the Launcher. The Launcher can be found at the left screen edge on the Desktop by moving you mouse towards it. Press with your right mouse button on this icon and choose "Lock to Launcher".
It is also handy to lock the program "IDLE" to the Launcher.

But how do we start LOPORA? There are more possibilities!

Starting LOPORA (or another Python program)
The next possibilities have been tried out:

Possibility 1:
Start "IDLE" and open in IDLE the Python program "LOPORA". Now you can modify it and run the program as follows.
Select "Run" and then "Run Module". Now you will see two windows, one with the program and a Python Shell window where you can find various remarks and error messages. The advantage of this method is that the Shell Window does not dissappear when an error occurs and that you can read the error message.

Possibility 2:
Open a console window: CTRL+ALT+T or search for "Terminal" with the Dash Home (NOT CTRL+ALT+F1, that does not work here!!!) and go to the directory where the program can be found.
Type "python" (of "python2.7" when you want to use version 2.7) and the program will start. Beware of uppercase and lower case characters and of course without the "" signs!

Possibility 3:
Make in the same directory as the program a script file with the name "".
This file contains the ASCII text:
cd /home/onno/Python/MyPython/QRSS

In the first line the directory will be changed to that where the program "" is. Here, "onno" is the username, will be different in your PC. And your directory will also be different, so modify it for your own PC.
In the second line, the program will be started.
Make this scriptfile executable (click with the right mouse key on this scriptfile and look at permissions). When you do click on this file and if you select "Run", LOPORA will start.
It is also possible to place a link to this scriptfile on the Desktop. Then you can start the program by clicking on this link on the Desktop.
And you can add this scriptfile to the "Startup Applications" via the "Dash Home" application on top of the Launcher at the left on the Desktop (search for Startup Applications). That is what I did, LOPORA does start when the PC is switched on. And LOPORA can be set to "autorun mode".

Add the name of the scriptfile to the Startup applications if you
want to start LOPORA automatically when the PC is switched on.

Default opening of a Python program (.py file) with IDLE
It is very handy that a .py file will be opened with the developement environment "IDLE" when you do click on such a file with the mouse. Also that could be realized!

Open a console window: CTRL+ALT+T or search for "Terminal" with the Dash Home.

Type the following commands:
cd //
cd usr
cd share
cd applications
Now you will see a list of .desktop files of the applications. Somewhere you can find "idle-python2.7.desktop" on the screen (the name is perhaps different on your PC).
sudo gedit idle-python2.7.desktop
By the command "sudo", this file will be opened as root-administrator in the text editor "gedit".
Modify the line "exec=/usr/bin idle-python2.7 -n" in "exec=/usr/bin idle-python2.7 %F".
By adding %F, it has become a selectable application.

We can make "IDLE" a selectable application by adding %F.

Save the file and close the console window by typing EXIT or clicking the red little cross of the console window (or CTRL+ALT+F7 if you opened it with CTRL+ALT+F1).
Search with the file menu for a .py file (for example and click that file with the right mouse key.
Select "Properties" and then select "Open with" and then select "Show other applications".
Select "IDLE" as application and make it the default by clicking the button "Set as default". All .py files will be opened now with "IDLE". When you do click, it will be opened with "IDLE".

Error message: "IOError: [Errno 2] No such file or directory: 'helvB08.pil'"
When you have this or similar problems, you working directory is not the same as that of the Python program. Can happen for example when you made a link to the program, then the working directory will be the directory of the link instead of the directory of the program. Can be avoided by starting the program via Possibility 3 as described here above.

UTF8 errors are possible with other languages like for example Russian. Search on the internet for a solution for Python in you language.

Still a small problem
When starting the PC, I always have to disconnect and reconnect the audio plug from the "line input". Otherwise, the soundcard does not work correctly. If other PC's do have the same problem and what the reason is, I don't know...