简体   繁体   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

this is my code : 这是我的代码:

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'''

Note : im chakeing number of threads in my condition 注意:在我的情况下我正在扼杀线程数

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