Python

Connecting to MySQL With Python

The MySQL database is a popular option for storing data. It's powerful, reliable, and easy to use. However, it can be challenging to work with if you don't have the right tools. Luckily, Python has an API for MySQL that makes working with this database simple. Connecting to MySQL with Python code is a great way to build a rich set of data through programming and to create database content quickly.

The Ultimate Guide to Logging in Python

Logging is used to track events that happen when an application runs. Logging calls are added to application code to record or log the events and errors that occur during program execution. In Python, the logging module is used to log such events and errors. An event can be described by a message and can optionally contain data specific to the event. Events also have a level or severity assigned by the developer. Logging is very useful for debugging and for tracking any required information.

How to Learn Python Scripting in 7 Simple Steps

Python is one of the most in-demand programming languages in the world — and for good reason. Knowing how to code has never been so valuable thanks to the expanding world of tech and focus on data science. From landing high-paying jobs to improving your skillset, learning Python scripting can bring you many opportunities to succeed. However, while these opportunities are robust, many challenges come with learning Python.

How to Catch Multiple Exceptions in Python?

When a program encounters an exception during execution, it is terminated if the exception is not handled. By handling multiple exceptions, a program can respond to different exceptions without terminating it. In Python, try-except blocks can be used to catch and respond to one or multiple exceptions. In cases where a process raises more than one possible exception, they can all be handled using a single except clause.

How to Handle Unhashable Type List Exceptions in Python

The Python TypeError: unhashable type: 'list' usually means that a list is being used as a hash argument. This error occurs when trying to hash a list, which is an unhashable object. For example, using a list as a key in a Python dictionary will cause this error since dictionaries only accept hashable data types as a key. The standard way to solve this issue is to cast a list to a tuple, which is a hashable data type.

3 Ways to Integrate MySQL With Python

As one of the most popular relational database management systems, MYSQL gets a lot of use from a variety of applications. With the popularity of Python in web-based applications, it's essential that MySQL and Python can communicate with one another. Read on to learn more about MySQL and to discover three ways to integrate it with Python.

REST API With Python

According to Stack Overflow Developers’ Survey 2019, Python is the second “most loved” language with 73 percent of the developers choosing it above other languages prevailing in the market. Python is a highly versatile language that supports a wide variety of use cases across several languages. It is a language well-known for its ease of use, portability, and ability to handle large data sets.

An Introduction to REST API with Python

REST API is an acronym that stands for Representational State Transfer Application Programming Interface. REST APIs are used to create "web services" in HTTP requests, which provide data between client and server applications. This article will cover some of the basics of REST APIs and will also walk you through making a basic API using Python.