Author Dude Roast
Recipients Dude Roast, terry.reedy
Date 2019-01-26.14:52:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1548514370.87.0.460753518023.issue35833@roundup.psfhosted.org>
In-reply-to
Content
Whenever I try to use Backspace(\b) it always prints square boxes instead of deleting previous string.

Code Down:- 

import pyautogui
print("Press Ctrl+c to quit")

try:
    while True:
        x,y = pyautogui.position();
        positionStr = "X: " + str(x).rjust(4) + " Y: " + str(y).rjust(4)
        print(positionStr,end ='')
        print('\b'*len(positionStr),end='',flush=True)
        
except KeyboardInterrupt:
    print("\nDone")


O/P:- 

Press Ctrl+c to quit
X:  317 Y:  261X:  317 Y:  261X:  317 Y:  261X:  317 Y:  261X:  317 Y:  261X:  317 Y:  261X:  317 Y:  261X:  317 Y:  261X:  317 Y:  261X:  317 Y:  261X:  317 Y:  261X:  317 Y:  261X:  317 Y:  261
Done
History
Date User Action Args
2019-01-26 14:52:53Dude Roastsetrecipients: + Dude Roast, terry.reedy
2019-01-26 14:52:50Dude Roastsetmessageid: <1548514370.87.0.460753518023.issue35833@roundup.psfhosted.org>
2019-01-26 14:52:50Dude Roastlinkissue35833 messages
2019-01-26 14:52:50Dude Roastcreate