Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
usage_of_batocera-settings [2023/10/07 05:39] – cleanup, rephrase to make more sense, removed recalbox mention and older bato info (replaced with instructions on how to see manual near top of page) atari | usage_of_batocera-settings [2023/10/09 20:41] (current) – python example works now crcerror | ||
---|---|---|---|
Line 137: | Line 137: | ||
<code python| obtain_value.py> | <code python| obtain_value.py> | ||
+ | |||
# | # | ||
- | # -*- coding: utf-8 -*- | ||
#This is an example file how batocera-settings-get can be utilized | #This is an example file how batocera-settings-get can be utilized | ||
#to read a value out from / | #to read a value out from / | ||
import subprocess | import subprocess | ||
- | + | command=(["batocera-settings-get", " | |
- | value = (subprocess.check_output(['batocera-settings-get', 'power.switch.device' | + | rc = subprocess.call(command, |
- | if value: | + | if rc == 0: |
- | print "Power Switch Detected: ", value | + | value = subprocess.check_output(command).decode(" |
+ | print ("Power Switch Detected: ", value) | ||
else: | else: | ||
- | print "No power switch detected!" | + | print ("No power switch detected!" |
</ | </ | ||
- usage_of_batocera-settings.txt
- Last modified: 7 months ago
- by crcerror