#73: First Steps with SQLAlchemy
A big gap in my knowledge of Python is how to access a database. Let us look what Python offers to persist data in a relational database like PostgreSQL, SQLite or SQL Server.
A big gap in my knowledge of Python is how to access a database. Let us look what Python offers to persist data in a relational database like PostgreSQL, SQLite or SQL Server.
Last week I attended my first PyCon US. It was a well-run online event that showed me many interesting things about Python that I had no idea were even possible.
Python is a great fit for maintenance tools. But when they run for a few minutes without any info to the user, one does not know it they are still doing their job or if they stopped. Let us look on a simple way to make your scripts more user friendly.
Time goes by quickly and before you know it your Python interpreter is a few versions behind. Pip tells you that a new version is around, but Python keeps working and so we easily forget that Python itself deserves an update from time to time.
After last week’s introduction to doctest it is now time to have a closer look at dynamic output and how we can test that with doctest.
Documentation is an important part of every software project – and probably the most neglected one. Nothing is worse than outdated documentation with examples that no longer work. Python has a great little helper to ensure that your documentation is up to date.
The usual way to pick a random item from a list is to generate a random number and pick the item at this position. That is how I would do it in C#. In Python we have much better ways to achieve that.
Sometimes you need some random numbers for your application. Python offers a nice built-in random number generator with a lot of functionality to solve this problem.
Now that we can log from Python to Seq it is time to do the same from our Flask web application.
In C# I use Serilog to create structured log messages and the Seq log server to analyse them. Let us figure out how this setup works in Python (and if it works at all).