Reputation: 101
I wrote a code, which writes numbers with some mistakes for discord. I checked on my laptop, it's worked, but on phone pydroid it isn't working. code:
import keyboard as kb
import random as rd
import time as tm
x = 0
tm.sleep(10)
z = x+20
while True:
x+=1
if x == z and 0:
tm.sleep(100)
z = rd.randint(z+100,z+500)
kb.write(str(x))
if rd.randint(1,20) == 1:
if rd.choice([True,False]):
kb.write(str(rd.randint(min((x-1)%10,(x+1)%10),max((x-1)%10,(x+1)%10))))
else:
kb.write("\\")
tm.sleep(2)
kb.write("\n")
Error:
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module>
start(fakepyfile,mainpyfile)
...
ImportError: You must be root to use this library on linux.
[Program finished]
```l0
Upvotes: 0
Views: 933
Reputation: 52
Similar post : Import error: you must be root
Try sudo pip3 install keyboard
.
Upvotes: 0