{ Snipperize } /console
Snippets about console
Console Make Text Color and Bold
no comment
Python / console, color, bold / by ThePeppersStudio (155 days, 9.87 hours ago)
制作Shell下面的进度条
和apt / yum的进度条一样~ 原理都是用 “\b” 退格来完成
Python / console, progress bar, 进度条, shell / by ThePeppersStudio (397 days, 16.49 hours ago)
Network TCP backend for console access
Python / console, debug, interpreter, network, server side, SocketServer, TCPServer / by ThePeppersStudio (408 days, 10.65 hours ago)
Console (text) progress indicator class
Programs that run (FTP downloads, database insertions, etc.) sometimes require visual feedback to the user as to the progress of the task that is running. This progress bar class provides an easy to implement way of showing the percentage of completion that is updated periodically by the program. I was finding that I needed a progress indicator for Linux and Windows console applications that could be used to show the user that work was progressing and how much of the total work that had been completed. I finally broke down and wrote this class that seems to do exactly what I wanted. Since I continue to see questions about how to write such a class on Comp.Lang.Python, I thought I'd donate it to this Cookbook archive.
Python / console, progress bar / by ThePeppersStudio (420 days, 13.01 hours ago)
Creating a Progress Bar in Console
The follwing class can be used to add a progress bar to your console/text based applications. Add the following to a file called 'progress_bar.py' and import it into your application: And this would look like: [ ##################################### ] 67% Note: I find that adding sys.stdout.flush() keeps the output a bit cleaner sometimes. Also not that this is just an example, you wouldn't want to print the bar every single iteration unless its changed.
Python / console, progress bar / by ThePeppersStudio (420 days, 13.06 hours ago)
function to download a given URL with a console progress meter
Download a given URL with a console progress meter. The key function is sys.stdout.isatty() and sys.stdout.write("%-66s%3d%%" % (base, percent))
Python / console, download / by ThePeppersStudio (429 days, 17.57 hours ago)
- 1
- Home
- New Snippet
- Languages
-

