| | |
(text) summary screen during large data conversion
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: May 2008
Posts: 8
Reputation:
Solved Threads: 0
Hello,
I have a certain way i want to do something but im not sure where to start, or if python can even do it.
what i want is a way to display the current action during a large data conversion program.... I want it to look like an GUI installer but have it be text based. let me demonstate......
(imaginary screen)
__________________________________
| step 1: working
| step 2: not started
| step 3: not started
| step 4: not started
| step 5: not started
|
| currently: doing sub step a of step 1
|
|
|
| queries run: 12345
-----------------------------------
then lets say 45 minutes later....
__________________________________
| step 1: done; no errors, no warnings
| step 2: done; no errors, no warnings
| step 3: done; no errors, no warnings
| step 4: working
| step 5: not started
|
| currently: doing sub step d of step 4
|
|
|
| queries run: 987654
-----------------------------------
but i want that without the screen scrolling.
in progress, thats an easy thing to do, but what about python? if not, i can just have it output to a html file every 5 seconds or so or something and just refresh my browser when i want an update.
sys.stdout.write a good place to start?
I have a certain way i want to do something but im not sure where to start, or if python can even do it.
what i want is a way to display the current action during a large data conversion program.... I want it to look like an GUI installer but have it be text based. let me demonstate......
(imaginary screen)
__________________________________
| step 1: working
| step 2: not started
| step 3: not started
| step 4: not started
| step 5: not started
|
| currently: doing sub step a of step 1
|
|
|
| queries run: 12345
-----------------------------------
then lets say 45 minutes later....
__________________________________
| step 1: done; no errors, no warnings
| step 2: done; no errors, no warnings
| step 3: done; no errors, no warnings
| step 4: working
| step 5: not started
|
| currently: doing sub step d of step 4
|
|
|
| queries run: 987654
-----------------------------------
but i want that without the screen scrolling.
in progress, thats an easy thing to do, but what about python? if not, i can just have it output to a html file every 5 seconds or so or something and just refresh my browser when i want an update.
sys.stdout.write a good place to start?
What operating system are you using? If MS Windows, you can use
* as "cls" is a program on Windows that does this, if someone were to put a program named "cls" into the same folder that this script was run out of, then Windows would execute that program rather than the native "cls". Hence, very large security issues. (Thanks to Siddhant Sanyam for bringing that to light.)
P.S.
os.system('cls') to clear the console window before reprinting the progress display. Yes, yes, I know that clearing the screen isn't good because a) this won't work on Mac or GNU/Linux, b) it may cause users to lose any important data they had in the console before running your script, and c) it introduces security issues into your program *. This is what you're looking for though, right? So I guess we can make an exception for clearing the screen in this case...* as "cls" is a program on Windows that does this, if someone were to put a program named "cls" into the same folder that this script was run out of, then Windows would execute that program rather than the native "cls". Hence, very large security issues. (Thanks to Siddhant Sanyam for bringing that to light.)
P.S.
sys.stdout.write is only an output stream, much like the print expression. Although, sys.stdout.write will not put a newline after each call like print, and if you call print "somethinghere", with that comma after, it won't put a newline but it will put one space. Last edited by shadwickman; Jul 1st, 2009 at 11:19 pm.
"Two good old boys in a fire-apple red convertible. Stoned. Ripped. Twisted. Good people."
- Hunter S. Thompson
my photography
- Hunter S. Thompson
my photography
That is a better option. And this way you can achieve a nicer output without having to resort to GUI programming. Good luck!
"Two good old boys in a fire-apple red convertible. Stoned. Ripped. Twisted. Good people."
- Hunter S. Thompson
my photography
- Hunter S. Thompson
my photography
![]() |
Similar Threads
- Data Entry (Tech / IT Consultant Job Offers)
- how to transfer large data to one page to another page (ASP.NET)
- Random Crashing followed by a blue screen- Kernel Data Error and Hardrive Failure (Troubleshooting Dead Machines)
- text to data conversion (Visual Basic 4 / 5 / 6)
- Script stores data in wrong MySQL columns (MySQL)
Other Threads in the Python Forum
- Previous Thread: Python and the internet
- Next Thread: wxPython Error
| Thread Tools | Search this Thread |
Tag cloud for Python
ansi assignment avogadro backend beginner binary bluetooth character cmd code customdialog data decimals dictionary drive dynamic error examples excel exe file float format ftp function gnu graphics gui heads homework http ideas import input java leftmouse line linux list lists logging loop module mouse newb number numbers output parsing path pointer port prime program programming progressbar projects push py2exe pygame pyqt python random recursion recursive refresh schedule screensaverloopinactive script scrolledtext sqlite ssh statistics stdout string strings sudokusolver sum table terminal text thread threading time tkinter tlapse tricks tuple tutorial ubuntu unicode update urllib urllib2 variable wikipedia windows write wxpython xlib





