sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #27327
Re: [Question #252390]: changing a variable from true to false (sikuli)
Question #252390 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/252390
Status: Open => Answered
Eugene S proposed the following answer:
Hi Richi,
First of all, before you run any actual code, make sure you have your
file backed up as this code WILL rewrite the file.
Generally you only want to find in file the line that includes
"configure.camera" pattern and then write a new line (instead of the old
one) with the relevant parameter. So it's one of the two:
configure.camera=True
or
configure.camera=False
For this specific scenario, the code looks like that:
import fileinput
def changeCameraParameter(status):
for line input.input("C:\\Path\\...\\version.txt, inplace = True):
if appPattern in line:
print "configure.camera=status
else:
print line,
and then just run the function with relevant status ("True" or "False"):
changeCameraParameter("True")
or
changeCameraParameter("False")
Cheers,
Eugene
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.