Can somebody point me to information to build a programm that behaves
like most text editors.
python nameOfProgram.py sampleFile.txt
=> Program start with sampleFile opend OR
if programm is already running opens the sample File in a new
Tab.
I don't know what to google for, I get mostly entries for optparse,
but not to this specific topic.
That's not exactly a wxPython specific question. You may have tried
on comp.lang.python.
I wrote an app that behaves like that under Windows.
The program checks via DDE whether another instance is running already.
If that's the case, the filename is sent to the other instance and the
program terminates.
You can have a look at PythonWin how to implement this.
It's in two files:
Can somebody point me to information to build a programm that behaves
like most text editors.
python nameOfProgram.py sampleFile.txt
=> Program start with sampleFile opend OR
if programm is already running opens the sample File in a new
Tab.
The program checks via DDE whether another instance is running already.
or use wx.SingleInstanceChecker for a platfrom-nuetral option.
The trick then is how to find the running app, and how to send it a message.
It would be nice to have this built-in to wxPython, but alas, it's not, and there are many ways to do it. Try googling SingleInstanceChecker for discussion of some of the options.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
I found out that this is more complicated than I exspected. So I put
this feature a bit behind.
I too think Editra is a good example, src/ed_ipc.py is the central
file that manages the messaging. I will investigate this later.
Thanks to all.
···
On Oct 19, 6:03 am, Chris Barker <Chris.Bar...@noaa.gov> wrote:
Dietmar Schwertberger wrote:
> ma...@rockiger.com schrieb:
>> Can somebody point me to information to build a programm that behaves
>> like most text editors.
>> python nameOfProgram.py sampleFile.txt
>> => Program start with sampleFile opend OR
>> if programm is already running opens the sample File in a new
>> Tab.
> The program checks via DDE whether another instance is running already.
or use wx.SingleInstanceChecker for a platfrom-nuetral option.
The trick then is how to find the running app, and how to send it a message.
It would be nice to have this built-in to wxPython, but alas, it's not,
and there are many ways to do it. Try googling SingleInstanceChecker for
discussion of some of the options.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
I too think Editra is a good example, src/ed_ipc.py is the central
file that manages the messaging. I will investigate this later.
That is only used for IPC (inner process communication) when a second instance starts up it can send any command line args or other commands over to the currently running instance before exiting.
Cody
···
On Oct 19, 2009, at 1:03 AM, marco@rockiger.com wrote:
> I too think Editra is a good example, src/ed_ipc.py is the central
> file that manages the messaging. I will investigate this later.
That is only used for IPC (inner process communication) when a second
instance starts up it can send any command line args or other commands
over to the currently running instance before exiting.