I have a loop in python, and I would like to report the value of a variable every time it is updated, but I do not want to dirty the console giving print every time < the console .
Is there a way for me to get this result?
print("Executando processo:")
while True:
a = a +1
print a
The result at the end of 3 interactions is:
Interaction 1:
$ - Executando processo:
$ - 1
Interaction 2:
$ - Executando processo:
$ - 1
$ - 2
Interaction 3:
$ - Executando processo:
$ - 1
$ - 2
$ - 3
And I would like to get the following result:
Interaction 1:
$ - Executando processo:
$ - 1
Interaction 2:
$ - Executando processo:
$ - 2
Interaction 3:
$ - Executando processo:
$ - 3