In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
How to use python to automatically complete the work, I believe that many inexperienced people do not know what to do. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
Nothing can make learning more motivated than putting what you have learned into practice.
Do not know if there are some work in your work that need to be repeated by clicking the mouse, because it will affect the relationship of the financial statistical statements, we have to modify the date of the documents in ERP at the end of every month and the beginning of each month. When there are many documents, just the modification will allow you to click the mouse to get numb in your hands. Here I would like to complain about the Langsha software, other documents can be modified in batches, but this transfer order is not good, why are you so lazy in your research and development? Why don't you finish him with so little work left? ) my colleague mentioned the keyboard genie to me before, because I was in charge of other work at that time, but I didn't understand it. Now that the company has fewer staff, this work has come back to me. Just before I was learning Lianliankan, I knew that Python could also simulate mouse clicks, so I used it directly.
Let's take a look at pyautogui first.
Pyautogui.moveTo, mobile mouse; pyautogui.click, click the mouse, through button to control left-click or right-click, click=n sets the number of clicks, interval controls the time it takes to click, some programs confirm that double-clicking has a time interval, if you do not add this interval, there is really no way to identify. Well, we're talking about you here, Lang Sha. At least you can't recognize the first one. It made me test a lot. These two functions are enough for my operation this time. Of course, the role of Pyautogui is definitely more than that. Pyautogui.typewrite can also enter numeric symbols of letters on the keyboard and take screenshots of screenshot (this can also be used in lianliankan. (wait, wait.) wait, wait, wait. We know how to simulate and control the mouse, so we have to tell it where to go and where to click. Pyautogui uses pixels to tell the program where to operate. So how do we get this pixel? Here, I use the drawing program that comes with the operating system. The "Select" function in the drawing will show the pixels of the selected area, we just have to choose from the location we need to click to the upper left corner. Many friends in the process of learning Python often do not want to learn because there are no materials or no guidance, so I specially prepared a large number of PDF books and video tutorials, all of which are given to you for free! Whether you have a zero foundation or a foundation, you can get your own corresponding learning gift package! Including Python software tools and 2019 latest getting started to hands-on tutorials, (http://nxw.so/3rsqX) copy to the browser to open!
All right, everything is ready here, let's go to the code.
I have a for loop here that allows him to operate from the first order to the last one on this page. Time.sleep, it takes time for this system to run. Let's give the mouse a rest. Finally, you may need to remind everyone that if you are halfway through the program and find that it is no longer necessary to execute it, or if there is an error (for example, the system is stuck and the rest time is not enough), you want to stop the program, and CTRL+C will not work at this time. You need to place your mouse in the top left corner of the screen. Usually after a few seconds click will stop, (python shell will report an error, this does not care) as for the effect, there is no video recording, after all, it will reveal personal and company information. It must be a personal test, guaranteed by my half-hour rest time.
After reading the above, have you mastered the method of how to use python to finish the work automatically? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.