|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
printing lines in order
i have been trying to run a small PyQt script that will check certain files. i want to update the status bar on the Qt gui and then call the Verify() function from another class.
however, with the code below, it is running through the Verify() function and then updating the staus bar. is there some way i can make sure that the message is printed before running the Verify() function? def runVerifier(self): #run the verifier script w.statusBar().message( "Running Verifier...", 2000 ) verifier.Verify() self.refreshLog() |
|
#2
|
||||
|
||||
|
Quote:
Umm...update() in between w.statusBar... and verifier? |
|
#3
|
|||
|
|||
|
same problem, differnet scenario
using update() didn't work, thanks anyway
i have found another piece of code which is doing the same thing with the line order: logFile.write("\012(" + self.time + ") Starting script...\012") #write any changes to the log file self.checkFileChanges() the script always goes through and prints the output of checkFileChanges() to the log file before it prints the line about starting the script. i can't figure out why this would happen at all. is this a defect in the language or am i missing something really simple? |
|
#4
|
|||
|
|||
|
I have found a solution to the problem described in my previous post, although i don't htink it is the way thiat it should be done properly. the way i have got around python not printing the lines i want in the order i want, i have had to open and close the fog file for each line i want to write:
logFile = open('/path/to/log_file', "a") logFile.write("\012(" + self.time + ") Starting script...\012") logFile.close() #write any changes to the log file self.checkFileChanges() there must be a better than opening and closing the same file for possibly thousands of times in the same script, but i haven't figured it out yet this also doesn't solve my first problem |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > printing lines in order |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|