creating single-instance executables using python/py2exe

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Satchidanand Haridas

    #1

    creating single-instance executables using python/py2exe

    Hi,

    I have created an application using python/wxPython and py2exe. I have
    associated a certain file extension with this application so that when I
    double-click the file, my application is launched. The application runs
    fine except that a new instance is created when I double click on two
    different files. Is there a way in which I can make sure only one
    instance is created? Any additional files are opened in the same running
    instance? Would appreciate any comments/feedback.

    thanks,
    Satchit

    --
    ----
    Satchidanand Haridas (sharidas at zeomega dot com)

    ZeOmega (www.zeomega.com)
    Open Minds' Open Solutions

  • Sybren Stuvel

    #2
    Re: creating single-instance executables using python/py2exe

    Satchidanand Haridas enlightened us with:[color=blue]
    > a new instance is created when I double click on two different
    > files. Is there a way in which I can make sure only one instance is
    > created?[/color]

    You could open a listening socket to listen for "open file" commands.
    If opening that socket fails (address already in use), connect a
    client socket to it, send the appropriate "open file" command, and
    exit.

    That way, you even have a cross-platform solution.

    Sybren
    --
    The problem with the world is stupidity. Not saying there should be a
    capital punishment for stupidity, but why don't we just take the
    safety labels off of everything and let the problem solve itself?
    Frank Zappa

    Comment

    Working...