🐍 Coming soon: Python 2!

Tips for navigating the slides:
  • Press O or Escape for overview mode.
  • Visit this link for a nice printable version
  • Press the copy icon on the upper right of code blocks to copy the code

Welcome! A bit about Girl Develop It

We create welcoming, supportive and accessible environments for women and non-binary adults to learn software development.

We are dedicated to providing a welcoming and comfortable environment for all to learn coding.
Code of conduct

What does Girl Develop It teach?

  • Web Development
  • Data Science
  • UX Design & Research
  • Workforce Classes
  • Career-Building Events & Conferences

Check out all of our classes & events girldevelopit.com

Your Instructor

  • Liz Krznarich (she/her)
  • Technical Lead, DataCite
  • Many tech hats worn! Fullstack engineer, frontend engineer, technical trainer, graphic designer...
  • Python, Java, JS (Angular/React/Ember), DevOps (Ansible/Terraform/Puppet)
  • Fun fact: Degrees in Art and Library Science. First professional job involved hot dog ads.

Classroom "rules"

  • I am here for you!
  • Every question is important
  • Help each other
  • Have fun

What's in store for Python 2?

This may change if we end up needing more or less time for certain topics.

  • Class 7: Review & reading from/writing to files
  • Class 8: More file operations, argument parsing & list comprehension
  • Class 9: Error handling
  • Class 10: HTTP requests
  • Class 11: Intro to Python frameworks & object-oriented Python
  • Class 12: Your own app with Django!

(note: Python 1 series included classes 1-6)

Working with files

Have lots of files you need to combine, extract data from, clean up, rename or format into a nice report? We can do that!

Screenshot of files converted to report

Errors! Why they happen & what to do about them

We don't want users (or ourselves) to see mysterious errors at runtime


                        Traceback (most recent call last):
                        File "", line 1, in 
                        TypeError: 'type' object is not iterable
                        >>>
                    

We want to provide fallback code or a useful error message


                        try:
                            for item in list:
                                do_really_cool_thing()
                        except:
                            print("Oh noes! Something went wrong with an item:"")
                            print(item)
                    

HTTP requests

"Hypertext transfer protocol" sounds like it's from 1995, but it's still the way data gets around on the Web!

We'll learn how to use the requests module to get data from external sources, like APIs


                        import requests
                        r = requests.get('https://api.github.com/users/lizkrznarich')
                        print(r.status_code)
                        200
                        print(r.json())
                        {'login': 'lizkrznarich', 'id': 8026886, 'node_id': 'MDQ6VXNlcjgwMjY4ODY=', 'avatar_url': 'https://avatars.githubusercontent.com/u/8026886?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/lizkrznarich', 'html_url': 'https://github.com/lizkrznarich', 'followers_url': 'https://api.github.com/users/lizkrznarich/followers', 'following_url': 'https://api.github.com/users/lizkrznarich/following{/other_user}', 'gists_url': 'https://api.github.com/users/lizkrznarich/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/lizkrznarich/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/lizkrznarich/subscriptions', 'organizations_url': 'https://api.github.com/users/lizkrznarich/orgs', 'repos_url': 'https://api.github.com/users/lizkrznarich/repos', 'events_url': 'https://api.github.com/users/lizkrznarich/events{/privacy}', 'received_events_url': 'https://api.github.com/users/lizkrznarich/received_events', 'type': 'User', 'site_admin': False, 'name': 'Liz Krznarich', 'company': 'DataCite', 'blog': '', 'location': None, 'email': None, 'hireable': None, 'bio': None, 'twitter_username': None, 'public_repos': 17, 'public_gists': 4, 'followers': 10, 'following': 0, 'created_at': '2014-06-30T13:28:04Z', 'updated_at': '2023-01-05T12:47:53Z'}
                    

Building web apps with Django

Django is a popular framework for building Python web apps quickly

We'll use it to build a small app that fetches data from an API and displays it in a web page.

Screenshot of Django landing page

What should I know before starting Python 2?

Python 2 builds on Python 1, so you should be familiar with the basics covered in that class:

  • Data types & expressions (strings, integers, floats, booleans)
  • Data structures (lists, dictionaries, tuples)
  • Defining functions
  • Calling functions & methods
  • Conditionals (if/then/else)
  • Loops (while & for)

Class logistics

Questions?