×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    26

    Help with exiting python

    Hello all,
    Is there a way to exit the python shell to the main screen of the device after it does an execution for 2nd and 3rd editions?
    Thank you

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Help with exiting python

    Quote Originally Posted by eng_electric View Post
    Hello all,
    Is there a way to exit the python shell to the main screen of the device after it does an execution for 2nd and 3rd editions?
    Thank you
    hello eng_electric

    do you want to do that programatically??

    Or normally you can do it by pressing the red exit key on the device.

    If you still want to get some good replies please and again please explain your question in bit detail.

    Regards
    Gaba88

  3. #3
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,800

    Re: Help with exiting python

    Quote Originally Posted by eng_electric View Post
    Hello all,
    Is there a way to exit the python shell to the main screen of the device after it does an execution for 2nd and 3rd editions?
    Thank you
    Call the quit function when the execution finishes.

    If you mean the home screen (by main screen) of the device, you would need to simulate the red key! Beware: Simulating the red key might also terminate your application in 3r edition (Use envy extension, if needed to disable this).
    Pankaj Nathani
    www.croozeus.com

  4. #4
    Registered User
    Join Date
    Jul 2009
    Posts
    26

    Re: Help with exiting python

    @gaba88

    If there is a way to do it programatically without the user having to press any button. For example if i wanted to call it by e32.start_exe(), how would i call the .app file?

    @croozeus

    Yes, the home screen is the main screen. I did try to use red key, but it doesn't work. I tried to simulate the red key by the following:

    Code:
    from key_codes import *
    import keypress
    
    keypress.simulate_key(EKeyNo, EScancodeNo)
    it did not work, tho it did for the other simulation of keys such as right soft keypress. I did try to make it as (EKeyNo, EKeyNo) but that did not work as well. Would it be useful if i exchanged the values as their representative numbers?

    I would like to first try on the 2nd edition then on the 3rd. Thank you

  5. #5
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Help with exiting python

    Try this to simulate the red key:
    Code:
    keypress.send_raw_event(keypress.EKeyDown,EScancodeNo)
    keypress.send_raw_event(keypress.EKeyUp,EScancodeNo)

  6. #6
    Registered User
    Join Date
    Jul 2009
    Posts
    26

    Re: Help with exiting python

    @bogdan.galiceanu

    the raw event is for 3rd edition right? because i tried it on the second edition and i get an error.

    says
    keypress.send_raw_event(keypress.EKeyDown, EScancodeNo) attributeError: 'module' object has no attribute 'send_raw_event'

    This is the code am trying to simply test on
    Code:
    import keypress
    from key_codes import *
    print "Hello"
    I tried the suggested
    Code:
    keypress.send_raw_event(keypress.EKeyDown,EScancodeNo)
    keypress.send_raw_event(keypress.EKeyUp,EScancodeNo)
    which gave the error above. I have installed all the required. Different key simulations works fine except the red key.

    BTW, for 2nd edition phones I'm using keypress V.1.02, Should i use a newer version?
    Last edited by eng_electric; 2009-07-23 at 16:45.

  7. #7
    Registered User
    Join Date
    Jul 2009
    Posts
    26

    Re: Help with exiting python

    Hello all again,
    I was trying the menu key and found it out dont work for me. I'm testing it on nokia 7610 and the code is:

    Code:
    from key_codes import *
    import keypress, e32
    
    keypress.simulate_key(EKeyMenu,EScancodeMenu)
    e32.ao_sleep(1)
    Does it work on higher second editions? can someone who have FP1 2nd edition confirm this. Thank you

Similar Threads

  1. Python for S60 1.9.5 is now released
    By tvijayan in forum Symbian
    Replies: 8
    Last Post: 2009-05-30, 05:33
  2. Python for S60 1.9.4 is now released
    By tvijayan in forum Symbian
    Replies: 9
    Last Post: 2009-05-27, 10:39
  3. Python for S60 1.9.3 released
    By tvijayan in forum Symbian
    Replies: 40
    Last Post: 2009-04-03, 15:00
  4. Python for S60 1.9.0 released
    By tvijayan in forum Symbian
    Replies: 48
    Last Post: 2009-01-27, 15:39
  5. exiting applications without exiting python?
    By cassioli in forum Symbian
    Replies: 6
    Last Post: 2008-08-28, 12:19

Posting Permissions

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