- #!/usr/bin/python
- # -*- coding: utf-8 -*-
-
- import sys
- import os
-
- def start_wiimote():
- file = os.popen('rm -f /var/log/wiistat.log; modprobe uinput; /usr/bin/wminput 2>&1 | cat > /var/log/wiistat.log&')
-
- def log_wiimote():
- filename = ('/var/log/wiistat.log')
- from os.path import isfile
- if isfile(filename):
- import codecs
- s = codecs.open(filename,'r','utf-8').read()
- return s
-
- def stop_wiimote():
- file = os.popen('killall wminput 2>&1 | cat > /var/log/wiistat.log&')
-
- if __name__ == "__main__":
- start_wiimote()
- #log_wiimote()
- #stop_wiimote()
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
def start_wiimote():
file = os.popen('rm -f /var/log/wiistat.log; modprobe uinput; /usr/bin/wminput 2>&1 | cat > /var/log/wiistat.log&')
def log_wiimote():
filename = ('/var/log/wiistat.log')
from os.path import isfile
if isfile(filename):
import codecs
s = codecs.open(filename,'r','utf-8').read()
return s
def stop_wiimote():
file = os.popen('killall wminput 2>&1 | cat > /var/log/wiistat.log&')
if __name__ == "__main__":
start_wiimote()
#log_wiimote()
#stop_wiimote()