Найти - Пользователи
Полная версия: Выход из while по условию
Начало » Python для новичков » Выход из while по условию
1 2 3
sp3
с отступами беда, да и а неопределенно.
EBFE
raw_input('<<<').lower() == "close"
=>
>>> print("input:", raw_input('<<<').lower())
<<<close
('input:', 'close\r')

import Queue
import threading
quit_flag = Queue.Queue()
def thr_input():
    while quit_flag.empty():
        if raw_input('<<<<').lower().startswith('close'):
            quit_flag.put_nowait(True)
threading.Thread(target=thr_input).start()
a = 0
while quit_flag.empty():
    a = a + 1
    print a
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB