I consider myself an idiot. I have practically zero Python experience but did code a bit back at uni.
While trying to run example.py as instructed with a config file as an argument, I would always get:
config_file = sys.argv.get[1] if len(sys.argv) > 1 else 'config.ini'
^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'get'
From my understanding of the error and a quick google-fu, you just need sys.argv[1]. I modified the line to:
config_file = sys.argv[1] if len(sys.argv) > 1 else 'config.ini'
and now it works properly, using the entered config file
Posting this so if anyone else like me ends up with the error can make the module work, and if I am wrong I can be told where I am messing up!
Howdy,
I consider myself an idiot. I have practically zero Python experience but did code a bit back at uni.
While trying to run example.py as instructed with a config file as an argument, I would always get: config_file = sys.argv.get[1] if len(sys.argv) > 1 else 'config.ini' ^^^^^^^^^^^^ AttributeError: 'list' object has no attribute 'get'
From my understanding of the error and a quick google-fu, you just need sys.argv[1]. I modified the line to: config_file = sys.argv[1] if len(sys.argv) > 1 else 'config.ini' and now it works properly, using the entered config file
Posting this so if anyone else like me ends up with the error can make the module work, and if I am wrong I can be told where I am messing up!
Thanks