From d82f1c14264c1d3e48c42b5d02e2c67592da7327 Mon Sep 17 00:00:00 2001 From: richelbilderbeek Date: Tue, 16 Jan 2024 07:53:57 +0100 Subject: [PATCH] Connect to prior knowledge --- .../command_line_arguments.md | 78 ++++++++++++++++++ docs/afternoon_session/files.md | 77 ++++++++++++++++++ docs/afternoon_session/functions.md | 80 +++++++++++++++++++ docs/afternoon_session/graphics.md | 77 ++++++++++++++++++ .../afternoon_session/hello_little_turtles.md | 77 ++++++++++++++++++ docs/afternoon_session/overview.md | 29 ++++--- docs/morning_session/overview.md | 43 ++++++---- .../morning_session/the_way_of_the_program.md | 55 +++++++++++++ .../using_the_python_interpreter.md | 55 +++++++++++++ .../variables_expressions_and_statements.md | 78 ++++++++++++++++++ .../working_with_python_scripts.md | 55 +++++++++++++ 11 files changed, 678 insertions(+), 26 deletions(-) diff --git a/docs/afternoon_session/command_line_arguments.md b/docs/afternoon_session/command_line_arguments.md index d050310..22fdf99 100644 --- a/docs/afternoon_session/command_line_arguments.md +++ b/docs/afternoon_session/command_line_arguments.md @@ -34,6 +34,84 @@ In this session, we practice this, going through the problems and errors that occur when you want to 'just want to run the stupid code'. +```mermaid +flowchart TD + python[[Python]] + + %% Give a white background to all nodes, instead of a transparent one + classDef node fill:#fff,color:#000,stroke:#000 + + subgraph sub_programming_language[Programming language] + interpreted_language[Interpreted language] + programming_language[Programming language] + scripting_language[Scripting language] + interpreter[Interpreter] + scripts[Scripts] + text_files[Text files] + end + style sub_programming_language fill:#ccf,color:#000,stroke:#fcc + + subgraph sub_programming_terms[Programming terms] + user_input[User input] + file_io[File I/O] + command_line_arguments[Command-line arguments] + variables[Variables] + operators[Operators] + %% functions[Functions] + python_packages[Python packages] + graphics[Graphics] + end + style sub_programming_terms fill:#cfc,color:#000,stroke:#fcc + + subgraph sub_uppmax[UPPMAX] + uppmax[UPPMAX] + uppmax_modules[UPPMAX modules] + uppmax_clusters[UPPMAX clusters] + text_editors[Text editors] + x_forwarding[X-forwarding] + remote_desktop[Remote desktop] + end + style sub_uppmax fill:#fcc,color:#000,stroke:#fcc + + python --> |is a| programming_language + python --> |is a| interpreted_language + python --> |is a| scripting_language + + programming_language --> |uses| text_files + interpreted_language --> |has a| interpreter + scripting_language --> |is|interpreted_language + scripting_language --> |runs| scripts + scripts --> |are| text_files + scripts --> |can use| command_line_arguments + + python --> |has| python_packages + python --> |has| variables + %%python --> |has| functions + python --> |has| operators + %%functions --> |use| variables + operators --> |work on| variables + python_packages --> |allow| graphics + python_packages --> |allow to use| user_input + python_packages --> |allow to do| file_io + python_packages --> |allow to use| command_line_arguments + + uppmax --> |has| uppmax_clusters + uppmax_clusters --> |have| uppmax_modules + uppmax_clusters --> |have| text_editors + uppmax_clusters --> |allow| x_forwarding + uppmax_clusters --> |has| remote_desktop + uppmax_modules --> |allow the use of| python_packages + uppmax_modules --> |allow the use of| interpreter + + text_editors --> |work on|text_files + x_forwarding --> |allows|graphics + remote_desktop --> |allows|graphics + + + variables ~~~ uppmax +``` + + ## Exercises ### Exercise 1: Read the command-line arguments diff --git a/docs/afternoon_session/files.md b/docs/afternoon_session/files.md index 2df1999..ea4be95 100644 --- a/docs/afternoon_session/files.md +++ b/docs/afternoon_session/files.md @@ -25,6 +25,83 @@ Most programmers need to work on data and produce some result. In Python, we -of course- can read from files and write to files. Here we do just that. +```mermaid +flowchart TD + python[[Python]] + + %% Give a white background to all nodes, instead of a transparent one + classDef node fill:#fff,color:#000,stroke:#000 + + subgraph sub_programming_language[Programming language] + interpreted_language[Interpreted language] + programming_language[Programming language] + scripting_language[Scripting language] + interpreter[Interpreter] + scripts[Scripts] + text_files[Text files] + end + style sub_programming_language fill:#ccf,color:#000,stroke:#fcc + + subgraph sub_programming_terms[Programming terms] + user_input[User input] + file_io[File I/O] + %% command_line_arguments[Command-line arguments] + variables[Variables] + operators[Operators] + %% functions[Functions] + python_packages[Python packages] + graphics[Graphics] + end + style sub_programming_terms fill:#cfc,color:#000,stroke:#fcc + + subgraph sub_uppmax[UPPMAX] + uppmax[UPPMAX] + uppmax_modules[UPPMAX modules] + uppmax_clusters[UPPMAX clusters] + text_editors[Text editors] + x_forwarding[X-forwarding] + remote_desktop[Remote desktop] + end + style sub_uppmax fill:#fcc,color:#000,stroke:#fcc + + python --> |is a| programming_language + python --> |is a| interpreted_language + python --> |is a| scripting_language + + programming_language --> |uses| text_files + interpreted_language --> |has a| interpreter + scripting_language --> |is|interpreted_language + scripting_language --> |runs| scripts + scripts --> |are| text_files + %% scripts --> |can use| command_line_arguments + + python --> |has| python_packages + python --> |has| variables + %%python --> |has| functions + python --> |has| operators + %%functions --> |use| variables + operators --> |work on| variables + python_packages --> |allow| graphics + python_packages --> |allow to use| user_input + python_packages --> |allow to do| file_io + %% python_packages --> |allow to use| command_line_arguments + + uppmax --> |has| uppmax_clusters + uppmax_clusters --> |have| uppmax_modules + uppmax_clusters --> |have| text_editors + uppmax_clusters --> |allow| x_forwarding + uppmax_clusters --> |has| remote_desktop + uppmax_modules --> |allow the use of| python_packages + uppmax_modules --> |allow the use of| interpreter + + text_editors --> |work on|text_files + x_forwarding --> |allows|graphics + remote_desktop --> |allows|graphics + + + variables ~~~ uppmax +``` + ## Exercises ### Exercise 1: create a simple text file diff --git a/docs/afternoon_session/functions.md b/docs/afternoon_session/functions.md index e3c66cf..524e829 100644 --- a/docs/afternoon_session/functions.md +++ b/docs/afternoon_session/functions.md @@ -24,6 +24,86 @@ ## Overview +Sometime you need to do a same multi-line calculation multiple times in your code. +Instead of copy-pasting, one can use a so-called 'function' +to bundle a calculation is something that can be reused. + +``` +flowchart TD + python[[Python]] + + %% Give a white background to all nodes, instead of a transparent one + classDef node fill:#fff,color:#000,stroke:#000 + + subgraph sub_programming_language[Programming language] + interpreted_language[Interpreted language] + programming_language[Programming language] + scripting_language[Scripting language] + interpreter[Interpreter] + scripts[Scripts] + text_files[Text files] + end + style sub_programming_language fill:#ccf,color:#000,stroke:#fcc + + subgraph sub_programming_terms[Programming terms] + user_input[User input] + file_io[File I/O] + command_line_arguments[Command-line arguments] + variables[Variables] + operators[Operators] + functions[Functions] + python_packages[Python packages] + graphics[Graphics] + end + style sub_programming_terms fill:#cfc,color:#000,stroke:#fcc + + subgraph sub_uppmax[UPPMAX] + uppmax[UPPMAX] + uppmax_modules[UPPMAX modules] + uppmax_clusters[UPPMAX clusters] + text_editors[Text editors] + x_forwarding[X-forwarding] + remote_desktop[Remote desktop] + end + style sub_uppmax fill:#fcc,color:#000,stroke:#fcc + + python --> |is a| programming_language + python --> |is a| interpreted_language + python --> |is a| scripting_language + + programming_language --> |uses| text_files + interpreted_language --> |has a| interpreter + scripting_language --> |is|interpreted_language + scripting_language --> |runs| scripts + scripts --> |are| text_files + scripts --> |can use| command_line_arguments + + python --> |has| python_packages + python --> |has| variables + python --> |has| functions + python --> |has| operators + functions --> |use| variables + operators --> |work on| variables + python_packages --> |allow| graphics + python_packages --> |allow to use| user_input + python_packages --> |allow to do| file_io + python_packages --> |allow to use| command_line_arguments + + uppmax --> |has| uppmax_clusters + uppmax_clusters --> |have| uppmax_modules + uppmax_clusters --> |have| text_editors + uppmax_clusters --> |allow| x_forwarding + uppmax_clusters --> |has| remote_desktop + uppmax_modules --> |allow the use of| python_packages + uppmax_modules --> |allow the use of| interpreter + + text_editors --> |work on|text_files + x_forwarding --> |allows|graphics + remote_desktop --> |allows|graphics + + + variables ~~~ uppmax +``` ## Exercises diff --git a/docs/afternoon_session/graphics.md b/docs/afternoon_session/graphics.md index eb22f54..4aa5155 100644 --- a/docs/afternoon_session/graphics.md +++ b/docs/afternoon_session/graphics.md @@ -27,6 +27,83 @@ Sometimes one wants to make a plot, such like a scatterplot or barchart. Matplotlib is a popular Python package to make plots. Here we experience how easy/hard it is to use Matplotlib on Rackham. +```mermaid +flowchart TD + python[[Python]] + + %% Give a white background to all nodes, instead of a transparent one + classDef node fill:#fff,color:#000,stroke:#000 + + subgraph sub_programming_language[Programming language] + interpreted_language[Interpreted language] + programming_language[Programming language] + scripting_language[Scripting language] + interpreter[Interpreter] + scripts[Scripts] + text_files[Text files] + end + style sub_programming_language fill:#ccf,color:#000,stroke:#fcc + + subgraph sub_programming_terms[Programming terms] + user_input[User input] + file_io[File I/O] + command_line_arguments[Command-line arguments] + variables[Variables] + operators[Operators] + %% functions[Functions] + python_packages[Python packages] + graphics[Graphics] + end + style sub_programming_terms fill:#cfc,color:#000,stroke:#fcc + + subgraph sub_uppmax[UPPMAX] + uppmax[UPPMAX] + uppmax_modules[UPPMAX modules] + uppmax_clusters[UPPMAX clusters] + text_editors[Text editors] + x_forwarding[X-forwarding] + remote_desktop[Remote desktop] + end + style sub_uppmax fill:#fcc,color:#000,stroke:#fcc + + python --> |is a| programming_language + python --> |is a| interpreted_language + python --> |is a| scripting_language + + programming_language --> |uses| text_files + interpreted_language --> |has a| interpreter + scripting_language --> |is|interpreted_language + scripting_language --> |runs| scripts + scripts --> |are| text_files + scripts --> |can use| command_line_arguments + + python --> |has| python_packages + python --> |has| variables + %%python --> |has| functions + python --> |has| operators + %%functions --> |use| variables + operators --> |work on| variables + python_packages --> |allow| graphics + python_packages --> |allow to use| user_input + python_packages --> |allow to do| file_io + python_packages --> |allow to use| command_line_arguments + + uppmax --> |has| uppmax_clusters + uppmax_clusters --> |have| uppmax_modules + uppmax_clusters --> |have| text_editors + uppmax_clusters --> |allow| x_forwarding + uppmax_clusters --> |has| remote_desktop + uppmax_modules --> |allow the use of| python_packages + uppmax_modules --> |allow the use of| interpreter + + text_editors --> |work on|text_files + x_forwarding --> |allows|graphics + remote_desktop --> |allows|graphics + + + variables ~~~ uppmax +``` + ## Exercises ### Exercise 1: Use matplotlib to show a plot diff --git a/docs/afternoon_session/hello_little_turtles.md b/docs/afternoon_session/hello_little_turtles.md index 50a74d2..429d5db 100644 --- a/docs/afternoon_session/hello_little_turtles.md +++ b/docs/afternoon_session/hello_little_turtles.md @@ -32,6 +32,83 @@ In this session, we practice this, going through the problems and errors that occur when you want to 'just want to run the stupid code'. +```mermaid +flowchart TD + python[[Python]] + + %% Give a white background to all nodes, instead of a transparent one + classDef node fill:#fff,color:#000,stroke:#000 + + subgraph sub_programming_language[Programming language] + interpreted_language[Interpreted language] + programming_language[Programming language] + scripting_language[Scripting language] + interpreter[Interpreter] + scripts[Scripts] + text_files[Text files] + end + style sub_programming_language fill:#ccf,color:#000,stroke:#fcc + + subgraph sub_programming_terms[Programming terms] + user_input[User input] + %% file_io[File I/O] + %% command_line_arguments[Command-line arguments] + variables[Variables] + operators[Operators] + %% functions[Functions] + python_packages[Python packages] + graphics[Graphics] + end + style sub_programming_terms fill:#cfc,color:#000,stroke:#fcc + + subgraph sub_uppmax[UPPMAX] + uppmax[UPPMAX] + uppmax_modules[UPPMAX modules] + uppmax_clusters[UPPMAX clusters] + text_editors[Text editors] + x_forwarding[X-forwarding] + remote_desktop[Remote desktop] + end + style sub_uppmax fill:#fcc,color:#000,stroke:#fcc + + python --> |is a| programming_language + python --> |is a| interpreted_language + python --> |is a| scripting_language + + programming_language --> |uses| text_files + interpreted_language --> |has a| interpreter + scripting_language --> |is|interpreted_language + scripting_language --> |runs| scripts + scripts --> |are| text_files + %% scripts --> |can use| command_line_arguments + + python --> |has| python_packages + python --> |has| variables + %%python --> |has| functions + python --> |has| operators + %%functions --> |use| variables + operators --> |work on| variables + python_packages --> |allow| graphics + python_packages --> |allow to use| user_input + %% python_packages --> |allow to do| file_io + %% python_packages --> |allow to use| command_line_arguments + + uppmax --> |has| uppmax_clusters + uppmax_clusters --> |have| uppmax_modules + uppmax_clusters --> |have| text_editors + uppmax_clusters --> |allow| x_forwarding + uppmax_clusters --> |has| remote_desktop + uppmax_modules --> |allow the use of| python_packages + uppmax_modules --> |allow the use of| interpreter + + text_editors --> |work on|text_files + x_forwarding --> |allows|graphics + remote_desktop --> |allows|graphics + + + variables ~~~ uppmax +``` + ## Exercises ### Exercise 1: Fail at running a first program diff --git a/docs/afternoon_session/overview.md b/docs/afternoon_session/overview.md index 19c995a..b50c4ab 100644 --- a/docs/afternoon_session/overview.md +++ b/docs/afternoon_session/overview.md @@ -36,7 +36,8 @@ This module introduces the fundamentals of Python programming language. - Extra materials: - Conditionals (['How to Think Like a Computer Scientist'](https://openbookproject.net/thinkcs/python/english3e/index.html) chapter 5) - Fruitful functions (['How to Think Like a Computer Scientist'](https://openbookproject.net/thinkcs/python/english3e/index.html) chapter 6) - - Other Python programming environments: IPython, Jupyter, VSCode + - Other Python programming environments: see the UPPMAX 'Programming in Python' documentation + [here](http://docs.uppmax.uu.se/software/python_programming/) Link to HackMd: @@ -44,16 +45,21 @@ Link to HackMd: ```mermaid flowchart TD - python((Python)) - + python[[Python]] + + %% Give a white background to all nodes, instead of a transparent one + classDef node fill:#fff,color:#000,stroke:#000 + subgraph sub_programming_language[Programming language] interpreted_language[Interpreted language] - programming_language[Programmig language] + programming_language[Programming language] scripting_language[Scripting language] interpreter[Interpreter] scripts[Scripts] text_files[Text files] end + style sub_programming_language fill:#ccf,color:#000,stroke:#fcc + subgraph sub_programming_terms[Programming terms] user_input[User input] file_io[File I/O] @@ -64,14 +70,17 @@ flowchart TD python_packages[Python packages] graphics[Graphics] end + style sub_programming_terms fill:#cfc,color:#000,stroke:#fcc subgraph sub_uppmax[UPPMAX] uppmax[UPPMAX] uppmax_modules[UPPMAX modules] uppmax_clusters[UPPMAX clusters] text_editors[Text editors] - use_of_graphics[Allows use of graphics] + x_forwarding[X-forwarding] + remote_desktop[Remote desktop] end + style sub_uppmax fill:#fcc,color:#000,stroke:#fcc python --> |is a| programming_language python --> |is a| interpreted_language @@ -98,18 +107,18 @@ flowchart TD uppmax --> |has| uppmax_clusters uppmax_clusters --> |have| uppmax_modules uppmax_clusters --> |have| text_editors - uppmax_clusters --> |allow| use_of_graphics + uppmax_clusters --> |allow| x_forwarding + uppmax_clusters --> |has| remote_desktop uppmax_modules --> |allow the use of| python_packages uppmax_modules --> |allow the use of| interpreter text_editors --> |work on|text_files - use_of_graphics --> |allows|graphics - + x_forwarding --> |allows|graphics + remote_desktop --> |allows|graphics + variables ~~~ uppmax ``` ## Links - * [YouTube video on `python` versus `IPython`](https://youtu.be/lhi7s6RoIys?si=Z72gSIb6q3piucPH) - * [YouTube video on `IPython`](https://www.youtube.com/watch?v=S9rgGJYAQ8o) * [Free online book: 'How to Think Like a Computer Scientist'](https://openbookproject.net/thinkcs/python/english3e/index.html) diff --git a/docs/morning_session/overview.md b/docs/morning_session/overview.md index 5b69c6b..cf51006 100644 --- a/docs/morning_session/overview.md +++ b/docs/morning_session/overview.md @@ -32,34 +32,42 @@ Link to HackMd: ```mermaid flowchart TD - python((Python)) - + python[[Python]] + + %% Give a white background to all nodes, instead of a transparent one + classDef node fill:#fff,color:#000,stroke:#000 + subgraph sub_programming_language[Programming language] interpreted_language[Interpreted language] - programming_language[Programmig language] + programming_language[Programming language] scripting_language[Scripting language] interpreter[Interpreter] scripts[Scripts] text_files[Text files] end + style sub_programming_language fill:#ccf,color:#000,stroke:#fcc + subgraph sub_programming_terms[Programming terms] user_input[User input] - file_io[File I/O] - command_line_arguments[Command-line arguments] + %% file_io[File I/O] + %% command_line_arguments[Command-line arguments] variables[Variables] operators[Operators] - functions[Functions] + %% functions[Functions] python_packages[Python packages] - graphics[Graphics] + %% graphics[Graphics] end + style sub_programming_terms fill:#cfc,color:#000,stroke:#fcc subgraph sub_uppmax[UPPMAX] uppmax[UPPMAX] uppmax_modules[UPPMAX modules] uppmax_clusters[UPPMAX clusters] text_editors[Text editors] - use_of_graphics[Allows use of graphics] + x_forwarding[X-forwarding] + remote_desktop[Remote desktop] end + style sub_uppmax fill:#fcc,color:#000,stroke:#fcc python --> |is a| programming_language python --> |is a| interpreted_language @@ -70,28 +78,31 @@ flowchart TD scripting_language --> |is|interpreted_language scripting_language --> |runs| scripts scripts --> |are| text_files - scripts --> |can use| command_line_arguments + %% scripts --> |can use| command_line_arguments python --> |has| python_packages python --> |has| variables - python --> |has| functions + %%python --> |has| functions python --> |has| operators - functions --> |use| variables + %%functions --> |use| variables operators --> |work on| variables - python_packages --> |allow| graphics + %%python_packages --> |allow| graphics python_packages --> |allow to use| user_input - python_packages --> |allow to do| file_io - python_packages --> |allow to use| command_line_arguments + %% python_packages --> |allow to do| file_io + %% python_packages --> |allow to use| command_line_arguments uppmax --> |has| uppmax_clusters uppmax_clusters --> |have| uppmax_modules uppmax_clusters --> |have| text_editors - uppmax_clusters --> |allow| use_of_graphics + uppmax_clusters --> |allow| x_forwarding + uppmax_clusters --> |has| remote_desktop uppmax_modules --> |allow the use of| python_packages uppmax_modules --> |allow the use of| interpreter text_editors --> |work on|text_files - use_of_graphics --> |allows|graphics + %%x_forwarding --> |allows|graphics + %%remote_desktop --> |allows|graphics + variables ~~~ uppmax ``` diff --git a/docs/morning_session/the_way_of_the_program.md b/docs/morning_session/the_way_of_the_program.md index f0d4227..90cfdf8 100644 --- a/docs/morning_session/the_way_of_the_program.md +++ b/docs/morning_session/the_way_of_the_program.md @@ -36,6 +36,61 @@ How do I write code in Python? These fundamental question are discussed and practiced in this session. +```mermaid +flowchart TD + python[[Python]] + + %% Give a white background to all nodes, instead of a transparent one + classDef node fill:#fff,color:#000,stroke:#000 + + subgraph sub_programming_language[Python as a language] + interpreted_language[Interpreted language] + programming_language[Programming language] + scripting_language[Scripting language] + interpreter[Interpreter] + %% scripts[Scripts] + %% text_files[Text files] + end + style sub_programming_language fill:#ccf,color:#000,stroke:#fcc + + + subgraph sub_uppmax[UPPMAX] + uppmax[UPPMAX] + uppmax_modules[UPPMAX modules] + uppmax_clusters[UPPMAX clusters] + %% text_editors[Text editors] + %%x_forwarding[X-forwarding] + %%remote_desktop[Remote desktop] + end + style sub_uppmax fill:#fcc,color:#000,stroke:#fcc + + python --> |is a| programming_language + python --> |is a| interpreted_language + python --> |is a| scripting_language + + %% programming_language --> |uses| text_files + interpreted_language --> |has a| interpreter + scripting_language --> |is a|interpreted_language + %% scripting_language --> |runs| scripts + %% scripts --> |are| text_files + %% scripts --> |can use| command_line_arguments + + uppmax --> |has| uppmax_clusters + uppmax_clusters --> |have| uppmax_modules + %%uppmax_clusters --> |have| text_editors + %%uppmax_clusters --> |allow| x_forwarding + %%uppmax_clusters --> |has| remote_desktop + %% uppmax_modules --> |allow the use of| python_packages + uppmax_modules --> |allow the use of| interpreter + + %% text_editors --> |work on|text_files + %%x_forwarding --> |allows|graphics + %%remote_desktop --> |allows|graphics + + + %% variables ~~~ uppmax +``` + ## Exercises ### Exercise 1: Python and the Python interpreter diff --git a/docs/morning_session/using_the_python_interpreter.md b/docs/morning_session/using_the_python_interpreter.md index 79510bc..eccdd8a 100644 --- a/docs/morning_session/using_the_python_interpreter.md +++ b/docs/morning_session/using_the_python_interpreter.md @@ -33,6 +33,61 @@ Luckily, UPPMAX has documentation that should allow you to do so autonomously. These exercises will ensure you are able to run a minimal Python program. +```mermaid +flowchart TD + python[[Python]] + + %% Give a white background to all nodes, instead of a transparent one + classDef node fill:#fff,color:#000,stroke:#000 + + subgraph sub_programming_language[Python as a language] + interpreted_language[Interpreted language] + programming_language[Programming language] + scripting_language[Scripting language] + interpreter[Interpreter] + %% scripts[Scripts] + %% text_files[Text files] + end + style sub_programming_language fill:#ccf,color:#000,stroke:#fcc + + + subgraph sub_uppmax[UPPMAX] + uppmax[UPPMAX] + uppmax_modules[UPPMAX modules] + uppmax_clusters[UPPMAX clusters] + %% text_editors[Text editors] + %%x_forwarding[X-forwarding] + %%remote_desktop[Remote desktop] + end + style sub_uppmax fill:#fcc,color:#000,stroke:#fcc + + python --> |is a| programming_language + python --> |is a| interpreted_language + python --> |is a| scripting_language + + %% programming_language --> |uses| text_files + interpreted_language --> |has a| interpreter + scripting_language --> |is a|interpreted_language + %% scripting_language --> |runs| scripts + %% scripts --> |are| text_files + %% scripts --> |can use| command_line_arguments + + uppmax --> |has| uppmax_clusters + uppmax_clusters --> |have| uppmax_modules + %%uppmax_clusters --> |have| text_editors + %%uppmax_clusters --> |allow| x_forwarding + %%uppmax_clusters --> |has| remote_desktop + %% uppmax_modules --> |allow the use of| python_packages + uppmax_modules --> |allow the use of| interpreter + + %% text_editors --> |work on|text_files + %%x_forwarding --> |allows|graphics + %%remote_desktop --> |allows|graphics + + + %% variables ~~~ uppmax +``` + ## Exercises ### Exercise 1: login to Rackham diff --git a/docs/morning_session/variables_expressions_and_statements.md b/docs/morning_session/variables_expressions_and_statements.md index 16c6b90..e6ed33e 100644 --- a/docs/morning_session/variables_expressions_and_statements.md +++ b/docs/morning_session/variables_expressions_and_statements.md @@ -58,6 +58,84 @@ store ('remember') information. Here we use our first simple variables. Also we practice converting an equation and a mathematical problem to Python code. We will discover the helpful modulo operator. +```mermaid +flowchart TD + python[[Python]] + + %% Give a white background to all nodes, instead of a transparent one + classDef node fill:#fff,color:#000,stroke:#000 + + subgraph sub_programming_language[Programming language] + interpreted_language[Interpreted language] + programming_language[Programming language] + scripting_language[Scripting language] + interpreter[Interpreter] + scripts[Scripts] + text_files[Text files] + end + style sub_programming_language fill:#ccf,color:#000,stroke:#fcc + + subgraph sub_programming_terms[Programming terms] + user_input[User input] + %% file_io[File I/O] + %% command_line_arguments[Command-line arguments] + variables[Variables] + operators[Operators] + %% functions[Functions] + python_packages[Python packages] + %% graphics[Graphics] + end + style sub_programming_terms fill:#cfc,color:#000,stroke:#fcc + + subgraph sub_uppmax[UPPMAX] + uppmax[UPPMAX] + uppmax_modules[UPPMAX modules] + uppmax_clusters[UPPMAX clusters] + text_editors[Text editors] + x_forwarding[X-forwarding] + remote_desktop[Remote desktop] + end + style sub_uppmax fill:#fcc,color:#000,stroke:#fcc + + python --> |is a| programming_language + python --> |is a| interpreted_language + python --> |is a| scripting_language + + programming_language --> |uses| text_files + interpreted_language --> |has a| interpreter + scripting_language --> |is|interpreted_language + scripting_language --> |runs| scripts + scripts --> |are| text_files + %% scripts --> |can use| command_line_arguments + + python --> |has| python_packages + python --> |has| variables + %%python --> |has| functions + python --> |has| operators + %%functions --> |use| variables + operators --> |work on| variables + %%python_packages --> |allow| graphics + python_packages --> |allow to use| user_input + %% python_packages --> |allow to do| file_io + %% python_packages --> |allow to use| command_line_arguments + + uppmax --> |has| uppmax_clusters + uppmax_clusters --> |have| uppmax_modules + uppmax_clusters --> |have| text_editors + uppmax_clusters --> |allow| x_forwarding + uppmax_clusters --> |has| remote_desktop + uppmax_modules --> |allow the use of| python_packages + uppmax_modules --> |allow the use of| interpreter + + text_editors --> |work on|text_files + %%x_forwarding --> |allows|graphics + %%remote_desktop --> |allows|graphics + + + variables ~~~ uppmax +``` + + ## Exercises ### Exercise 1: working with variables diff --git a/docs/morning_session/working_with_python_scripts.md b/docs/morning_session/working_with_python_scripts.md index 72e5e38..1cab71c 100644 --- a/docs/morning_session/working_with_python_scripts.md +++ b/docs/morning_session/working_with_python_scripts.md @@ -27,6 +27,61 @@ that run (interpreted) code are called 'scripts'. In this session, we create and run some simple Python scripts. +```mermaid +flowchart TD + python[[Python]] + + %% Give a white background to all nodes, instead of a transparent one + classDef node fill:#fff,color:#000,stroke:#000 + + subgraph sub_programming_language[Python as a language] + interpreted_language[Interpreted language] + programming_language[Programming language] + scripting_language[Scripting language] + interpreter[Interpreter] + scripts[Scripts] + text_files[Text files] + end + style sub_programming_language fill:#ccf,color:#000,stroke:#fcc + + + subgraph sub_uppmax[UPPMAX] + uppmax[UPPMAX] + uppmax_modules[UPPMAX modules] + uppmax_clusters[UPPMAX clusters] + text_editors[Text editors] + %%x_forwarding[X-forwarding] + %%remote_desktop[Remote desktop] + end + style sub_uppmax fill:#fcc,color:#000,stroke:#fcc + + python --> |is a| programming_language + python --> |is a| interpreted_language + python --> |is a| scripting_language + + programming_language --> |uses| text_files + interpreted_language --> |has a| interpreter + scripting_language --> |is a|interpreted_language + scripting_language --> |runs| scripts + scripts --> |are| text_files + %% scripts --> |can use| command_line_arguments + + uppmax --> |has| uppmax_clusters + uppmax_clusters --> |have| uppmax_modules + uppmax_clusters --> |have| text_editors + %%uppmax_clusters --> |allow| x_forwarding + %%uppmax_clusters --> |has| remote_desktop + %% uppmax_modules --> |allow the use of| python_packages + uppmax_modules --> |allow the use of| interpreter + + text_editors --> |work on|text_files + %%x_forwarding --> |allows|graphics + %%remote_desktop --> |allows|graphics + + + %% variables ~~~ uppmax +``` + ## Exercises ### Exercise 1: create a Python script