Python IDEs and AoC Programming Puzzles

Intro and Objectives

On the Setting up your analytical machine page you learned a bit about a few integrated development environments (IDEs) for working with Python. Now, I want to give you a brief intro to PyCharm through a common use case: we start development in a Jupyter notebook and then decide to migrate to PyCharm. PyCharm has a zillion features and can be a bit overwhelming. We will focus on a few key basic features and concepts and then you can built on that. In particular, we will:

  • Create a new PyCharm Project based on an existing folder containing a notebook and data

  • Create a new Python file and copy in code from a Jupyter notebook

  • Run our Python program and learn about run Configurations.

  • Use the visual debugger

  • Learn about built in code inspection tools

  • Do basic refactoring by renaming a variable

  • Make code improvements

We will do all of the above while learning about a pretty popular site for programming puzzles known as the Advent of Code. We will be using this site as a source for some programming puzzles that we’ll do as part of this course. One of the main objectives of this course is to develop our skills in using Python (and programming, in general) to solve analytical problems. Small puzzles like these are an effective and fun way to contribute to this objective. They force you to think about a problem, develop a solution strategy including data structures and logic, and then implement your plan and make it work. More details will follow, but for now, we will:

  • Get an overview of the Advent of Code (AoC) site.

  • Learn how to login to the site and read the first puzzle

  • Download the problem data for a puzzle

  • Solve the puzzle in a Jupyter notebook and submit an answer

  • Migrate our solution from a notebook to a Python script in PyCharm

  • Understand the basic flow of solving puzzles in AoC

Readings

Some good resources to know about:

Downloads

Activities

You’ll see in the following screencast that I introduce the Advent of Code puzzles using the 2020 version. The entire history of puzzles is available. Just make sure you go to the AoC 2020 page - https://adventofcode.com/2020 if you want to follow along with the video. When I assign puzzles during the semester, we might use puzzles from different years.