first running program:
Code: Select all
import config_file
import subprocess
cmd = config_file.cmd
light1_on = config_file.light1_on
#below works to modify the cmd
cmd = cmd + light 1_on
output = (subprocess.check_output(cmd))
#below does not SAVE into config_file after program exits
config_file.output = str(output)
#program now exits
Code: Select all
cmd = "/home/pi/433/codesend "
light1_on = "288888"
light1_off = "18888"
#below is never updated and therefore when i run a different module output is blank
output = ""
Code: Select all
import config_file
output = config_file.output
#always blank
print(output)
So how am I MEANT to do it?