У меня есть, что нужно записывать данные в файле и все еще делать другие вещи. Код ниже. < /p>
Что я делаю неправильно? < /p>
# Main program...
...
# Def for record data
def inicia_thread():
# Record all data cars from IT system to text file
record.RecordDataCar()
# Record PLA and MEB record data to text file
if (data_qr1 != img_data_qr1) and (data_qr2 != img_data_qr2) and (data_qr1 != 0) and (data_qr2 != 0):
if data_vis != '0':
data_meb = date_now + ' PLA >> ' + data_pla + ' VIS >> ' + data_vis + \
' Badge >> ' + str(data_badge) + \
' >> QR1 ' + str(data_qr1) + \
' >> QR2 ' + str(data_qr2)
print(data_meb)
# Record PLA data to text file
record.RecordData(file_name='historico_PLA', data=data_meb)
threading.Thread(target=inicia_thread()).start()
``
Подробнее здесь: https://stackoverflow.com/questions/793 ... all-thread