Installation Program_Execution Data_Structures Data_Input Data_Handling Functions Data_Manipulation

Goal

  • Install a Python distribution on your computer
  • Add additional packages
  • Install an IDE (integrated development environment)
  • Configure Python and the IDE for a smooth workflow

Additional Information

If you want additional information, please check out:


Download the Following Materials

On Your Computer

  • Make sure you have a program to zip and unzip data installed (e.g. 7zip).
  • Clean up your Windows Desktop: You should not have more than seven icons on it. And don't just pull files onto the Desktop, always save them into folders!
  • Turn on Windows File Explorer | View -> Show -> File Name Extensions.
  • Make sure you have a clear file-structure on your computer:
    • Know your home-directory! (in the powershell, you can get there with ~; in the command window you see it when you type %USERPROFILE%)
    • Either from there, or from the Documents directory, make a sub-directory FH, and there a separate folder for each lecture.
  • Go to https://work.thaslwanter.at/py_intro, Chapter Installation, and install a Python Distribution(e.g. WinPython) on your computer. Note: WinPython should be installed in the directory C:\Programs. You may have to create this directory if it does not already exist!
  • Try to work through that chapter as far as possible. Note that there is a video at the bottom of that page to help you.

Personalize your computer

The following steps are for Windows users. For Mac, check out the instructions in my book "Hands-on Signal Analysis with Python" , in the chapters 2.1.2. (Installation of Python) and 2.3.3. (Personalizing IPython/Jupyter).

  • Set Environment path so that Python gets detected (The following assumes you have installed WinPython in the folder C:\Programs!)
    • In Alt+Win | Edit environment variables for YOUR account | Path | Edit | New | C:\Programs\WPy64-31450\python\Scripts | OK | OK
    • The same, with C:\Programs\WPy64-31450\python
  • Add ~\ipynb.bat to your home directory, containing the following text:
    jupyter lab %1
  • Add ~\ipy.bat, containing the following text:
    cd [here you have to enter the directory where you want to work!]
    jupyter qtconsole

Installation of an IDE

There are a number of very good Integrated Development Environments (IDEs). The following links provide tips for the installation of each IDE:

Check if your system is properly configured

  • Open a "command terminal"/"command console" by typing "WIN+R | cmd | OK".
  • In this terminal enter the command python. If your system is properly configured, Python should start up in your terminal. You can exit it by typing exit.
  • If Python does NOT start, please re-read section "2.1.2 Installation of Python | Under Windows" in "Hands-on Signal Analysis with Python".
  • If your system has been configured properly, you should be able to immediately work with Python after starting an IPython interpreter. For example, you can start a QtConsole from your terminal, with the command jupyter qtconsole. You can test your configuration by typing the command plt.plot(np.sin(np.arange(0, 10, 0.1))). This should plot a sine-wave in your QtConsole.

Packages

When that is done, you can focus on your "Python packages". Start a command terminal (NOT Python!), and try out the following commands:
  • pip list : shows all installed packages
  • pip show numpy : shows the details of your NumPy installation
  • pip install FreeSimpleGUI : installs a package that is very useful for the generation of GUIs (graphical user interfaces)
  • where python : shows you where the Python executable is located on your computer

The Terminal

  • Try out Windows Command Prompt (cmd) or Terminal (pwsh or terminal). Know what * means (Wildcard: "any file/folder containing").
  • You may also want to check out powershell-tips or cmd-tips.

Check your first Python Skills

  • Is Python running on your computer?
  • Where is the Python executable located?
  • What is the difference between Python and IPython?
  • How do you check if your program is running properly? (Answer: try to run it from the command line.)
  • Do you know how to run an IPYNB-file?
  • Do you know the most important keyboard shortcuts in JupyterLab?