Assume that the command line option will positively be the name of a dictionary in a Python 3 script. Is there a more pythonic way of replacing all the facacta if-elsif lines in the script with something really cool?
The command:
$ prog.py a
The script:
#!/usr/bin/evn python3
a = {'x' : '1', 'y' : '2'}
b = {'x' : '3', 'y' : '4'}
# and so on ..
nth = {'x' : '1000', 'y' : '2000'}
# and on ..
if __name__ == "__main__":
z = dict()
# There has got to be a better way
if sys.argv[1] == 'a':
z.copy(a)
elif sys.argv[1] == 'b':
z.copy(b)
# and so on ...
elif sys.argv[1] == 'nth':
z.copy(nth)
# and on ...