Skip to content
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.

devsetgo/python_101

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python 101

Install

  • Python - download
  • VS Code - download
    • install python plugin
    • go to settings and set autosave
    • set the CMD prompt for windows users (unless you want to use powershell)
      • see setup_environment folder for JSON settngs

Learning Resources

TODO LIST

  • Write Test Example
  • Write Flask Example
  • Write Flask RESTPlus expample

Pre-requisites

Installation of Python 3.6 or higher with 3.7 recommended

  • Windows Install
  • Mac OSX Install)
    • Mac OSX comes with legacy Python 2.7, but you will need to install Python 3.6 or higher. I don't use a Mac
  • Linux - most distributions come with Python 3 pre-installed. Ubuntu 18.04 has Python 3.6 installed. Linux distributions can be tied to specific versions and not easily upgradeable.

Basic Python

Week 1

  • Hello World
    • Run a python script
      • Windows "python your-file-name.py"
      • OSX or Linux "python3 your-file-name.py"
  • Basic Math
  • Variables
  • Strings
    • Print(“Hello all {} of you.”.format(5)
    • Print(f(“Hello all {aVar} of you.”)
      • Python 3.6 or higher

Week 2

  • Functions
    • For Loop
      • Count
    • Append a dictionary
    • Pass variable to Function
    • Simple IF, ELIF, Else statement

Week 3

  • Import statement
  • Read a CSV
  • Write to a CSV

Week 4

  • What is an API?

    • GET (Read)
      • POST (create), PUT (update), DELETE (delete)
      • More detailed information here
  • JSON Data - JavaScript Object Notation

  • Windows:

    • pip install virtualenv
      • virtualenv env
      • env\scripts\activate
  • OSX:

    • pip3 install virtualenv
      • virtualenv env
      • source env/bin/activate
  • Install Requirements

    • pip/pip3 install -r requirements.txt
  • Using Python Requests to fetch data from an api

  • Print result JSON value

  • For loop over JSON