I just started experimenting with Python's keyboard module, and wanted to test out a few lines of code:
import keyboard
keyboard.write("Hello")
However, when I try to run the file from IDLE or from the terminal, there is an error message.
In IDLE: "You must be root to run this file from linux."
On root
terminal: "Permission Denied."
Any suggestions on how to get this to run?
(Note: I have tried using other modules in various files and they worked fine, so I know my Python installation is fine). I am on Ubuntu 20.04.
Update:
I tried running the file using sudo
, but I got the same error message: Permission Denied
CodePudding user response:
You can try sudo command like sudo python3 script.py
.
if it's don't work you can try these things;
chmod x script.py
python3 script.py