简体   繁体   中英

How can i print tqdm progress bar on sameline?

I am trying to put a progress bar in my for loop but the progress bar is shifted to next line after each iteration. How can i put it in a single line? I am using eclipse and the code is below:

from selenium import webdriver
import time
import os
import datetime
from tqdm import trange


i=0
for i in trange(b):
    day = driver.find_elements_by_xpath('//*[@id="aaaaa"]/div/table[2]/tbody/tr/td[@style="background-color: rgb(204, 204, 0); color: rgb(128, 0, 0);"]')
    day[i].click()

    time.sleep(2)

    download = driver.find_element_by_xpath('//*[@id="content1"]/div/div[4]/div/div/table/tbody/tr[2]/td[2]/a[2]')
    download.click()

    driver.get('https://npp.gov.in/dgrReports') 

    pre_month = driver.find_element_by_xpath('//*[@id="aaaaa"]/div/table[1]/tbody/tr/td[1]')
    pre_month.click()    


The issue is with Eclipse console. These steps worked for me:

In Eclipse,

  • Go to Window -> Preferences .
  • Expand Run/Debug , and select Console .
  • On the right, enable Interpret ASCII control characters .

启用了解释 ASCII 控制字符选项的 Eclipse 控制台首选项

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM