eJournal: uffmm.org, ISSN 2567-6458, 30.Dec 2018; extension 10.April 2019
Author: Gerd Doeben-Henisch
This post is part of the online book project for the AAI-paradigm. As mentioned in the text of the book the AAI paradigm will need for its practical usage appropriate software. Some preliminary (experimentally) programming is already underway. The programming language used for this programming is python. Here some bits of information how one can install a simple python environment to share these activities.
WINPYTHON OR ANACONDA WITH SPYDER
(Windows as well as Linux (ubuntu))
To work with the python programming language — here python 3 — one needs some tools interacting with each other. For this different integrated development packages have been prepared. In this uffmm-software project I am using the spyder development environment either as part of the winpython distribution or as part of the anaconda distribution.
The winpython package can be found here. See also the picture below.
If one has downloaded the winpython distribution in some local folder then you will see the following files and folders (see picture below):
SPYDER INTEGRATED ENVIRONMENT
To use the integrated spyder environment one can also look to the spyder website directly (see picture below).
The spyder team recomments to download the spyder software as part of the bigger anaconda distribution with lots of additional options (see picture below).
Downloading the anaconda distribution needs much more time then the winpython distribution. But one gets a lot of stuff and the software is fairly good integrated into the windows 10 operating system. I personally recomment for the beginners not to beginn with the complex anaconda environment but to stay with the spyder integrated environment only. This can be done by activating with the windows-button the list of apps, looking to the anaconda icon, and there one can find the spyder icon (an idealized spyder web). One can click with the right mouse button on this icon and then select to ‘add to the task bar’. After this operation you can observe the spyder icon as attached to the task bar like in the picture below.
If one activates the spyder icon a window opens showing some standard configuration of the integrated spyder development environment (see picture below).
The most important sub-windows are the window left from the editor and the window right-below from the console. One can use the console to make small experiments with python commands and the editor to write larger source code. In the header bar are many helpful icons for editing, running of programs, testing, and more.
If one is working with linux (what I am usually are doing; I use the distribution ubuntu 18.04.1 LTS) then python is part of the system in version 2 as well in version 3 and spyder can be used too.
Besides the integrated development editor (IDE) spyder you can find even more programming tools. One very helpful tool is the WinPython Console (see icon within the red circle). You can attach this icon on your task bar too and then you can start the Winpython Console by clicking on it.
To apply this console to some python programm you have to navigate to that folder where you have the python program to be executed. If You do not know already the whole path then you have two options: (i) move the path upwards by using the command ‘cd ..’ (change directory one level upwards) or (ii) move the path downwards by using the command ‘cd DIR-NAME‘. If you are in a new folder you can use the command ‘dir‘ to list all the files and folders in the actual directory. Doing this You can reach the following folder with some python program files:
There is one example file pop0e.py which we can start (the whole program will be described later in detail).
For this last example with the Winpython Console the program can be edited by nearly any kind of a text editor. After the file has been saved with a .py ending one can use the console to start the program. In the last example (cf. figure 3) the important input was: ‘python pop0e.py‘ this states that the python interpreter shall take the program text of the file ‘pop0e.py’ and execute the program.
For an overview of all posts in this block about programming with python 3 see HERE.