Modern Python Developer's Toolkit

switowski


0

Votes

Description:

This is a tutorial that I wish someone gave to me when I first learned Python.

Python is (relatively) easy and fun to learn, but there is a gap between “knowing how to write Python code” and “knowing the tools and good practices when writing Python code”. This tutorial will try to bridge this gap. It’s intended for beginners who know Python, but who are not sure how to write a Python project from scratch.

In this tutorial you will learn:

  • How to set up VS Code for writing Python
  • How to use virtualenv, pyenv, pipenv, and pipx
  • How to use cookiecutter, how to structure your Python project, and how to easily deploy it with Docker
  • What’s PEP8 and how to enforce it with code linters/formatters (black)
  • Why you should use IPython instead of Python REPL
  • How to test your code with pytest
  • How to create great documentation with Sphinx

Prerequisites:

This tutorial uses: VS Code, Docker, and a modern version of Python (at least 3.4, preferably 3.6 or newer). I will show you how to install each of those tools, but if you can install them beforehand, that's even better.

Video URL:

https://www.youtube.com/watch?v=5krqGNAiYAg

Content URLs:

Workshop material: https://pycon.switowski.com/

Workshop video: https://www.youtube.com/watch?v=WkUBx3g2QfQ

Outline:

  • 0:00 - Introduction
  • 4:17 - VS Code: Why VS Code
  • 6:32 - VS Code: Installation
  • 7:28 - VS Code: Setting up Python plugin
  • 13:11 - VS Code: Important keyboard shortcuts
  • 16:33 - VS Code: Running code
  • 18:24 - VS Code: Debugging
  • 21:17 - VS Code: Testing
  • 23:53 - VS Code: Snippets and tasks
  • 29:40 - VS Code: Plugins
  • 40:02 - VS Code: Miscellaneous
  • 41:52 - Python & packages
  • 42:11 - Python & packages: pyenv
  • 52:49 - Python & packages: virtual environments
  • 1:00:09 - Python & packages: pipx
  • 1:03:49 - Exercise 1: pyenv, pipx, and virtual environments
  • 1:04:20 - Project structure
  • 1:05:47 - Project structure: cookiecutter
  • 1:14:38 - Code style
  • 1:15:25 - Code style: PEP8, PEP257, and black
  • 1:18:49 - Code style: Static code analyzers
  • 1:24:31 - REPL
  • 1:24:58 - REPL: IPython
  • 1:28:02 - Testing
  • 1:28:20 - Testing: Pytest
  • 1:37:21 - Documentation
  • 1:37:35 - Documentation: Sphinx
  • 1:44:43 - Exercise 2: TODO application - explanation and setup
  • 1:51:30 - Exercise 2: TODO application - solution
  • 2:11:58 - Deployment: Docker
  • 2:23:38 - Closing words

Speaker Info:

Sebastian is a Python consultant and trainer based in Poland. He started his journey with programming as a software developer at CERN, where he fell in love with Python (and teaching). Now he is helping companies untangle their complicated architecture and build all sorts of interesting Python projects.

In his spare time, he talks about Python, best practices in programming, and productivity.

Speaker Links:

Website: https://switowski.com/

Blog: http://switowski.com/blog

Twitter: @SebaWitowski

Section: Developer tools and automation
Type: Workshop
Target Audience: Beginner
Last Updated: