For example, I want to run this code in a python file titled "file1"
print("HI")
import file2
which would then call "file2"
print("Hello")
import file1
How would I continue this loop without ending??
I would do it like this:
file.py
import file2
while True:
print('Hi')
file2.hello()
file2.py
def hello():
print('Hello')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.