May-02-2023, 01:28 AM
(This post was last modified: May-02-2023, 01:28 AM by billykid999.)
I read online the command list in windows reads everything in as a string.
So I changed my __name__ == __main__ to below and it works, as I had to sstrip and split the argument into a list and map it back to a dictionary which stored functions.
I'm sure there's ways to make the code more precise, maybe using a map function, but it is working now.
So I changed my __name__ == __main__ to below and it works, as I had to sstrip and split the argument into a list and map it back to a dictionary which stored functions.
I'm sure there's ways to make the code more precise, maybe using a map function, but it is working now.
functions = {'Hardware': Hardware} if __name__ == "__main__": from Connect_Handler import Hardware from Connect_Handler import Connect inlist = sys.argv[1] outlist = inlist.strip("[]").split(",") inlist = [] Connector = Connect() for i in outlist: inlist.append(functions[i]) Connector.connect_parser(inlist)