====== Python ====== This page provides basic walkthroughs and tutorials for the programing language Python. We do not cover all aspects of programming in Python. We provide some starting points and expect you find more. We recommend {[a4b99rph:Wentworth2012]} as your main teaching material. The more advanced book {[a4b99rph:Pilgrim2009]} may perhaps be more interesting for experienced programmers /* ===== PyCharm ===== Integrated Development Environment (IDE) Pro version: - log in by using your faculty email https://account.jetbrains.com/login - then you may download https://www.jetbrains.com/student/ For us, Community Edition is actually quite fine https://www.jetbrains.com/pycharm/download/ We actually need none. So if you are used to work in Emacs, Vim, ... and terminal/shell yust keep doing. */ [[courses:be5b33kui:tutorials:python_installation|Python Installation]] ===== Visual Studio Code ===== * Integrated Development Environment (IDE) * Install Python (as described above) before trying to install VS Code. * Then, install VS Code: [[https://code.visualstudio.com//|https://code.visualstudio.com/]]. * Once installed, run VS Code. Click 'Extensions' on the vertical bar on the left side and install //Python//. * If there is ever the need to share your screen with the teacher in case you are stuck and need help, and there is no more practical alternative, the //Live Share Extension Pack// can also be installed. ====== Jupyter Notebooks ====== While not very useful for this course, as it is not really adapted to the kind of assignments we'll give you, we'd like to present you with a tool that might be useful in your future, or in other courses: [[https://jupyter.org/try-jupyter|Jupyter Notebooks]]. This is especially interesting to do data analysis, when you try to plot graphs, and might want to instantly see the outcome of your python code and the graphs generated, while being able to quickly edit it if necessary. ===== PyTest ===== ''pytest'' is a framework for writing tests in Python. (Python includes built-in modules ''doctest'' and ''unittest''; but ''pytest'' allows you to write tests with a minimal amount of "redundant" code.) The parts of the documentation you'll probably need the most: * [[https://docs.pytest.org/en/7.1.x/getting-started.html#get-started|Installation and first examples of use]] * [[https://docs.pytest.org/en/7.1.x/how-to/usage.html|How to run tests from the command line]] (PyCharm or VS Code allow you to run tests in built-in modules.) * How to use [[https://docs.pytest.org/en/7.1.x/how-to/fixtures.html|fixtures]] * [[https://docs.pytest.org/en/7.1.x/how-to/parametrize.html|Parameterized tests]] ---- Credits to the BE5B33PRG course for parts of this tutorial page.