When I run this script I want to add an argument in the console for the numbers of the consumers that I want to run together. For example adsconsumer.py nb=10
would mean that I will run this script 10 times simultaneously.
def main():
parser = argparse.ArgumentParser()
parser.add_argument('nb=')
nb = parser.parse_args()
for i in range(nb):
thread = Thread(target=process_consumer(), args=())
thread.start()
thread.join()
I get this error:
TypeError: 'Namespace' object cannot be interpreted as an integer