- Sep 30, 2018
- 102
- 70
Python:
define dlgOffice = {
"Work" : "Find some info for my next job",
.../...
}
.../...
menu choiceMyOffice:
# tried text(...) / "{}".format... / "%s" %...
"[dlgOffice['Work']]" if currentHour >= 6 and 1 == 1:
call officeWork
FIRST
if i understood web infos, we can condition menuitem like that and only that :
Python:
"menuitem" if condition:
I have my own solution with a class like that :
Python:
"menuitem" if myClassFunction.result()==1 :
SECOND
I know, again with strings, I make efforts but I block intellectually.
My menuitem is a variable, of course. If i do as follows, it's alright
Python:
define dlgOfficeSearchJob = "Find some info for my next job"
.../...
menu choiceMyOffice:
"[dlgOfficeSearchJob]" if currentHour >= 6 and 1 == 1:
call officeWork
Now, if i want to do this, I guess I’m falling back into an interpolation worry !
Python:
define dlgOffice = {
"Work":"Find some info for my next job",
.../...
}
.../...
menu choiceMyOffice:
# tried text(...) / "%s" %... / "{}".format...
"[dlgOffice['Work']" if currentHour >= 6 and 1 == 1:
call officeWork
Last edited: