L
L
Leonid K2016-10-05 16:52:17
linux
Leonid K, 2016-10-05 16:52:17

How to allow kivy to watch in event1?

after launch

from kivy.app import App
from kivy.uix.button import Button

class TutorialApp (App):
  def build(self):
    return Button(text='hello',
      background_color=(0,0,0,1),
      font_size=150)

if __name__ == '__main__':
  TutorialApp().run()

and launch
$ python3 po.py
gives me an error
Exception in thread Thread-1:
 Traceback (most recent call last):
   File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
     self.run()
   File "/usr/lib/python3.4/threading.py", line 868, in run
     self._target(*self._args, **self._kwargs)
   File "/usr/local/lib/python3.4/dist-packages/kivy/input/providers/mtdev.py", line 219, in _thread_run
     _device = Device(_fn)
   File "/usr/local/lib/python3.4/dist-packages/kivy/lib/mtdev.py", line 131, in __init__
     self._fd = os.open(filename, os.O_NONBLOCK | os.O_RDONLY)
 PermissionError: [Errno 13] Permission denied: '/dev/input/event1'

What to do?
Yes, you can write,
$ sudo python3 po.py
but you don’t want to run the program from su every time.
(debian 8, python 3)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2016-10-05
@mreluzeon

And what prevents you from giving the necessary rights to the file node /dev/input/event1?
chmod and chgrp will help you, you can even write a rule for UDEV where you can immediately set all rights, or you can include commands in the boot script.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question