Re: parallelpython 1.5.7 crash

2009-12-12 Thread zeph
ined since the # execution was unwound because, presumable, the first fatal you got, the OverflowError sys.excepthook(*sys.exc_info()) # ...snip... job.finalize(sresult) # UnboundLocalError here from missing sresult You can submit these as a bug report to the author if you want

Re: Moving from PHP to Python. Is it Possible

2009-12-11 Thread zeph
On Dec 11, 8:58 am, MRAB wrote: > output = [''] > output.append('My Page') > output.append('') > output.append('Powers of two\n') > for n in range(1, 11): >      output.append('%s' % (2 ** n)) > > output.append('') > print ''.join(output) Agreed (I might join on '\n' though), I was just trying to

Re: Moving from PHP to Python. Is it Possible

2009-12-11 Thread zeph
e[4] and FormStorage object, and you can get server environment data from the os.environ[5] dictionary; Good luck and keep on learning! :-) - zeph References: 1: http://docs.python.org/library/traceback.html 2: http://docs.python.org/library/cgitb.html 3: http://gnosis.cx/publish/programming/fea

Re: Perl to Python conversion

2009-12-09 Thread zeph
Python and Perl often have different design idioms - learning to write *well* in a language involves understanding those idioms, and being able to translate between languages involves understanding the source language well enough to understand the intent of the program's code (even if its poorly wr

Re: How do I Block Events in wxPython

2009-12-09 Thread zeph
The wxPython wiki actually has a page on dealing with long running tasks called from event handlers called (surprise surprise): http://wiki.wxpython.org/LongRunningTasks Hint: the second to last example on that page has the clearest example - using a worker thread object to do your DoEfficiency()

Re: switch

2009-12-08 Thread zeph
> > Even better (well, shorter!): > options = {"a" : do_a, "b",do_b, "c", do_c} > options.get(option, do_default)() > You can also make it something callable like so, which is a little more compact if you need to reuse it a lot: >>> def do_a(x): print "a:", x ... >>> def do_b(x): print "b:", x ..

Re: test if an input string starts with a python expression

2009-12-07 Thread zeph
It sort of sounds like you want a templating system: http://wiki.python.org/moin/Templating -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the significance of after() in this code?

2009-12-06 Thread zeph
On Dec 6, 8:46 pm, Benjamin Kaplan wrote: > On Sun, Dec 6, 2009 at 10:29 PM, W. eWatson wrote: > > See Subject. > >    def StackImages(self): > >        self.Upload("P") > >        self.after_id = self.master.after(1,self.GetFrameOne) > > -- > >http://mail.python.org/mailman/listinfo/python-l

Re: Organization of GUIs

2009-12-05 Thread zeph
I highly recommend reading the Cocoa documentation, which has volumes on all sorts of things like this. Here's a link that talks about views in that context, and should give you more ideas about well- designed GUI layouts: http://bit.ly/6b8PYh -- http://mail.python.org/mailman/listinfo/python-lis

Re: How to timeout when waiting for raw_input from user ?

2009-12-05 Thread zeph
Here's what I came up with, though it only asks once question then quits depending on the answer or lack thereof. And while, yes, you can't interrupt a raw_input call from a timer, providing for a blank line (user hitting enter) is a way around it: import threading import Timer from random import

Re: Difference between mutex.mutex and threading.Lock

2009-12-04 Thread zeph
ls lock.acquire(), thread2 will block until thread1 calls lock.release(), then thread2 will get a chance to run its critical code section, then call lock.release(). - zeph -- http://mail.python.org/mailman/listinfo/python-list

Re: How to tell if you're running on windows?

2009-12-04 Thread zeph
ts from the Windows command shell's PATH env variable, and you'll see the path sep is indeed ':'. Cygwin also seems to put drive mount points in /cygdrive/ so you will have for example "/cygdrive/c/foo:/cygdrive/c/bar" instead of "C: \foo;C:\bar". For python *outside* of Cygwin, on Windows, I assume os.path.pathsep is ';'. - zeph -- http://mail.python.org/mailman/listinfo/python-list

Re: Mega Newbie Questions: Probably FAQs

2006-08-14 Thread Zeph
Zeph wrote: >> 3) Can someone recommend a good framework that will enable me to keep >> things well sorted out, and easy to maintain as my apps grow? (I'm >> considering MVC, but have no idea how to apply it until I've gone >> beyond "Hello World").

Re: Mega Newbie Questions: Probably FAQs

2006-08-14 Thread Zeph
ajaksu wrote: > Zeph wrote: And I'd research a bit about decompiling those executables, > might be easier (or harder, in my case) than you thought :) Are you saying that generally python code is insecure? It hadn't occurred to me, but I want to play in a fairly competitive fiel

Re: Mega Newbie Questions: Probably FAQs

2006-08-14 Thread Zeph
ajaksu wrote: > Hoping this helps more than confuses, Thanks, these were the sort of answers I was looking for. I've programmed in Basic, AppleScript, Pascal and Usertalk (Userland Frontier), I've got a sense for development, it's just been a very, very long time ago. I do intend to start smal

Mega Newbie Questions: Probably FAQs

2006-08-14 Thread Zeph
I'm pretty well of a mind to pick up Python. I like it because it seems to have a fair degree of functionality and is accessible to someone without a PhD in computer sciences. This is my second day of investigation, and I'm astounded by the huge ecosystem that surrounds it. I have a number of q