조건문을 실행 한 후 프로그래밍 방식으로 파이썬 스크립트를 어떻게 중지합니까?조건문 실행 후 프로그래밍 방식으로 python 스크립트 실행을 중지합니다.
for row in rows:
if row.FIRSTDATE == row.SECONDDATE:
pass
else:
print "FIRSTDATE does not match SECONDDATE " + row.UNIQUEID
## If I set my quit sequence at the this tab level, it quits after the first
## unmatched record is found. I don't want that, I want it to quit after all the
## unmatched records have been found, if any. if all records match, I want the
## script to continue and not quit
sys.quit("Ending Script")
감사합니다, 마이크 내가 이런 식으로 할 것 제대로
doQuit = 0
for row in rows:
if row.FIRSTDATE != row.SECONDDATE:
print "FIRSTDATE does not match SECONDDATE " + row.UNIQUEID
doQuit = 1
if doQuit: sys.exit()
체크하면 첫 번째의 포인트는 무엇인가? –