Re: Proabably a simple python question but ...

2010-06-01 Thread Richard Shebora
This post from Graham Dumpleton (wrote mod_wsgi) goes into detail of why that happens. Extremely useful reading... http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html Thanks, Richard Shebora On Tue, Jun 1, 2010 at 10:15 AM, Thomas Lionel Smets wrote: > >

Proabably a simple python question but ...

2010-06-01 Thread Thomas Lionel Smets
If I put at the end of my settings.py file, the following code : if (DEBUG): print "Project name : " + PRJ_NAME print "Root directory : " + ROOT_DIR The lines are printed twice : Project name : XXX Root directory : /Users/tsmets/Documents/python/XXX/site/ Project name : XXX Root directory

Re: simple python question

2008-08-21 Thread Thomas Kerpe
results.append({'URL': '/feed/%s/show/%s' % (item.rss, item.rssfeed),}) On Thu, Aug 21, 2008 at 23:29, Bobby Roberts <[EMAIL PROTECTED]> wrote: > > hi. > > I'm trying to figure out how to dynamically replace things in a string > as follows: > > >results.append({'URL': '/feed/%s/show/%s'

simple python question

2008-08-21 Thread Bobby Roberts
hi. I'm trying to figure out how to dynamically replace things in a string as follows: results.append({'URL': '/feed/%s/show/%s' (%item.rss, %item.rssfeed),}) I think i'm close but it's not the right syntax. can anyone out there help?

Re: Simple python question

2007-04-11 Thread mrstone
> What I'm doing is to load a model from a template. > I have in a template something like this: > {% block menu %} > {% block rss %} > > I want to load "menu" and "rss", but I think that is too much work for > now, I have no idea how to implement it and I probably won't do it. > Thank you very

Re: Simple python question

2007-04-11 Thread Grupo Django
Thank you! What I'm doing is to load a model from a template. I have in a template something like this: {% block menu %} {% block rss %} I want to load "menu" and "rss", but I think that is too much work for now, I have no idea how to implement it and I probably won't do it. Thank you very much

Re: Simple python question

2007-04-10 Thread Todd O'Bryan
On Tue, 2007-04-10 at 18:03 -0500, Jeremy Dunck wrote: > On 4/10/07, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > ... > > The key is that he wanted to use the string name of the class, not the > > class itself. Assuming that Foo is available (i.e., is local to the code > > you're running or has been

Re: Simple python question

2007-04-10 Thread Masida
This should work: class Foo: def hello(self): return "Hello World" object = Foo() print object.hello() More information: http://www.diveintopython.org/object_oriented_framework/index.html Ciao, - Matt On Apr 11, 12:22 am, "Grupo Django" <[EMAIL PROTECTED]> wrote: > I know this

Re: Simple python question

2007-04-10 Thread Jeremy Dunck
On 4/10/07, Todd O'Bryan <[EMAIL PROTECTED]> wrote: ... > The key is that he wanted to use the string name of the class, not the > class itself. Assuming that Foo is available (i.e., is local to the code > you're running or has been imported), this should work: > > o = locals()['Foo']() Oh. In

Re: Simple python question

2007-04-10 Thread Todd O'Bryan
On Tue, 2007-04-10 at 17:50 -0500, Jeremy Dunck wrote: > On 4/10/07, Grupo Django <[EMAIL PROTECTED]> wrote: > > > > I know this is not the right place for asking about python, but it's a > > simple question. > > I need to load an object given in a string. Example: > > > > #I have a class called

Re: Simple python question

2007-04-10 Thread Jeremy Dunck
On 4/10/07, Grupo Django <[EMAIL PROTECTED]> wrote: > > I know this is not the right place for asking about python, but it's a > simple question. > I need to load an object given in a string. Example: > > #I have a class called foo > class foo: > def Hello(): > return "Hello World" >

Simple python question

2007-04-10 Thread Grupo Django
I know this is not the right place for asking about python, but it's a simple question. I need to load an object given in a string. Example: #I have a class called foo class foo: def Hello(): return "Hello World" object = 'foo' print object.Hello() Something like this. Is it