how to get list of all arguments python code example
Example 1: how to take list as command line arguments in python
>>> input = "[2,3,4,5]"
>>> map(float, input.strip('[]').split(','))
[2.0, 3.0, 4.0, 5.0]
>>> A = map(float, input.strip('[]').split(','))
>>> print(A, type(A))
([2.0, 3.0, 4.0, 5.0], <type 'list'>)
Example 2: python get names of input arguments
def a_method(arg1, arg2):
pass
>>> inspect.getfullargspec(a_method)
(['arg1', 'arg2'], None, None, None)