Posts

Showing posts with the label sys

Variable in list - universal user interface, sys.argv

Variable in list - universal user interface, sys.argv I would like to make class, that will be universal for user interface. I would like, to have some form of list, that I will change for another program, to achive diffrent option from user. I would like to have class variables like self.force in list, but I do not know how to use this place of list like a variable self.force but not like a argument of list (self.option_list[0][0]). This code will not work, because I don't know how to solve this problem. It schow only, how I would like to solve problem of universal interface. If you use better way to handle sys.argv I'm open to suggestions. import sys class UserInterface: def __init__(self): self.option_list = [ #[var, usr_name, def_val, choose_val] [self.force, '-f', False, True] [self.main_path, '-m', os.getcwd(), '-NEXT_ARG'] [self.send_to_Kindle_dir_name, '-s', self....