Answers for "python command line option text"

0

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'>)
Posted by: Guest on November-19-2020

Code answers related to "python command line option text"

Python Answers by Framework

Browse Popular Code Answers by Language