I have this code in python.
import sys list1 = [\"A\", \"B\", \"C\"] list2 = [1, 2, 3] myarg = sys.argv[1] print len(myarg)
I will run thi
Since it is possible, and thought @Lattyware's answer is the correct one, this is how you could do it:
import sys list1 = ["A", "B", "C"] list2 = [1, 2, 3] myarg = sys.argv[1] print len(globals().get(myarg, []))
If it prints 0, then you have a bad argument on the command line.
0