This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
While True is True :
donnieh last edited by
Is it bad practice to use a forever loop in pythonista? I ask because I used the
def download_filefunction from the omz dropbox file picker script in my own script. It worked great except once my program completed it's start up code and entered the while loop, I had issues with the downloaded file.
If I downloaded a file using omz's DropBox script in the while loop and then tried to read it using
f = open('file_name')outside the while loop, it would not read or see the file. Can I only read the file in the same scope I downloaded it? I could open it inside the while loop, however.
ccc last edited by
The trick is that you have to have a
sys.exit()or similar somewhere in that loop or your device is going to churn until its batteries run out. Computers are still very literal.
while True:is sufficient to start an infinite loop.