Skip to content

ariannedee/python-foundations-3-weeks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hands-on Python Foundations in 3 Weeks

This is the code for the O'Reilly Live Training - Hands-on Python Foundations in 3 Weeks presented by Arianne Dee

Before the class, please follow these instructions:

  1. Install Python
  2. Install PyCharm
  3. Install Git
  4. Clone the code
  5. Make sure that you can run Python in PyCharm

There is an Outline and resources section at the end with lab and video links.

Set up instructions

1. Install Python

More detailed instructions can be found here: Installing Python

For this course, you'll need Python 3.6 or higher version (like 3.13).

Go to https://www.python.org/downloads/

Mac/Windows: Follow the prompts and install using the default settings.

Other OS: Use your package manager or search online for how to install Python.

Once installed, you to run Python in the command line:

  • Mac/Linux: use $ python3 to launch the Python Console
  • Windows: use C:\> py to launch the Python Console

2. Download PyCharm

Additional instructions here: Get a code editor

Download PyCharm. https://www.jetbrains.com/pycharm/download/

Install, open, and use the default settings.

3. Install Git

Follow your operating system instructions if you don't already have Git installed: Git install instructions

4. Clone the course repository

Get the code for this course using Git.

Option 1

If you aren't familiar with Git, you can use PyCharm to clone a Git repository.

In PyCharm, when choosing which project to open, choose "Get from VCS" (clone from Git, which is a version control system)

See full instructions

Option 2

If you know Git, clone the repository and then open the python-foundations-3-weeks folder in PyCharm.

5. Make sure that you can run Python in PyCharm

With the python-foundations-3-weeks folder open in Pycharm:

  1. In the left panel, navigate to examples/week_1/example_1_first_code.py and double click to open it in the editor

  2. On the open file, right click and select Run 'example_1_first_code'

  3. In the Run tab on the bottom, you should see Process finished with exit code 0

  4. Otherwise, if you got an error (exit code 1 in red), follow the instructions for setting your Python version in your IDE here

If you received an error running example_1_first_code, set your Python version in PyCharm

See step-by-step instructions here:

Outline and resources

Rough week-by-week outline with links to relevant interactive scenarios and pre-recorded video lessons.

Interactive scenario list - Hands-On Python Foundations Scenarios

Video lesson 1 - Introduction to Python 2nd Ed

Video lesson 2 - Next Level Python

Week 1

Getting started with Python

0. Installing PyCharm and getting ready to code

Install Python - Video 1 lesson 1.1

Choose a code editor - Video 1 lesson 1.2

1. Running Python

Run Python in interactive and script mode

Interactive scenario 1 (steps 1 & 2) / Video 1 lesson 1.2 (6:16 to end)

2. Math

Using operators and importing the math module

Interactive scenario 1 (steps 3 - 5) / Video 1 lesson 1.3

3. Variables

Working with variables, naming rules and keywords

Interactive scenario 2 (step 1) / Video 1 lesson 2.2

4. Types

Basic data types, errors and type casting

Interactive scenario 2 (steps 2 - 4) / Video 1 lesson 2.1 and Video 1 lesson 2.3

5. Text formatting

String concatination, formatting and interpolation

Interactive scenario 2 (steps 5 & 6) / Video 1 lesson 2.4

6. Functions

Defining your own functions

Interactive scenario 3 (step 1) / Video 1 lesson 2.7

7. Boolean expressions

True and false expressions, comparisons and methods

Interactive scenario 3 (step 2) / Video 1 lesson 3.2

8. Conditionals

If-elif-else statements

Interactive scenario 3 (step 3) / Video 1 lesson 3.3

9. Loops

While and for loops

Interactive scenario 3 (step 4) / Video 1 lesson 4.1 (while loops) and Video 1 lesson 4.4 (for loops)

Week 2

Writing simple scripts

1. Lists

Interactive scenario 4 (step 1) / Video 1 lesson 4.3

2. Dictionaries

Interactive scenario 4 (step 2) / Video 2 lesson 1.3

3. Tuples and sets

Interactive scenario 4 (steps 3 & 4) / Video 1 lesson 5.2

4. Exceptions

Catching and throwing errors/exceptions

Interactive scenario 5 (steps 1 & 2) / Video 2 lesson 1.4

5. Files

Reading and writing to text files and CSV files

Interactive scenario 5 (steps 3 - 5) / Video 2 lesson 2 (lessons 2.1 - 2.3)

6. HTTP requests

Making GET and POST requests using the requests library

Interactive scenario 5 (steps 1 & 4) / Video 2 lesson 7.1

7. APIs

Getting data from APIs

Interactive scenario 5 (steps 2, 3 & 5) / Video 2 lesson 7.5

8. Command line overview

No interactive scenario / Video 2 lesson 3.1

9. Script arguments

No interactive scenario or video lesson

Code examples in examples/week_2/example_23_args.py and examples/week_2/example_24_click.py

Week 3

Working with real-world applications

1. Pip

Installing external packages with pip

Interactive scenario 7 (steps 2 - 4) / Video 2 lesson 3.2

2. Virtual environments

Managing project environments with venv

Interactive scenario 7 (step 5) / Video 2 lesson 3.3

Connecting PyCharm to your virtual environment: instructions

3. Setting up projects

Working with venv, git and GitHub

No interactive scenario / Video 2 lesson 3.4 and 3.5

4. Classes

Using and creating classes

Interactive scenario 8 / No video lesson

5. Dunder methods

Understanding dunder methods

Interactive scenario 8 step 2 / No video lesson

6. Modules and packages

Imports, init.py, namespaces, scope and name.

Interactive scenario 9 / Video 2 lesson 5

7. Code hosting

Options for storing your code on the internet.

No interactive scenario / Video 2 lesson 9

FAQs

Can I use Python 2?

No, Python 2 is out of date. Please download a version that is at least Python 3.6.

Can I use a different code editor besides PyCharm?

Yes, but it is only recommended if you are already know it and are comfortable navigating to different files and running commands in the command line. If it has syntax highlighting for Python, that is ideal.

If you are using VS Code, make sure the Python plugin is installed.

PyCharm can't find Python 3

Follow the instructions for Python interpreter setup

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages