[Pythonmac-SIG] [py2app help] Argv emulation and lost of focus
Hi to all, I've bundled an application with argv emulation (-a) , but when i start the app this doesn't focus, and the applicationDidFinishLaunching_ only start when i clik on the icon on the dock.. all works fine but i want the focus on my app when i open it =) Someone can tell me something? =) Whamoo www.rknet.it Powered by: - MacOsX - Gnu / Linux Debian Sarge - Amiga Os 3.9 - Milk ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] self-instantiating instances in pyhton
Hi, I'm looking for a language to abuse for a project I'm working on. I know a little Python, but I do not know if it can do this: I'd like to define some class N that instantiates objects that can instantiate fresh new objects of that same class... without external controller code. You could use this capability, for example, to generate a red-black tree-type data structure that implicitly instantiates a new node for each new input d1, d2, d3... so on. The algorithm for each node could be: -- Toggle downstream L/R pointer -- If no node there, instantiate one and link to it -- if a node is there, pass the datum to it The execution sequence as the tree builds itself out might look something like this: 1. n0 = N(d0) # new instance of N # (downstream pointer default = Left) # (the first input data, d0, is instantiated in node n0) # nodes: n0 2. n0.send(d1) # toggle n0's downstream pointer to Right # on n0 there is no downstream node right so instantiate a new linked node right n1 with d1 # nodes: n0,n1 3. n0. send(d2) # toggle n0's downstream pointer Left # in n0 there is no downstream node left so instantiate n2 with d2 # nodes: n0,n1,n2 4. n0. send(d3) # toggle n0's downstream pointer Right # there exists a downstream node right, n1, so send d3 there # toggle n1's downstream pointer Right # in n1 there is no downstream node right so instantiate n3 with d3 # nodes: n0,n1,n2,n3 5. n0. send(d4) # toggle n0's downstream pointer Left # there exists a downstream node left, n2, so send d4 there # toggle n2's downstream pointer Right # in n2 there is no downstream node right so instantiate n4 with d4 # nodes: n0,n1,n2,n3,n4 6. n0.send(d5) # toggle n0's downstream pointer Right # there exists a downstream node right, n1, so send d5 there # toggle n1's downstream pointer Left # in n1 there is no downstream node left so instantiate n5 with d5 # nodes: n0,n1,n2,n3,n4,n5 7. n0.send(d6) # So on... # ... Any thoughts about how to do this in Python appreciated. Possible at all? Thanks in advance, -Rayme. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
RE: [Pythonmac-SIG] self-instantiating instances in pyhton
Rayme, This sounds like a Linked List system... I was not able to find quickly a linked list module, but searching by trees at the Vaults produced a R/B tree... http://newcenturycomputers.net/projects/rbtree.html I've been out of touch, I have not heard about the Red/Black balanced tree algorithm... Hmm... But take a look and see if it meets your requirements... But take a look at your implementation, if your just trying to make a linked list, you could just use a standard python list - Benjamin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rayme Jernigan Sent: Wednesday, January 12, 2005 12:53 PM To: pythonmac-sig@python.org Subject: [Pythonmac-SIG] self-instantiating instances in pyhton Hi, I'm looking for a language to abuse for a project I'm working on. I know a little Python, but I do not know if it can do this: I'd like to define some class N that instantiates objects that can instantiate fresh new objects of that same class... without external controller code. You could use this capability, for example, to generate a red-black tree-type data structure that implicitly instantiates a new node for each new input d1, d2, d3... so on. The algorithm for each node could be: -- Toggle downstream L/R pointer -- If no node there, instantiate one and link to it -- if a node is there, pass the datum to it The execution sequence as the tree builds itself out might look something like this: 1. n0 = N(d0) # new instance of N # (downstream pointer default = Left) # (the first input data, d0, is instantiated in node n0) # nodes: n0 2. n0.send(d1)# toggle n0's downstream pointer to Right # on n0 there is no downstream node right so instantiate a new linked node right n1 with d1 # nodes: n0,n1 3. n0. send(d2) # toggle n0's downstream pointer Left # in n0 there is no downstream node left so instantiate n2 with d2 # nodes: n0,n1,n2 4. n0. send(d3) # toggle n0's downstream pointer Right # there exists a downstream node right, n1, so send d3 there # toggle n1's downstream pointer Right # in n1 there is no downstream node right so instantiate n3 with d3 # nodes: n0,n1,n2,n3 5. n0. send(d4) # toggle n0's downstream pointer Left # there exists a downstream node left, n2, so send d4 there # toggle n2's downstream pointer Right # in n2 there is no downstream node right so instantiate n4 with d4 # nodes: n0,n1,n2,n3,n4 6. n0.send(d5)# toggle n0's downstream pointer Right # there exists a downstream node right, n1, so send d5 there # toggle n1's downstream pointer Left # in n1 there is no downstream node left so instantiate n5 with d5 # nodes: n0,n1,n2,n3,n4,n5 7. n0.send(d6)# So on... # ... Any thoughts about how to do this in Python appreciated. Possible at all? Thanks in advance, -Rayme. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] self-instantiating instances in pyhton
Hi Benjamin, I've done this sort of thing with linked lists in Python... by putting all the nodes in a (Python) list, each with a unique ID, and using that ID to link the nodes to each other, etc. But the important thing for me to learn about here... the goal... is the self-instantiation aspect of the problem. The R/B tree is just an example I chose to show why you might want to so such a silly thing. ;) Thanks for checking around, though... On Jan 12, 2005, at 1:03 PM, Schollnick, Benjamin wrote: Rayme, This sounds like a Linked List system... I was not able to find quickly a linked list module, but searching by trees at the Vaults produced a R/B tree... http://newcenturycomputers.net/projects/rbtree.html I've been out of touch, I have not heard about the Red/Black balanced tree algorithm... Hmm... But take a look and see if it meets your requirements... But take a look at your implementation, if your just trying to make a linked list, you could just use a standard python list - Benjamin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rayme Jernigan Sent: Wednesday, January 12, 2005 12:53 PM To: pythonmac-sig@python.org Subject: [Pythonmac-SIG] self-instantiating instances in pyhton Hi, I'm looking for a language to abuse for a project I'm working on. I know a little Python, but I do not know if it can do this: I'd like to define some class N that instantiates objects that can instantiate fresh new objects of that same class... without external controller code. You could use this capability, for example, to generate a red-black tree-type data structure that implicitly instantiates a new node for each new input d1, d2, d3... so on. The algorithm for each node could be: -- Toggle downstream L/R pointer -- If no node there, instantiate one and link to it -- if a node is there, pass the datum to it The execution sequence as the tree builds itself out might look something like this: 1. n0 = N(d0) # new instance of N # (downstream pointer default = Left) # (the first input data, d0, is instantiated in node n0) # nodes: n0 2. n0.send(d1) # toggle n0's downstream pointer to Right # on n0 there is no downstream node right so instantiate a new linked node right n1 with d1 # nodes: n0,n1 3. n0. send(d2) # toggle n0's downstream pointer Left # in n0 there is no downstream node left so instantiate n2 with d2 # nodes: n0,n1,n2 4. n0. send(d3) # toggle n0's downstream pointer Right # there exists a downstream node right, n1, so send d3 there # toggle n1's downstream pointer Right # in n1 there is no downstream node right so instantiate n3 with d3 # nodes: n0,n1,n2,n3 5. n0. send(d4) # toggle n0's downstream pointer Left # there exists a downstream node left, n2, so send d4 there # toggle n2's downstream pointer Right # in n2 there is no downstream node right so instantiate n4 with d4 # nodes: n0,n1,n2,n3,n4 6. n0.send(d5) # toggle n0's downstream pointer Right # there exists a downstream node right, n1, so send d5 there # toggle n1's downstream pointer Left # in n1 there is no downstream node left so instantiate n5 with d5 # nodes: n0,n1,n2,n3,n4,n5 7. n0.send(d6) # So on... # ... Any thoughts about how to do this in Python appreciated. Possible at all? Thanks in advance, -Rayme. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] [EMAIL PROTECTED]: MindVision Releases VISE X 1.5 for Mac OS X]
On 11-jan-05, at 2:01, Bob Ippolito wrote: On Jan 10, 2005, at 19:33, Neal Norwitz wrote: I thought this might be of interest here. The PSF owns a license to VISE. Jack knows the details. I think that this is only really relevant to Mac OS9. I'm not sure if Jack plans to make another release for OS9? I plan to do a final 2.3.5 release. But that does depend on my OS9 partition still starting up (I've reshuffled things), I'm not going to install OS9 and CodeWarrior and all that from scratch. -- Jack Jansen, [EMAIL PROTECTED], http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] self-instantiating instances in pyhton
On Jan 12, 2005, at 12:52, Rayme Jernigan wrote: Hi, I'm looking for a language to abuse for a project I'm working on. I know a little Python, but I do not know if it can do this: I'd like to define some class N that instantiates objects that can instantiate fresh new objects of that same class... without external controller code. You could use this capability, for example, to generate a red-black tree-type data structure that implicitly instantiates a new node for each new input d1, d2, d3... so on. The algorithm for each node could be: -- Toggle downstream L/R pointer -- If no node there, instantiate one and link to it -- if a node is there, pass the datum to it The execution sequence as the tree builds itself out might look something like this: 1. n0 = N(d0) # new instance of N # (downstream pointer default = Left) # (the first input data, d0, is instantiated in node n0) # nodes: n0 2. n0.send(d1) # toggle n0's downstream pointer to Right # on n0 there is no downstream node right so instantiate a new linked node right n1 with d1 # nodes: n0,n1 3. n0. send(d2) # toggle n0's downstream pointer Left # in n0 there is no downstream node left so instantiate n2 with d2 # nodes: n0,n1,n2 4. n0. send(d3) # toggle n0's downstream pointer Right # there exists a downstream node right, n1, so send d3 there # toggle n1's downstream pointer Right # in n1 there is no downstream node right so instantiate n3 with d3 # nodes: n0,n1,n2,n3 5. n0. send(d4) # toggle n0's downstream pointer Left # there exists a downstream node left, n2, so send d4 there # toggle n2's downstream pointer Right # in n2 there is no downstream node right so instantiate n4 with d4 # nodes: n0,n1,n2,n3,n4 6. n0.send(d5) # toggle n0's downstream pointer Right # there exists a downstream node right, n1, so send d5 there # toggle n1's downstream pointer Left # in n1 there is no downstream node left so instantiate n5 with d5 # nodes: n0,n1,n2,n3,n4,n5 7. n0.send(d6) # So on... # ... Any thoughts about how to do this in Python appreciated. Possible at all? Thanks in advance, I would guess that you'd want an implementation that looks kinda like this: class RBNode(object): def __init__(self, value): self.index = 0 self.nodes = [None, None] self.value = value def send(self, value): node = self.nodes[self.index] if node is None: # use type(self) so that if this is a subclass, # then the subclass would be used rather than # RBNode self.nodes[self.index] = type(self)(value) else: node.send(value) self.index = (self.index + 1) % len(self.nodes) -bob ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig