I would like to make a program for make my window refresh every 10 min. i'm new to programming and currently exploring python technology
My machine is connected with pc based software which will test the product
The software tend to be freeze and system hang-- we need to restart the pc to solve this issue
idea:
I want to make a python program to auto run and keep click refresh button every 10min
my idea is to keep window always ready to receive data
I just beginning to explore below code ( very simple)
import mouse
#left click
mouse.click("right")
mouse.wheel(-3)
# right click
mouse.click("left")
How do I access the "refresh" option on the right click?
is my idea in not particle?
Your question is very unclear, so I'm just guessing you are in a browser window and want to refresh the site (right?)
Using the mouse package to do so will be very hard, therefore I suggest you use the keyboard-package, which is even from the same author.
import keyboard
keyboard.send("F5")
Related
I have a script that is used to login in to a company-made application and click the right buttons like "continue", or "ok", etc. to perform a certain process. However, I have had to use screenshots of these buttons to click in order to do this using pyautogui. Is there any package or way to automate this process without using images. Maybe it can detect the text of the button and click it. I do not have identifiers for the buttons available and no access to the code/info behind the application. Let me know if you have any ideas. Thanks!
I have a few questions that may be helpful:
Does the layout of the buttons change? If it's always the same you can just program the correct locations and timing and not worry about reading the screen.
If you really have to read the screen, look into optical character recognition (ocr).
Is the application keyboard accessible? If so, using Tab and Enter to activate the buttons is simpler than controlling the mouse. Also, if it was made by superstars you can use find (ctrl-F) to search for the text on the buttons and go to them.
This answer is pretty vague, but I can only be as specific as the question asked.
I'm searching for a programming language or python plugin to simulate user input, like clicking a button in a application(a bit like the python plugin 'Selenium'). The problem i have is, that I would like to have the application running in the background, so that I can still use my PC while the program is running.
Sorry if the question is vague, i just don't know where to start.
simulate user input, like clicking a button in a application
I suggest taking look at PyAutoGUI, it allows you to cause mouse move, mouse click, keyboard write and so on. It is cross-platform. I do not know if it will met your have the application running in the background requirement on all platforms you must support.
I am pretty unfamiliar with the automation environment but I'm looking to create a solution for a problem I'm having right now.
There is a proprietary application on my work laptop that shows me some relevant information. Above the table is a refresh button that I have to click as often as possible to refresh this table until a new row shows up which I have to process.
My first approach to this was to create a small .exe in Python that would control the mouse and click the refresh button on an interval and then take a screenshot of the part of the application where the new row would show up and compare it to a screenshot without the row to check that there is a difference.
The issue with that approach is that I would be unable to use the laptop when this program would run as it would control the mouse and the window would have to be in focus.
What other approach could I take to tackle this?
I am trying to do some automation with Python, but I want to execute it and still being able to use my machine freely. So I am using PyWin32 to emulate some clicks and typing but it only works if I run the script while the window is open and focused.
There is a way to make my script only focus on a window, and still be able to click on that window without taking control over the mouse, even if the window is not focused (if it works when is minimized, is best!)?
i do not know the PyWin32 package but from a win32 api point of view the thing should be easy.
get a HWND of that window and post (PostMessage) the events you want to the window.
eg: WM_LBUTTONDOWN & WM_LBUTTONUP, WM_RBUTTONDOWN & WM_RBUTTONUP, WM_MOUSEMOVE...
look at the win32 help how to set the wParam & lParam data for the specific events.
i controlled diablo 3 this way for example ;)
Edit:
there is no need to be in focus or maximized for this
Edit Edit:
may be you should look after autoit, a widely used scrip language for window automation. I never used it but read the name very often in this context. it may also be usable from python.
i have created a chat system in python, using easygui for graphical user interface.
there are minimize,maximize and close button on top right of window,but the close button is not functioning at all.i just can use the exit button which i created to close the application. i had some search and found there is a problem with easygui, so is it totally impossible to fix this problem? or how can i remove that close button from top right as there is no use for it. its final year project and i'm afraid my advisor and supervisor want try that button and i lose mark because of no function
is there anyway to fix it or at least remove that close button?
This is likely past the due date for your assignment...sorry. But, that was a known limitation of easygui. An up-to-date version with a fix for that will be released soon. If you can't wait, you can take a look at it in development form: https://github.com/robertlugg/easygui