We generate a random password(s) that can be used in database projects or to automate login password creation. In this example we are using Python 3.8 but I believe anything above Python 3 should work. My challenge was that random generators tend to use all of the characters available including… Read more »
This is a simple example on converting List data to a standard Comma Separated (CSV) file using Python 3. We are using the Python Standard library and the CSV module to create our CSV file. This module is loaded with options so we are just including the more often used… Read more »
The Python List() can handle multiple types of data making it very useful for different applications. The list() can cut down on lines of code and the need for casting or converting data types. This is especially convenient if we have database queries that include different types of data, numbers,… Read more »
When dealing with database queries we use the for-loop to access each record and deal with it one at a time. In some cases it’s better to deal with the database results in a variable so we do not need to query again. The Python List object allows us to… Read more »
Often there is a requirement to add, subtract or calculate the difference between dates using Python. We will run through some examples of how to find and generate dates moving forward and backward through time using the datetime module. Here are some quick examples on how to pull specific values… Read more »
The python dictionary is similar to an associative array but an array uses a numeric index. The Dictionary is an unordered key-value pair and the values can be any type of Python data. In our example, we create a Dictionary and unique keys to assign values. Simple Dictionary Example We… Read more »
For this example we will be connecting to a SQL Server database using the Visual Studio Code (VS CODE), Windows Authentication and the pyodbc module. This is also similar to our recent post on connecting to MySQL using Visual Studio code in Linux and this post has more info on… Read more »
We touched on using parameters in recent post so I wanted to expand on that and show an example for including variables in the SQL statements. If your not familiar with setting up a SQL connection in python, see our post called How to Connect SQL Server in Python. Or… Read more »
In this example we will be connecting to a MySQL database using the Visual Studio Code IDE. We will also setup a Python environment and install the MySQL Connector needed to connect to MySQL and MariaDB. The instructions should be similar on Windows, Mac and Linux but will not be… Read more »