ubuntuusers.de

Anhang: maus.py

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#!/usr/bin/python
# -*- coding: utf-8 -*-

import os
import re

def ReadFile():
    os.system("cat /proc/bus/input/devices | grep -i Mouse -> /tmp/maus.tmp")
    myfile = open('/tmp/maus.tmp', 'rb')
    maus = False
    for line in myfile:
        if re.search("USB", line):
            maus = True
    myfile.close()
    return maus

Anhang herunterladen

Diese Revision wurde am 10. Oktober 2018 15:13 von ubuntuusers erstellt.