×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    26

    Starting exe in background

    Hi everyone,

    Is it possible to start exe in background from python? The application is not a graphical one and is just printing to standard output. Also, is it possible to redirect output to, let's say, a file?

    Thanks.

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

    Re: Starting exe in background

    You can launch them with their UID alike other applications.

    If you mean, starting Python server scripts, that can be done too - just explore e32 module.
    Pankaj Nathani
    www.croozeus.com

  3. #3
    Registered User
    Join Date
    Jun 2009
    Posts
    26

    Re: Starting exe in background

    Well, I tried launching them using e32.start_exe - successfully, but in fg. How do you launch an exe with its UID?

    These are STDEXE files by the way (a C application ported to Symbian).

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

    Re: Starting exe in background

    Quote Originally Posted by AndriusA View Post
    Well, I tried launching them using e32.start_exe - successfully, but in fg. How do you launch an exe with its UID?

    These are STDEXE files by the way (a C application ported to Symbian).
    Scriptext module: LaunchApp is used to launch an application. It takes a set of input parameters that define application ID and the options for launching the application.

    The following are the examples for using LaunchApp:

    Synchronous

    Code:
    appmanager_id = appmanager_handle.call('LaunchApp', {'ApplicationID': u's60uid://0x10005a22'})
    Asynchronous
    Code:
    appmanager_id = appmanager_handle.call('LaunchApp', {'ApplicationID': u's60uid://0x10005a22'},  callback=launch_app_callback)
    where, launch_app_callback is a user defined callback function.

    More details in the PyS60 documentation.
    Pankaj Nathani
    www.croozeus.com

  5. #5
    Registered User
    Join Date
    Jun 2009
    Posts
    26

    Re: Starting exe in background

    Hi croozeus,

    Thanks for help. I checked the LaunchApp documentation and didn't find a way to launch a standard exe (not an application). The routine exits with:

    ScriptextError: (1002, 'error executing the requested service')

    and the exe files are not listed among Applications (just in the UserInstalledPackages). Is recompiling it as an application the only solution?

    Thanks.

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

    Re: Starting exe in background

    Quote Originally Posted by AndriusA View Post
    Hi croozeus,

    Thanks for help. I checked the LaunchApp documentation and didn't find a way to launch a standard exe (not an application). The routine exits with:

    ScriptextError: (1002, 'error executing the requested service')

    and the exe files are not listed among Applications (just in the UserInstalledPackages). Is recompiling it as an application the only solution?

    Thanks.
    How did you make the exe? Using Basic Console Application (EXE) in Carbide.c++?

    Doesn't it have a UID?
    Pankaj Nathani
    www.croozeus.com

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

    Re: Starting exe in background

    I did it with Carbide.c++, choosing STDEXE as a target type. And it does have a UID, but still failes to load.

    Actually, the sis package only contains the exe file(-s) under the /sis/bin, no resource files or whatever. I don't know exactly how/where a new application/executable gets registered, so maybe this is a problem? However, I manage to run it with start_exe, so that doesn't make much sense..

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

    Re: Starting exe in background

    Strange, from my understanding it should have launched properly with scriptext.

    Quote Originally Posted by AndriusA View Post
    However, I manage to run it with start_exe
    I guess that is what you wanted!
    Pankaj Nathani
    www.croozeus.com

  9. #9
    Registered User
    Join Date
    Jun 2009
    Posts
    26

    Re: Starting exe in background

    Quote Originally Posted by croozeus View Post
    I guess that is what you wanted!
    Not really.. I need the applicaiton to be run in the background, without actually making a user aware that there is something running, while start_exe brings it to foreground and waits for a keypress when the exe has finished. Maybe there are some flags for start_exe that make it start in the background? Didn't find anything about that.

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

    Re: Starting exe in background

    Isn't your exe a server application, that has no UI?

    Anyway, e32.start_exe returns a value that describes the exit type (if you mention the wait parmeter in below syntax). Possible values are 0 for normal exit and 2 for abnormal exit.
    Code:
    start_exe(filename, command [,wait])
    Pankaj Nathani
    www.croozeus.com

  11. #11
    Registered User
    Join Date
    Jun 2009
    Posts
    26

    Re: Starting exe in background

    OK, start_exe seems to do the job as long as there is no output by the exe to stdout.. Do you know if there is a simple way to redirect the output to a log file?

    Thanks.

  12. #12
    Registered User
    Join Date
    Feb 2007
    Location
    Kyiv (Ukraine)
    Posts
    83

    Re: Starting exe in background

    Quote Originally Posted by AndriusA View Post
    Hi everyone,

    Is it possible to start exe in background from python?
    Code:
    e32.start_exe("your_program.exe", " B''")

Similar Threads

  1. Replies: 9
    Last Post: 2008-01-03, 17:28
  2. Start exe on S60_2nd
    By halimz in forum Symbian
    Replies: 5
    Last Post: 2007-04-27, 13:05
  3. Replies: 0
    Last Post: 2006-11-02, 14:13
  4. Replies: 6
    Last Post: 2006-02-20, 18:12
  5. Series 60 - Power button, and starting process in background
    By pandeya in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2004-11-01, 09:04

Posting Permissions

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