I am writing a simple ftp downloader. Part of to the code is something like this:
ftp.retrbinary("RETR " + file_name, process)
i am calling function process to handle the callback:
def process(data):
print os.path.getsize(file_name)/1024, 'KB / ', size, 'KB downloaded!'
file.write(data)
and output is something like this:
1784 KB / KB 1829 downloaded!
1788 KB / KB 1829 downloaded!
etc...
but i want it to print this line and next time reprint/refresh it so it will only show it once and i will see progress of that download...
How can it be done?
Have a look at the curses module documentation and the curses module HOWTO.
Really basic example: