Difference between revisions of "TruxtonOptions"
Jump to navigation
Jump to search
(→Sample) |
(→Sample) |
||
| Line 13: | Line 13: | ||
=Sample= | =Sample= | ||
| − | <source lang="Python" highlight=" | + | <source lang="Python" highlight="6,8-10"> |
| + | import sys | ||
| + | sys.path.append('C:/Program Files/Truxton/SDK') | ||
import truxton | import truxton | ||
Revision as of 10:55, 9 February 2021
This class gives you access to configuration variables.
Methods
getbool(name)
This will retrieve a boolean setting from Truxton based on its name.
getinteger(name)
This will retrieve an integer setting from Truxton based on its name.
getstring(name)
This will retrieve a string setting from Truxton based on its name.
Sample
import sys
sys.path.append('C:/Program Files/Truxton/SDK')
import truxton
def main():
options = truxton.options()
print( "CreateTheDatabase: " + str(options.getbool("CreateTheDatabase")))
print( "dbport: " + str(options.getinteger("dbport")))
print( "dbname: " + str(options.getstring("dbname")))
if __name__ == "__main__":
main()