creating single-instance executables using python/py2exe

Discussion in 'Python' started by Satchidanand Haridas, Nov 11, 2005.

  1. 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
    Satchidanand Haridas, Nov 11, 2005
    #1
    1. Advertising

  2. Satchidanand Haridas enlightened us with:
    > 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?


    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
    Sybren Stuvel, Nov 11, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. chris brat
    Replies:
    1
    Views:
    635
    chris brat
    May 10, 2006
  2. Matthew K Jensen
    Replies:
    0
    Views:
    271
    Matthew K Jensen
    Aug 29, 2004
  3. Matthew K Jensen
    Replies:
    6
    Views:
    371
    Michael Geary
    Sep 5, 2004
  4. Kevin Walzer

    Single-file executables

    Kevin Walzer, Feb 11, 2006, in forum: Python
    Replies:
    13
    Views:
    6,097
    Kevin Walzer
    Feb 13, 2006
  5. oyster
    Replies:
    0
    Views:
    480
    oyster
    Oct 21, 2008
Loading...

Share This Page