python

2021-05-21 Basic usage of curses in python

Sometimes the Linux system does not have an interface, and you may need to complete the program interaction and status display in the terminal terminal. ncurses in C language supports the development of [command-line] interface programs, and curses is a python terminal interface library based on ncurses. This article implements a simple demo applet, which …

2021-05-21 Basic usage of curses in python Read More »

[python tutorial] try–except exception capture

Tip: After the article is written, the table of contents can be automatically generated. For how to generate it, please refer to the help document on the right Article directory Anomaly Introduction Catch exception try…except except catch exception type Ways to catch multiple exceptions In case of ambiguous error type try…except…else… try…except…finally… Anomaly Introduction What …

[python tutorial] try–except exception capture Read More »

[python get time]

Several formats for getting time Get current time timestamp get current time get yesterday’s date Generate calendar The operation effect is as follows: Calculate the number of days per month Calculate 3 days ago and convert to specified format Get the old time of the timestamp Get time and specify format Pandas daily practice: 21. …

[python get time] Read More »

[python–tutorial] pyautogui graphical automation, beat repetitive office tasks.

[pyautogui is] a magical image automation library that can do everything after learning. You can hang up the phone to brush the treasure chest, and you can automatically write documents on the bottom. (>People<;) Let me pretend, don’t hammer me, thank you! Install The installation of this pyautogui on win10 is quite pitiful. There were …

[python–tutorial] pyautogui graphical automation, beat repetitive office tasks. Read More »

[PyQt] Use .qrc to generate resource files for use in programs

Create the images.qrc file, which saves the resource location: <!DOCTYPE RCC> <RCC version="1.0"> <qresource> <file alias="icons/add.png">icons/add.png</file> <file alias="icons/appicon.png">icons/appicon.png</file> <file alias="icons/button.png">icons/button.png</file> <file alias="qss/qss.qss">qss/qss.qss</file> </qresource> </RCC> Generate the images.py resource file with this qrc file through the command: pyrcc4 -o images.py images.qrc Use in the program: import images # use icon in the program = QIcon( ':/icons/add.png' …

[PyQt] Use .qrc to generate resource files for use in programs Read More »

[Project combat] Python based on the Django framework to implement a campus online one-stop shopping system

Description: This is a web actual project (with software + code + documentation + video explanation ), if you need software + code + documentation + video explanation , you can get it directly at the end of the article. Video show: [Project combat] Python based on the [Django] framework to implement a campus online …

[Project combat] Python based on the Django framework to implement a campus online one-stop shopping system Read More »

[numpy summation] numpy.sum() summation

[numpy.sum(a, axis=None, dtype=None, out=None, keepdims=, initial=)[source])][source])](https://docs.scipy.org/doc/numpy/reference/generated/numpy.sum.html) is used to calculate the sum of array elements. #example import numpy as np x = np.random.rand( 2 , 3 , 4 ) #Generate a three-dimensional random array print( "This is a 2*3rows 4cols array\n" ,x) ''' >>> This is a 2*3rows 4cols array [[[ 0.88264952 0.12446208 0.82166137 0.31747846] …

[numpy summation] numpy.sum() summation Read More »

[Matplotlib drawing tips] Solve the problem of memory overflow, stuck, and blank except for the first picture when Matplotlib draws in batches

Problem Description When using [Matplotlib] to generate a large number of pictures in batches, the memory will gradually take off and then get stuck. At the beginning, I checked the tutorial and found that the new fig was generated in a loop, and the old fig was not deleted, resulting in a memory explosion. Try …

[Matplotlib drawing tips] Solve the problem of memory overflow, stuck, and blank except for the first picture when Matplotlib draws in batches Read More »