簡體   English   中英

python文件逐行讀取並檢查條件,如果不正確,請等到其正確而不跳過該行

[英]python file reading line by line and check for condition and if it's not true wait until its true without skipping the line

這是我的代碼:

for line in file :
    if(something== something):
        '''do something''' .
    else:
        '''dont skip the line and wait until condition is true then skip to 
           next line'''

注意:在我的情況下我正在扼殺線程數

for line in file :
    while True:
        if(something== something):
            '''do something'''
            break

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM