SunQuest
           Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old February 18th, 2004, 10:19 AM
mattcronin57 mattcronin57 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 12 mattcronin57 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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()

Reply With Quote
  #2  
Old February 18th, 2004, 02:58 PM
idologic_aw's Avatar
idologic_aw idologic_aw is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: London, ON, Canada, eh
Posts: 127 idologic_aw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 11 m 42 sec
Reputation Power: 5
Quote:
Originally Posted by mattcronin57
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()


Umm...update() in between w.statusBar... and verifier?

Reply With Quote
  #3  
Old February 20th, 2004, 05:09 PM
mattcronin57 mattcronin57 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 12 mattcronin57 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #4  
Old February 21st, 2004, 06:02 AM
mattcronin57 mattcronin57 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 12 mattcronin57 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > printing lines in order


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway