0

I notice an annoying occurrence when printing logs to the console during a tqdm-wrapped loop. In that case, the logs begin in the same line as the tqdm printouts right after them.

I figure that I can prepend "\r" to all logs, but I'd rather just find out if the cursor is currently at the start of the line or not. Does python expose that information?

Thanks.

EZLearner
  • 1,614
  • 16
  • 25
  • There is related (actually, reverse) problem here https://stackoverflow.com/questions/41707229/tqdm-printing-to-newline Also this answer https://stackoverflow.com/questions/35526014/how-can-i-get-the-cursors-position-in-an-ansi-terminal use interaction with terminal (sys.stdin reading) to get the cursor position I'd post this links as comment, but I have no rating to do this – dkotenko Sep 13 '21 at 12:04
  • @dkotenko Thank you, but that I know and doesn't help me. – EZLearner Sep 14 '21 at 15:47

0 Answers0