文件" ./ findCenter.py",第64行,在? print eval(sys.argv [1]) 文件"< ; string>",第0行,在? NameError:name''A''未定义 #!/ bin / bash myscript。 py ABCI tried with eval...simply usingthelist=eval(argv[1])it didn''t work :-(, I got the error messageFile "./findCenter.py", line 64, in ?print eval(sys.argv[1])File "<string>", line 0, in ?NameError: name ''A'' is not defined #!/bin/bash myscript.py A B C 问题是我想将一个或两个列表传递给脚本,所以它b / b 应该可以区分 thescript [A,B] [C,D,E] thescript [" A,B,C[D,E] thescript [A,B,C,D ;,E"]The problem is that I want to pass one or two lists to the script, so itshould be able to distinguish betweenthescript ["A","B"] ["C","D",E"]thescript ["A","B","C"] ["D",E"]thescript ["A","B","C","D",E"] 这篇关于将字符串转换为列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 06-19 15:38