First of all, to learn this is just for fun, just for fun, not to use this fraud, do some bad things! I want to be a technical person, self-control!
We sometimes post a log, or a blog post, and always want to have a high-volume view, so it looks like a face. Then we can choose to make the blog or the content of the log more refined, so there will be more people to see. Or we'll advertise and let everyone see. But after we learned the program, maybe we could try it with the program.
Let's try it! Here's test.py.
Import WebBrowser as Web Import = 0 while I <: web.open_new_tab ('https://www.baidu.com/ ')# open specified page i + = 1 time.sleep (2)
We first import the Web package, and then we set up a loop that loops 15 times after exiting. Inside of We are through web.open_new_tab(‘ulc‘)
to open the specified page, I am here to open our degrees Niang. You can change to the appropriate blog or log URL to try. After opening, stop for two seconds.
But then everyone will find that there are too many pages open and the computer will get stuck. So we can change the test.py again.
ImportWebBrowser as WebImport TimeImportOSI=0j=0 whileJ <3 : whileI < 5: Web.open_new_tab ('https://www.baidu.com/')#open a specified Web pagei + = 1Time.sleep (2) Os.system ('taskkill/f/im Chrome.exe') Time.sleep (2) I=0 J+ = 1
This adds something new and sets up a big loop with a new variable. We open 5 pages at a time and then call the system's API to kill the Web process. After two seconds stop the I 0 to continue the loop. Until the entire loop is completed. Well, this thing is not very practical, but it's OK to make girls happy.
Meet your Own "little vanity" with Python