Print over Current Line in Python Shell -


i'm trying make percentage text displays progress amount i'm trying avoid percentages printing out this:

progress: 10% progress: 11% progress: 12% progress: 13%

how can erase , write on current line? iv'e tried using \r , \b characters neither seems work. every single thing found before has been either python 2 or unix i'm not sure of problem (if 1 of them) because i'm not using either. know how can python 3 running windows 7? unworking code have currently, i've tried plenty of other things.

print('progress: {}%'.format(solutions//possiblesolutions),flush=true,end="\r") 

edit:

this not problem if i'm executing program command prompt don't think problem windows. tried updating python using (3.4.1) latest v3.4.3 , issue same.

heres screenshot of problem: best can @ taking screenshot of issue. appears if each time move cursor farther left (passed 1 of progress:'s) gray area between text , cursor gets larger

edit 2: problem idle not support ascii control codes. solution: use different ide.

you can use print:

print('progress: {}%'.format(solutions),flush=true,end="\r") 

Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -