Getting to the root of your project

Getting to the root of your project

When programming in python, you sometimes need to access a path off your project root from deep in another directory hierarchy. Here is a really easy way to do it that always works: import sys print(sys.path[1])  This way, you can use relative paths from the...
Python string party

Python string party

For quite a while now there has been a better way to handle strings in Python. But for some reason it isn’t used as much as I believe it should be. Suppose you have the following variables: name = “andy” age = 42 likes = “Python” and you...