This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author minaki_2525
Recipients minaki_2525
Date 2021-03-02.10:43:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1614681829.93.0.791098465255.issue43365@roundup.psfhosted.org>
In-reply-to
Content
"""The following code can be run after commenting sleep, otherwise the file will always be empty"""

import time

file=open("data.txt","a+")
flag=0
while True:
    time.sleep(0.00001)
    if flag%2==0:
        flag=False
        file.write("test111+\n")
        print("add over")
    else:
        flag=True
        file.write("test222+\n")
        print("add over2")
    flag+=1
History
Date User Action Args
2021-03-05 22:43:20terry.reedyunlinkissue43365 messages
2021-03-02 10:43:49minaki_2525setrecipients: + minaki_2525
2021-03-02 10:43:49minaki_2525setmessageid: <1614681829.93.0.791098465255.issue43365@roundup.psfhosted.org>
2021-03-02 10:43:49minaki_2525linkissue43365 messages
2021-03-02 10:43:49minaki_2525create