×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    2

    Status window ??

    As a Python newbie , I hope not to ask too silly a question ....

    Is there a function in the Series 60 python libraries which performs the equivalent function to the 'busy' or 'statwinfo' functions in Psion OPL . These commands displayed a quick text note which was displayed in the corner of the screen and flashed for a fixed period of time , the idea being that if a process was taking some time to complete you could show a few busy notes to indicate that progress was being made .

    A sort routine might include the statement ;

    busy("Sorting item"+num$(sortcount%))

    inside the sort loop .

    I have a python script which calculates the cooking power of a microwave which needs to count for 60 seconds , and it would be nice to show a progress count every five seconds or so . I tried using print statements every five seconds , but this causes a lot of other text to flash past as well as my message . I tried using the information dialogs but this appears to cause the script to pause until the message is dismissed , or 5-10 seconds have elapsed , not very good for a timing loop .

    Hoping someone has some ideas ...

  2. #2
    Registered User
    Join Date
    May 2005
    Posts
    10

    Re: Status window ??

    Originally posted by mkstevo

    ...it would be nice to show a progress count every five seconds or so . I tried using print statements every five seconds , but this causes a lot of other text to flash past as well as my message.
    Hi,

    I'm not sure what you want, but in python you can add to a line on the screen (rather that add a newline) and use backspaces, etc. using the sys.stdout.write() command. Something like this, I guess.

    Code:
    import sys
    import time
    
    sys.stdout.write(u"Countdown: ")
        
    i = 20
    
    while i:
        sys.stdout.write(`i`)
        time.sleep(1)
        if i > 10:
            sys.stdout.write('\b\b')
        elif i == 10:
            sys.stdout.write('\b\b ')
        else:
            sys.stdout.write('\b')
        i -= 1
    (Although I'm sure you could do better)

    M.

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    2

    Re: Re: Status window ??

    Originally posted by lvngt5gj9
    Hi,

    I'm not sure what you want, but in python you can add to a line on the screen (rather that add a newline)
    Thanks , I'll try that and see if it is any tidier than my original attempt .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •