I have an issue where I wish to get rid of some print, but it's ignored entirely and several lines are printed out. I have always used \r
for these solutions. Is there a way round this scenario? (I'm using Mac OS for now, but guaranteed, will switch over to Windows soon.) @Feodoran told me that the \r
only really works for Linux computers, which is an issue. The code for this is:
print ('virus_prevention.fix.virus.|attempt_enter')
time.sleep(2)
for i in range(1):
sys.stdout.write(str(i)+'\r')
print ('virus_prevention.fix.virus|.attempt_enter')
time.sleep(0.1)
for i in range(1):
sys.stdout.write(str(i)+'\r')
And the output is the following:
virus_prevention.fix.virus.|attempt_enter
0
virus_prevention.fix.virus|.attempt_enter
0
I've tried sys.stdout.write
rather than print
but nothing seems to have changed. I'm not sure what to do in this situation, but if anyone could give me some tips please do. It's deleting the printed line which entirely does NOT work.