sudo는 파이썬은 위에서 255,255,0변수
who = sys.argv[1]
print sys.argv[1]
print who
print 'Number of arguments:', len(sys.argv), 'arguments.'
print 'Argument List:', str(sys.argv)
yanon(strip, Color(who))
출력
255,255,0
255,255,0
Number of arguments: 2 arguments.
Argument List: ['yantest.py', '255,255,0']
Traceback (most recent call last):
File "yantest.py", line 46, in <module>
yanon(strip, Color(who))
TypeError: Color() takes at least 3 arguments (1 given)
Segmentation fault
나는 색상 함수 내에서 변수를 ""어떻게 사용합니까
입니다 yantest.py ?
Ive는 ('who'), ("who") 어느 쪽이도 노력하지 않았습니다.
우리는'Color'가 무엇인지 알지 못합니다. 그러나 오류에 따라 3 개의 argent를 기대하지만, 단지 하나만 전달하면됩니다 :'who' –
who = 255,255,0 3 개의 인자가 필요합니다. 색깔 (누가) doesnt는 변수의 내용으로 변환하는 것 같습니다. – jointtech
아니요, 실제로'who == "255,255,0"'그러나 내 의견을 실제로 언급하지 않습니다 –