Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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) atariusage_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>
 +
 #!/usr/bin/python #!/usr/bin/python
-# -*- 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 /userdata/system/batocera.conf with python #to read a value out from /userdata/system/batocera.conf with python
  
 import subprocess import subprocess
- +command=(["batocera-settings-get""system.power.switch"]) 
-value (subprocess.check_output(['batocera-settings-get''power.switch.device'])) +rc = subprocess.call(command, stdout=subprocess.DEVNULL
-if value+if rc == 0: 
-    print "Power Switch Detected: ", value+    value = subprocess.check_output(command).decode("utf-8") 
 +    print ("Power Switch Detected: ", value)
 else: else:
-    print "No power switch detected!"+    print ("No power switch detected!")
 </code> </code>
  
  
  
  • usage_of_batocera-settings.txt
  • Last modified: 7 months ago
  • by crcerror