Introduction to Programming with Scientific Applications

Aarhus University, Department of Computer Science

Windows 10 installation

CPython, pip, and IDLE

From python.org you can download the reference implementation of Python, nicknamed CPython (since it is coded in C):

Note. By default a 64-bit Windows version of Python is installed. For memory consuming Python programs on Windows (requiring above 2GB of RAM), it is important that you download the 64 bit version of Python, also available at www.python.org/downloads/windows as “Windows installer (64-bit)”. The 32-bit version is “Windows installer (32-bit)”, and limits your programs to using 2GB of RAM.

Additional Python packages are installed using the program “pip3”, included in the above download. To e.g. install the SciPy package that will be used in the course (see SciPy.org for more information on the package):

Part of the download is IDLE, an integrated development environment for Python. Existing Python files (ending on .py) can be opened and edited in IDLE by right-clicking on the file and selecting “Edit with IDLE”. The IDLE application should also appear in your Windows Start menu (or Windows-key + “IDLE”).

A Python program program can be executed in several ways.

  1. The easiest is just to double click on the file name, but this closes the output window immediately after the program terminates.
  2. Open the program in IDLE and press F5 to “Run Module”.
  3. Execute the program from a Windows shell:
    • Open a Command Prompt (Windows-key + type “cmd”)
    • Change to the relevant folder, e.g. “cd C:\Users\ username \Desktop"
    • Run the python program (here test.py on your desktop) using e.g. “python test.py”

Anaconda - an easy start to Python

Anaconda wrote on their webpage that it is “The Most Popular Python Data Science Platform”. Anaconda bundles Python, a lot of libraries, and the Spyder IDE. To install Anaconda:

Note: Anaconda does not necessarily support the most recent version of Python provided at python.org.

PyPy - for the performance demanding Python programmer

PyPy is an alternative implementation of the Python language that is often faster than CPython, but does not support the most recent versions of Python. To install PyPy:

The speed improvements of PyPy over CPython are due to the usage of the Just-In-Time compilation technique, that e.g. also is used inside the Google Chrome browser for executing JavaScript (see the Wikipedia page on Chrome V8 and by Java Virtual Machines for executing Java programs (bytecode) (see more on Just-In-Time compilation on Wikipedia).