Answer the question
In order to leave comments, you need to log in
Why doesn't if see the word?
with Popen([sys.executable, '-u', 'executer/__main__.py', f'{address} {filename}'],
stdout=PIPE, universal_newlines=True) as process:
for line in process.stdout:
print(line)
if line == 'stock':
return
Answer the question
In order to leave comments, you need to log in
Most likely at the end of the line "stuck" the transfer of the correction. A simple solution might be str.rstrip():
# if line == 'stock': # Убрать
if line.rstrip() == 'stock': # Добавить
# print(line) # убрать
print(">%s<" % line) # добавить
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question