Re: [Tutor] Web framework: looking for python-tutor's angle.

2009-08-13 Thread Alan Gauld
"Mac Ryan" wrote A couple of months ago I took the time to read a few articles on python web application frameworks and I got the impression that the two most mature and active projects are Zope and Django. They are both mature and widely used, but for quite different markets. TurboGears is a

Re: [Tutor] Dynamic Function Calls

2009-08-13 Thread Alan Gauld
"Megan Land" wrote I'm trying to call a function from a dictionary. I did some googling and from what I can tell my code should work, but doesn't. Here's an example: def myFunc(self, inputList): The fact you have a self in there suggests that this is a method of some class? Is it? If not

Re: [Tutor] Dynamic Function Calls

2009-08-13 Thread Kent Johnson
On Thu, Aug 13, 2009 at 3:30 PM, Megan Land wrote: > Hi, > > I'm trying to call a function from a dictionary. I did some googling and > from what I can tell my code should work, but doesn't. Here's an example: > > def myFunc(self, inputList): > dict={0: func0, 1: func1, 2:func2} > for element in in

[Tutor] Dynamic Function Calls

2009-08-13 Thread Megan Land
Hi, I'm trying to call a function from a dictionary. I did some googling and from what I can tell my code should work, but doesn't. Here's an example: def myFunc(self, inputList): dict={0: func0, 1: func1, 2:func2} for element in inputList: dict[element]() When I go to run this

Re: [Tutor] Web framework: looking for python-tutor's angle.

2009-08-13 Thread Serdar Tumgoren
I've never used Zope so I can't speak to its strengths or weaknesses. But I can say that Django is quite natural if you already know Python. It certainly is modular, with a ton of apps that you can plug in to gain added functionality. And there's also a project called Pinax that provides layers of

Re: [Tutor] Web framework: looking for python-tutor's angle.

2009-08-13 Thread Tino Dai
On Thu, Aug 13, 2009 at 2:09 PM, Mac Ryan wrote: > A couple of months ago I took the time to read a few articles on python > web application frameworks and I got the impression that the two most > mature and active projects are Zope and Django. > > Zope vs. Django hits 879.000 pages on google but

[Tutor] Web framework: looking for python-tutor's angle.

2009-08-13 Thread Mac Ryan
A couple of months ago I took the time to read a few articles on python web application frameworks and I got the impression that the two most mature and active projects are Zope and Django. Zope vs. Django hits 879.000 pages on google but much of the debate - or at least this is my impression - fa

Re: [Tutor] To write data in two different fonts?

2009-08-13 Thread Nick Raptis
Dave Angel wrote: However, if someone had tried to do that in a single call to the current function, their code would already be broken because the dictionary doesn't preserve order, so the & substitution might not happen first. Wow, I never thought about the dictionary not being sorted me

Re: [Tutor] best approach to db-api imports and cursor calls

2009-08-13 Thread Christian Witts
Serdar Tumgoren wrote: But most folks find multiple cursors easier to manage in the same way that they find multiple variables easier than reusing a minimal number. That makes sense. I think I'll try using a global import/connect, and then create cursors inside each method. Thanks to you

Re: [Tutor] best approach to db-api imports and cursor calls

2009-08-13 Thread Serdar Tumgoren
> But most folks find multiple cursors easier to manage in the same way that > they find multiple variables easier than reusing a minimal number. > That makes sense. I think I'll try using a global import/connect, and then create cursors inside each method. Thanks to you both for the advice! _

Re: [Tutor] To write data in two different fonts?

2009-08-13 Thread Dave Angel
Nick Raptis wrote: Dave Angel wrote: As I said, you'd probably get in trouble if any of the lines had '&' or '<' characters in them. The following function from the standard library can be used to escape the line directly, or of course you could use the function Nick supplied. xml.sax.saxut

Re: [Tutor] best approach to db-api imports and cursor calls

2009-08-13 Thread Alan Gauld
"Serdar Tumgoren" wrote Is there any reason why you can't reuse the same cursor object? I know when you're writing to a database, you have to be sure to commit your changes. But if I'm just issuing execute statements and then fetching data, is it okay to reuse the same cursor? No, there is no