Nov-12-2020, 12:29 AM
hello I have the following in a threaded function executes several at the same time
profit is global variable
profit += result
profit = round (profit, 2)
and there is no way to get it when you run 2 simultaneous error
python TypeError: unsupported operand type (s) for +: 'int' and 'NoneType'
what can I do
if profit is None:
profit = 0
did not solve my problem, the profit variable is profit = 0 before the function and does not work if it is not simultaneous, only 2 theads calling the function there of the error
profit is global variable
profit += result
profit = round (profit, 2)
and there is no way to get it when you run 2 simultaneous error
python TypeError: unsupported operand type (s) for +: 'int' and 'NoneType'
what can I do
if profit is None:
profit = 0
did not solve my problem, the profit variable is profit = 0 before the function and does not work if it is not simultaneous, only 2 theads calling the function there of the error