Python Tutorial

How To Install Python Packages Using Requirements Text File

When we develop Python programs, we always need to install and use a lot of third-party library packages. But if we develop the same Python program on another new machine, we may need to install all those library packages again. This will waste time and even make errors. But PIP has provided a method for […]

How To Install Python Packages Using Requirements Text File Read More »

How To Run Unit Test Use External CSV Test Data In Python

Python unittest library is used to run the unit tests for Python classes and functions. It is a built-in library provided by Python, so you do not need to install any third-party library to use it. This example will demo how to use it to make your unit test more clear and easy. But the

How To Run Unit Test Use External CSV Test Data In Python Read More »

How To Pass Multiple Parameters Via Url In Django

If you find the Django url pattern is not easy to use when you want to pass multiple request parameters via url, you can use the original method to implement it. The original method is to use url like this http://127.0.0.1:8000/dept_emp/emp_list/?dept_id=1&user_name=jerry. It just adds the parameter name and value pair after the question mark (?) of

How To Pass Multiple Parameters Via Url In Django Read More »

How To Create / Remove Django Project Application

Each Django project can have multiple applications. Each application can have multiple models and each model has mapped to one table in the backend database. This article will tell you how to create Django project application. How to remove all database table of the application and how to remove the application completely.

How To Create / Remove Django Project Application Read More »

Python Connect To MySQL Database With MySQL Connector & PyMySQL Example

When you want to connect to the MySQL database in Python code, you can use both the mysql-connector-python MySQL driver and PyMySQL. The mysql-connector-python MySQL driver is a MySQL server built-in driver and the PyMySQL is a third-party library. All the two MySQL python libraries provide classes for you to get MySQL database connection, execute insert, delete,

Python Connect To MySQL Database With MySQL Connector & PyMySQL Example Read More »

How To Resolve Access Denied For User ‘root’@’localhost’ (using Password: Yes) When Connect MySQL Database

When I connect MySQL databases in source code, such as Java code or Python code. I encounter an error which I do not meet when I use MySQL client tool software to connect it. The error message is Access Denied For User ‘root’@’localhost’ (using Password: Yes). To resolve this issue is not hard, this example

How To Resolve Access Denied For User ‘root’@’localhost’ (using Password: Yes) When Connect MySQL Database Read More »