creating single-instance executables using python/py2exe

  • Thread starter Satchidanand Haridas
  • Start date
S

Satchidanand Haridas

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

--
 
S

Sybren Stuvel

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top