Integrated Development Environment (IDE)#

We recommend to use JetBrains PyCharm as IDE to program in Python. The community edition is open-source and sufficient for our purposes. Follow the instructions to install PyCharm.

To open the MIALab as project and to configure the Python interpreter do the following:

  1. Launch PyCharm

  2. Click Open (or File > Open)

    1. In the dialog navigate to </path/to/where/you/have/the/code>/MIALab

    2. Click OK

    3. MIALab is now open as PyCharm project (PyCharm created the .idea directory)

  3. Click File > Settings… to open the settings dialog

    1. Navigate to Project: MIALab > Python Interpreter

    2. Select the Python interpreter </path/to/your/anaconda/installation>/envs/mialab/bin/python (on Linux and macOS) or <\path\to\your\anaconda\installation>\envs\mialab\python.exe (on Windows)

      Hint

      If the interpreter is not available in the combo box, click the gear icon and choose Add Local and navigate the the files above

    3. Confirm by clicking OK

  4. Open the hello_world.py (bin directory) in the navigator

    1. Right click in the editor > Run ‘hello_world’

    2. Runs the hello_world and adds a configuration (see top right corner) to the project

    3. You can add configurations manually under Run > Edit Configurations…

You can watch the getting started videos to get accustomed with the interface.

Additional Configuration#

To change the docstring format to Google do the following:

  1. Click File > Settings… to open the settings dialog

  2. Navigate to Tools > Python Integrated Tools

  3. Select Google in the Docstring format dropbox

  4. Click OK

To add a configuration for the Sphinx documentation do the following:

  1. Click Run > Edit Configurations…

  2. Click Add New Configuration (plus icon) > Python docs > Sphinx task

  3. Edit the following

    1. Name (e.g. docs)

    2. Input to </path/to/where/you/have/the/code>/MIALab/docs (on Linux and macOS) or <\path\to\where\you\have\the\code>\MIALab\docs (on Windows)

    3. Output to </path/to/where/you/have/the/code>/MIALab/docs/_build/html (on Linux and macOS) or <\path\to\where\you\have\the\code>\MIALab\docs\_build\html (on Windows)

  4. Click OK