C++ and Python are my two main languages, with most of my experience in the former. Your code looks pretty good to me. However, if you plan on making it bigger, you'll probably want to switch to an object-oriented model.
You may consider using PyLint on your code, if you don't already. It integrates into Atom, NINJA-IDE, and many other Python IDEs. I never code without it, and it helps keep my code clean. (Just be ready to tweak pylint's configuration a bit as you learn more about it.)
On a related note, it may also be helpful to your transition from C++ to Python to read my article ITWAMTSP: I Think We're All Making The Same Point.
All the best!
Thanks, Jason! I'll definitely look into PyLint.
Any advice on Python IDE? I mostly use vim in my C++ projects, though.
It's really quite relative. There are so many good IDEs, but each is a little different. Here are a few to try out:
NINJA-IDE: My personal favorite Python IDE. However, it is temporarily incompatible with Ubuntu 17.04+, since they're still depending on Qt4 (which was DC'd on 17.04 onward). However, it works VERY well on any system that Qt4 can be installed on.
Atom: My current IDE. It supports many languages, Python being one of them. If you install the packages for the Python language syntax, linters, autocomplete, and debugger, it makes for a fantastic interface. However, I use the Terminal for running the Python code when using Atom.
Spyder: One of my employees was first introduced to coding via Matlab, so I suggested Spyder for him (due to its interface similiarity). As far as I know, he's still using it.
There are plenty more besides, but those three are at the top of my list. They're also all open source.
My Python IDE of choice is JetBrains' PyCharm. It is absolutely amazing, and has a community edition as well. It is somewhat heavyweight (memory, CPU) but the benefits in terms of code intelligence (auto-completion, warnings, automatic fixes) and refactoring tools are amazing.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.