Meet your Own "little vanity" with Python

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.