Forums

Python gui

Hi I want to control the keyboard and mouse with Python. I'd like to use the import pyautogui but it seems not possible on PythonAnywhere Any help, please? Thank you

Hi there, PythonAnywhere is a server environment -- that means all the Python code runs on our servers, and the only way it can interact with you is through your browser. So that means the text-only consoles, or web apps. But neither of those is going to be able to interact directly with your keyboard and mouse. For that you need to install and run Python on your own PC....

Hi, is there a work-around that makes it is possible to send key clicks in pythonanywhere, e.g. a virtual keyboard?

If you want to send clicks and key presses to a virtual browser, there is always Selenium.

yup. depends on what you want to do. for clicking on links on a website, you could use virtualdisplay + selenium. See here.

can you give me a little more help on how to set up the virtualdisplay + selenium?

were you able to follow the code in the link? is there some particular error that you are seeing?

forgive me, I am new to this. I am guessing in order to run this code you need to run it with xvfb?

forgive me, I am new to this. I am guessing in order to run this code you need to run it with xvfb? I see the code.. how do i run it? :)

pyvirtualdisplay handles xvfb for you. Just run it.