-2
는 main.py :사용 변수
는import sys
sys.path.append('Pygame Projects')
import sub
from sub import *
loop = True
while loop:
print_hello()
true_the_another_loop()
while anotherLoop:
print_world()
sub.py는 : 내가 main.py를 실행하면
def true_the_another_loop():
loop = False
anotherLoop = True
def print_hello():
print "hello"
def print_world():
print "world"
, 그것은 단지 "hello"
인쇄합니다. "world"
이 인쇄되지 않는 이유는 무엇입니까?
true_the_another_loop()
에서 loop = Flase
은 작동하지 않는 것 같습니다.
반환 값을 목록에 넣지 않아도됩니다. –