Recap Python Basics =================== This lesson contains a curated collection of Jupyter Notebooks of introductory materials about programming in Python. Python Refresher as Jupyter Notebooks ------------------------------------- In the previous sections you should have installed all required packages for your conda environment, including the Jupyter notebook server. Create a folder named ``L0`` in your geopython2020 working directory. Download the linked **.ipynb** files (Jupyter Notebook files) - right click on the links below (Chapter 1, Chapter 2 etc) and save them into your ``geopython2020/L0`` folder. Go back into the console/commandline prompt (Anaconda prompt), make sure you are in the directory where you extracted the materials. Then you should start the Jupyter notebook server in this ``geopython2020`` base directory. 1) Open Anaconda Prompt 2) activate "geopy2020" environment 3) navigate into the ``geopython2020`` folder 4) start Jupyter notebook server (aka jupyter lab) All you need to do to play notebooks is to type the following command in your project folder: .. code:: cd C:\Users\Alexander\geopython2020 (geopy2020) jupyter lab A browser window will open, with the files listed from your ``geopython2020`` folder and you will see the ``L0`` directory. In order to start a Notebook, click on the folder to step into the ``L0`` folder and click on the respective **.ipynb** file. This will open a new tab in the browser and now you have a running Jupyter notebook session. Cells are tyically either Code (Python) that you can run/execute, or descriptive text in Markdown format. - `Chapter 1: Variables, Strings and Numbers.ipynb <../_static/data/L0/01%20Variable%20Strings%20and%20Numbers.ipynb>`_ In this section, you will learn to store information in variables. .. image:: https://mybinder.org/badge_logo.svg :target: https://mybinder.org/v2/gh/allixender/testgeo2020b/master?filepath=L0/01%20Variable%20Strings%20and%20Numbers.ipynb - `Chapter 2: Lists, Tuples and Sets.ipynb <../_static/data/L0/02%20List%20and%20Tuples%20and%20Sets.ipynb>`_ In this notebook, you will learn to store more than one valuable in a single variable. .. image:: https://mybinder.org/badge_logo.svg :target: https://mybinder.org/v2/gh/allixender/testgeo2020b/master?filepath=L0/02%20List%20and%20Tuples%20and%20Sets.ipynb - `Chapter 3: If Statements <../_static/data/L0/03%20If%20Statements.ipynb>`_ In this section, you will learn how to test for certain conditions, and then respond in appropriate ways to those conditions. .. image:: https://mybinder.org/badge_logo.svg :target: https://mybinder.org/v2/gh/allixender/testgeo2020b/master?filepath=L0/03%20If%20Statements.ipynb - `Chapter 4: Loops and Input.ipynb <../_static/data/L0/04%20While%20Loops%20and%20User%20input.ipynb>`_ While loops are really useful because they let your program run until a user decides to quit the program. They set up an infinite loop that runs until the user does something to end the loop. This section also introduces the first way to get input from your program's users. .. image:: https://mybinder.org/badge_logo.svg :target: https://mybinder.org/v2/gh/allixender/testgeo2020b/master?filepath=L0/04%20While%20Loops%20and%20User%20input.ipynb - `Chapter 5: Dictionaries.ipynb (Data Structures) <../_static/data/L0/05%20Dictionaries.ipynb>`_ Dictionaries allow us to store connected bits of information. For example, you might store a person's name and age together. .. image:: https://mybinder.org/badge_logo.svg :target: https://mybinder.org/v2/gh/allixender/testgeo2020b/master?filepath=L0/05%20Dictionaries.ipynb - `Chapter 6: Introducing Functions.ipynb <../_static/data/L0/06%20Introduction%20to%20Functions.ipynb>`_ Functions mean less work for us as programmers, and effective use of functions results in code that is less error-prone. .. image:: https://mybinder.org/badge_logo.svg :target: https://mybinder.org/v2/gh/allixender/testgeo2020b/master?filepath=L0/06%20Introduction%20to%20Functions.ipynb - `Chapter 7: Classes and OOP.ipynb <../_static/data/L0/07%20Classes%20and%20OOP.ipynb>`_ In this section you will learn about the last major data structure, classes. Classes are quite unlike the other data types, in that they are much more flexible. Classes allow you to define the information and behavior that characterize anything you want to model in your program. .. image:: https://mybinder.org/badge_logo.svg :target: https://mybinder.org/v2/gh/allixender/testgeo2020b/master?filepath=L0/07%20Classes%20and%20OOP.ipynb - `Chapter 8: Exceptions.ipynb <../_static/data/L0/08%20Exceptions.ipynb>`_ Exceptions which are events that can modify the *flow* of control through a program. In Python, exceptions are triggered automatically on errors, and they can be triggered and intercepted by your code. .. image:: https://mybinder.org/badge_logo.svg :target: https://mybinder.org/v2/gh/allixender/testgeo2020b/master?filepath=L0/08%20Exceptions.ipynb - `Appendix: Python Coding Style.ipynb <../_static/data/L0/Python%20Coding%20Style.ipynb>`_ You are now starting to write Python programs that have a little substance. Your programs are growing a little longer, and there is a little more structure to your programs. This is a really good time to consider your overall style in writing code. .. image:: https://mybinder.org/badge_logo.svg :target: https://mybinder.org/v2/gh/allixender/testgeo2020b/master?filepath=L0/Python%20Coding%20Style.ipynb License and Sharing Material ---------------------------- Valerio Maggio ``_ .. raw:: html Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.