1. How to get the current system date time in python. Import the python datetime module. >>> import datetime Get the current date time. >>> curr_time = datetime.datetime.now() >>> >>> curr_time.year 2021 >>> curr_time.month 4 >>> curr_time.day 5 >>> curr_time.hour 19 >>> curr_time.minute 54 >>> curr_time.second 22 >>> curr_time.date() datetime.date(2021, 4, 5) 2. How to …
This article will show you some examples of how to use the python os.path module exists function to check file/folder existence. And how to create directory and subdirectory with python os module mkdir and makedirs function.
This article will introduce some python conversion functions that can convert between characters and numbers.
This article will tell you three methods about how to add comments to multiple lines in python source code.
How to compile a Python program into an executable file? This article will tell you the steps about how to convert a python program (.py files) to an executable file on both Windows, Linux, macOS operating systems.
Python provides two sorting methods for a list object, one is to use the built-in function sort of the list object, the other is to use the sorted function to sort. The difference between the two sort methods is that the sorted function does not change the original list and returns a sorted list.
The Python random module shuffle() method shuffles all elements of a list in random order. This article will introduce how to use the random module shuffle() method in Python with examples.
This article will tell you how to use the python PyQt5 library to implement a prompt dialog, it will tell you how to set the dialog title, tooltip text, size, and position coordinates. It also adds a button on the center of the dialog, when you click the button, it will print a text in …
The python csv module provides functions to operate CSV files. This article will show you some examples of how to use the python csv module to read, write CSV files.
In python, you need to use the python os module to handle files and folders. Before using the python os module, you need to import the os module with the command import os. Then you can call the related function of the os module in the format of os.function_name().