Teach you how to make a small program

(Today’s weekend, learning problems are not big, don’t say I’m not doing my job properly!)
Program function
1. First of all, as a third party of high school, of course, it is the first choice to do a countdown to the college entrance examination. A desktop function is needed.
2. Since the time of the college entrance examination may be different each year, we must also have time to set the function. (But it must be separated from the ⏲ interface.)
3. The simple timing program is too monotonous, and another wallpaper replacement function.
Rough style
one, the timer should
Insert picture description here
first be centered, transparent, and some weather information should be used (our school’s electronic products are highly regulated, and some students cannot use the equipment to obtain weather information. Of course, the weather information may be for students living on campus. Not much effect)
Second, the controller looks like the
Insert picture description here
project structure.
First, let’s take a look at the project files. I
Insert picture description here
believe that everyone’s English level is higher than mine. You can see at a glance what these files are
Canve (canvas) because they are written and used by tkinter. Draw a timer on the canvas. Here it is named canvas. Of course, it is named canvas to distinguish it.
Ground is the processing of the wallpaper. Use the crawler to get the URL of the wallpaper image and save it into the data file. When the user previews or downloads the wallpaper, the URL is read and the image is downloaded.
weather gets weather information and feeds back a string.
The main control program is the main file.
set_black sets the wallpaper.
There is no need to introduce other documents, mainly these.

Data connection
Now that the timer program and the control program are written, they are equivalent to (that is) two independent processes.
As shown in the figure:
Insert picture description here
and then:
Insert picture description here
how to achieve it.
Use data file interaction, the
Insert picture description here
Insert picture description here
main control program and timing program will both write and read files (data) so that an interactive process can be realized.
Insert picture description here
Insert picture description here
Project status
Insert picture description here

The program is packaged and
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
everything is normal.
Okay, just kidding, I will update the sequel later and show the specific code.
Insert picture description here
Link: https://pan.baidu.com/s/16-MiicLiuMfWDbBevAz-xQ Extraction code: 62vu After copying this content, open the Baidu Netdisk mobile phone App, the operation is more convenient

Guess you like

Origin blog.csdn.net/FUTEROX/article/details/105605475