In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "how to make a Python software to coax your girlfriend easily". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
We will use the datetime module and time module to get the time and calculate the time.
Use the os module to control the computer shutdown tkinter and tkinter.messagebox modules to make a pop-up warning.
Load the module first
Import datetime import time#, these two are the time module import tkinter import tkinter.messagebox # this is the message box, the key import os # of the dialog box, this is the key module of shutdown
If you don't have these modules, you can pip install them in cmd.
First, we need to set a user name and password.
If I use my girlfriend's name as the user name, the password is I love you, but the user name and password are wrong for 3 times and then the phone will be turned off. Yes, the phone will be turned off, just like this. Instead of shutting down the software, the shutdown code is as follows:
Def passwora (): global an a = 0 while True: print ("Please enter your name and press enter") name = input ("your name:") passwor= input ("password:") if name = "Dili Reba" and passwor== "I love you": App.trueafter () print ("zhe") a = a + 1 print ("wrong password you still have", 3-a, "second chance") App.falseafter ()
Use os module to do shutdown program:
Def falseafter (): Bevera if (b > 2): print ("your computer will shut down in 10 seconds") for i in range (10, 0,-1): print ("and", I, "seconds") time.sleep (1) print ("shutdown") # os.system ('shutdown-s-t 5') return 0
The next step is to write the content of the software. Anything can be written here. I just wrote our timer.
Def trueafter (): while True: D1 = datetime.datetime # D1 = datetime.datetime (2019, 10, 13, 17, 26,00) D2 = datetime.datetime.now () interval = D2-D1 a=interval # the first item is the number of days 1 day apart datetime.timedelta (1630) b = interval.days # specific days c=interval.seconds # extra seconds d = interval.total_seconds () # total seconds difference print ("now is", datetime.datetime.now ()) print ("you met me in {}" It's our beginning ".format (D1) print (" We know each other ", a) print (" it's been {} days ". Format (b)) print (" looking back now we met {} seconds ".format (d)) print (" now I just want to tell you that my love for you will never change no matter what happens later ") time.sleep (2) # delays for 5 seconds
Finally, just run the software.
App.passwora ()
After the completion of the package into software, here I will introduce how to use the pyInstaller module packaged into software.
First
Pip install pyInstaller installs the pyInstaller module in the command manager, namely cmd
After the installation is complete, enter the pyInstaller-F file path on the command line to install.
-F means it is packaged into a single file.-F is packaged into a folder and software.
PyInstaller-F D:\ python\ 1.py
The directory of the software after the package is finished is here.
Copy this path to the folder directory to find the software
This is the end of the content of "how to make a Python software to coax your girlfriend easily". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.