import math,sys,time;i=0
while 1: sys.stdout.write("\r"+':(__)'[:3+int(round(math.sin(i)))]+'n'+':(__)'[3+int(round(math.sin(i))):]);sys.stdout.flush();time.sleep(.15);i+=0.5*math.pi
I wrote that simple program in Python 2 a long time ago and it worked fine but it has syntax errors in Python 3. I would greatly appreciate if someone could help me update it to be Python 3 compliant. Thanks.
I pasted your code in a file, saved it, then opened it in a Python shell:
Notice the
'\xe2\x80\x8b'bytes sprinkled here and there. These areZERO WIDTH SPACEcharacters encoded in utf-8:This is why your code is giving rise to SyntaxErrors.
Just retype it (or copy the code below) and it will run in Python3: