×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Dec 2006
    Posts
    34

    How to minimize python app?

    I basically have a python script that should run in the background. Right now, when I launch the application made with py2sis I get a white screen with options and exit. Pressing the red key on the N70 closes the application so I am left with the menu key. Now... the problem is that the signal strength, network type, battery power indicators and the clock(!) dissapear when I return on the homescreen.

    Is there any way to make my python application stay in the background from the beginning? And if possible, can I autostart with OS?

    Thank you!

  2. #2
    Registered User
    Join Date
    Feb 2006
    Location
    Helsinki, Finland
    Posts
    168

    Re: How to minimize python app?

    I think the app doesnt get closed when you press the red key, it still remains in the process list in fexplorer. It looks like its closed because the built in task manager doesnt display it .

    the signal strength, network type, battery power indicators and the clock(!) dissapear when I return on the homescreen
    I dont know why that happens .

    Anyway you could use the appswitch module to put the app in the background.
    Nokia E66
    PyS60 1.4.4 final

  3. #3
    Registered User
    Join Date
    Dec 2006
    Posts
    34

    Re: How to minimize python app?

    The red key closes apps on the N70.

    Can you please give me more details about how to use appswitch?

  4. #4
    Registered User
    Join Date
    Feb 2006
    Location
    Helsinki, Finland
    Posts
    168

    Re: How to minimize python app?

    OK.
    First you need to download it from here http://pymbian.sourceforge.net/misc/...0.20051019.zip.

    Then you could use it like this:
    Code:
    import appswitch
    appswitch.switch_to_bg("Python") //if your app is a standalone app you need to   use the name of the app instead of "Python"
    Nokia E66
    PyS60 1.4.4 final

  5. #5
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Re: How to minimize python app?

    Quote Originally Posted by RICH?
    OK.
    First you need to download it from here http://pymbian.sourceforge.net/misc/...0.20051019.zip.

    Then you could use it like this:
    Code:
    import appswitch
    appswitch.switch_to_bg("Python") //if your app is a standalone app you need to   use the name of the app instead of "Python"
    Hey Richards don't fool the beginners
    You must use unicode string for app name !!! but case is not important (lower or upper)
    Your example return 0 (false) and does nothing !
    so here's the right example (I try this code myself !)

    Code:
    # list of ALL active tasks even hidden
    appswitch.application_list(1)
    
    # list of ALL active tasks except hidden
    appswitch.application_list(0)
    
    # kill task by name
    appswitch.kill_app(u"Python")
    
    # switch task to background 
    appswitch.switch_to_bg(u"Python")
    
    # switch task to foreground 
    appswitch.switch_to_fg(u"Telephone") # could be u"Phone" perhaps ??
    Regards Cyke64
    pys60 1.4.5 and 2.0.0, pygame, PyS60 CE on E90 and 5800 !

    Find my pys60 extension modules on cyke64.googlepages.com

  6. #6
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Re: How to minimize python app?

    to fightersoft ,

    The indicator disappearing is a well known bug !

    Here's a workaround
    Code:
    # Thanks a lot to Simo :) 
    
    start the mainloop with following code:
    e32.ao_sleep(0, app.mainloop)
    pys60 1.4.5 and 2.0.0, pygame, PyS60 CE on E90 and 5800 !

    Find my pys60 extension modules on cyke64.googlepages.com

  7. #7
    Registered User
    Join Date
    Feb 2006
    Location
    Helsinki, Finland
    Posts
    168

    Re: How to minimize python app?

    Sorry I was wondering about that...
    I've done it before but while posting, couldn't quite remember it.
    Ah well, good that you spotted it.
    Nokia E66
    PyS60 1.4.4 final

  8. #8
    Registered User
    Join Date
    Dec 2006
    Posts
    34

    Re: How to minimize python app?

    Thanks guys for all of your tips. I will try them soon (I just got back from the new year's party). I will post back with the results.

  9. #9
    Registered User
    Join Date
    Dec 2006
    Posts
    34

    Re: How to minimize python app?

    Yep, everything works perfectly. Thank you!

  10. #10
    Registered User
    Join Date
    Feb 2006
    Location
    Helsinki, Finland
    Posts
    168

    Re: How to minimize python app?

    Congratulations fightersoft!
    Happy to help .
    Nokia E66
    PyS60 1.4.4 final

Similar Threads

  1. Replies: 3
    Last Post: 2010-03-19, 16:46
  2. Reminder of Python app gallery URL
    By slitchfield in forum Symbian
    Replies: 0
    Last Post: 2006-02-14, 08:55
  3. Embedding python in an app
    By varunc in forum Symbian
    Replies: 1
    Last Post: 2005-12-03, 07:01
  4. Python from C++ app.
    By micmen in forum Symbian
    Replies: 4
    Last Post: 2005-06-09, 12:01
  5. bt_gps & gsm_loc simple python app
    By lda2000 in forum Symbian
    Replies: 2
    Last Post: 2005-01-18, 10:29

Posting Permissions

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