I have a python class and a main function next to it so I can execute it from command line. My init function deals my provided arguments:
import argparse
class Tester:
def __init__(self):
self.args_parser = argparse.ArgumentParser(description='Test')
self.args = self.__parse_parameters()
...
if __name__ == "__main__":
tester = Tester()
This way, when I execute the above file from command line, for example:
#python teser.py --test eating --lowcarb
I can provide the parameters and they will eventually get passed to __parse_parameters function. All good.
My question is, how can I pass these parameters to the class if I decide to use this class from python code?