This works for me: ----------------------- self.file = None
# Get current state self.file = self.sharedAppClient.GetData("file") if self.file: # do stuff else: print "data does not exist..." ------------------------ Which platform? Susanne On Wed, 13 Apr 2005, Stephen Jeffrey wrote: > Hi All, > > I am writing a shared application using wxPython. The application > is to query if there is any shared data present when it starts. > ie. if another copy of the application is already running and has > sent some data using sharedAppClient.SetData(), when the second > copy of the application starts it should obtain the data stored > by the first copy. > > How can I query if there is any shared data already present? > I have tried: > > d = self.sharedAppClient.GetData("data") > if len(d) > 0: > > and other variations such as: > > d = self.sharedAppClient.GetData("data") > if d != 0: > > and > > d = self.sharedAppClient.GetData("data") > if d != None: > > but it appears as though GetData() is returning junk - when the > first copy of the application starts there should not be > any shared data present, but it returns non-zero data. > > Is there some way to overcome this, or do I have to somehow > get the first instance of the application to "initialise" > the shared data. > > cheers > steve > > -- > Dr Stephen Jeffrey > Advanced Computational Modelling Centre > University of Queensland > St. Lucia Queensland 4072 Australia > > Phone: +61 (7) 3365 6130 > Fax: +61 (7) 3365 6136 > Email: s...@maths.uq.edu.au > Web: http://www.acmc.uq.edu.au > >