Module 1: Introduction To Python
Module 1: Introduction To Python
• Installation
– Install python on you own computer going to the following link and chose the newest
version for you operation system
– https://www.continuum.io/downloads
• Download the example files in a folder of your chose. Tthe Jupyter notebook and the python
files have the extensions
Jupyter notebook files: *.ipynb
Python files: *.py
Jupyter Notebook (1/3)
In order to start the Jupyter notebook code (.ipynb) you can e.g. do the following in Windows
• Right click (with the shift key down) on the folder where the code is located and chose “Open
command window here
• If you double click on a cell (both text and commands), you can modify the content. By
pressing <Ctrl>+<Enter>, you will execute the code. You can run the full code by go to the
menu: “Cell->Run All”. If you want to reset all variables you should run one of the Kernel
reset/restart menu point. The type: “Markdown” or “Code” indicate whether the specific cell
is text or a Python code sequence.
Jupyter Notebook (3/3)
• Use e.g. 15 minutes explore the notebook and try e.g. to modify some of the code sequences
and re-run it.
• The way the plotting of curves occurs can be defined by using one of the following two
jupyter notebook specific commands where the first version just show the curves on the page
while the second version are given a zoom able versions of the plots. If the second option
gives empty plot windows, you may need to rerun that specific cell by pressing
<Ctrl>+<Enter>
Jupyter Notebook over a server
• As an alternative of installing Jupyter notebook yourself, the code can also be runned over a
server. As a demonstration, I have uploaded the script to the “Microsoft Azure Notebook”.
Sometime, the graphic part does not come correctly in the preview and you need to run it
yourself
– https://notebooks.azure.com/anon-x8vbbq/libraries/46W17
• If you want to modify and run it yourself through the server, you need to have your own
account on “Microsoft Azure Notebook”. Users at DTU can use there DTU-login in order to get
access to that.
Spyder GUI (1/3)
• The spyder gui, you can
start from the icon