Ask coding questions

← Back to all posts
Question about Python GUI automation.
ndeering (2)

I am new to Python coding and am interested in using it to automate some of my work. I am currently an intern, and most of my work is data entry related, so Python seems like a great thing to learn.

However, is there any way to automate the keyboard or mouse in such as the way 'Automate the Boring Stuff' does? I have searched for this topic a lot and have received no results. I have found that REMI is a possible solution for this but have not been able to get it to work.

Before I continue trying to automate on, is it even possible to control the keyboard and mouse?

Answered by Scoder12 (348) [earned 5 cycles]
View Answer
Scoder12 (348)

Unfortunately, this is not possible because python programs run in a cloud machine and don't have access to your keyboard and mouse. You can still Install Python and run your code on you own machine.

I am helper. Please mark as answer and upvote if this is a good answer!

ndeering (2)

@Scoder12 Thank you, is it possible to scrape data from one website and fill out a form with that data?

Scoder12 (348)

@ndeering yes, if you reverse engineer the form and if they don't have any captcha checking.

YatinBayya (18)

Currently, the default libraries prevent you to automate the user's keyboard or mouse. Although this might be helpful, it guides you through the basics and eventually leads your question in chapter 18.

I hope that is helpful and good luck with your project. If this helps you I would appreciate if you would select this as the correct answer.

mwilki7 (502)

If you want to simulate keyboard/mouse sequences to be performed on your computer, I recommend autohotkey.

ndeering (2)

@mwilki7 this would work in or only on a local install of python? Thanks for the response.

mwilki7 (502)

@ndeering autohotkey is its own language
I don't think it's on repl though

21natzil (875)

Interesting question! Do you think you could share the repl you want to automate, and what you want to automate?