Re: The Zen of Zope, by Alex Clark

2012-12-09 Thread Steven D'Aprano
On Sun, 09 Dec 2012 20:13:43 -0500, Alex Clark wrote: import other > The Zen of Zope, by Alex Clark I expect that I would find that hilarious if I knew anything about Zope :) -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: TypeError: 'in ' requires string as left operand, not Element

2012-12-09 Thread MRAB
On 2012-12-10 01:19, Dave Angel wrote: On 12/09/2012 07:52 PM, Victor Hooi wrote: Hi, I'm getting a strange error when I try to run the following: for root, dirs, files in os.walk('./'): for file in files: if file.startswith('ml') and file.endswith('.xml') and 'entity'

Re: Creating different classes dynamically?

2012-12-09 Thread Victor Hooi
heya, Dave: Ahah, thanks =). You're right, my terminology was off, I want to dynamically *instantiate*, not create new classes. And yes, removing the brackets worked =). Cheers, Victor On Monday, 10 December 2012 11:53:30 UTC+11, Dave Angel wrote: > On 12/09/2012 07:35 PM, Victor Hooi wrote:

Re: TypeError: 'in ' requires string as left operand, not Element

2012-12-09 Thread Dave Angel
On 12/09/2012 07:52 PM, Victor Hooi wrote: > Hi, > > I'm getting a strange error when I try to run the following: > > for root, dirs, files in os.walk('./'): > for file in files: > if file.startswith('ml') and file.endswith('.xml') and 'entity' > not in file: >

The Zen of Zope, by Alex Clark

2012-12-09 Thread Alex Clark
import other The Zen of Zope, by Alex Clark Beautiful is an attribute of ugly. Explicit is implemented by implicit. Simple is provided by complex. Complex is directly provided by complicated. Flat only implements nested. Sparse has tagged value dense. Readability count is not in range. Special

Re: TypeError: 'in ' requires string as left operand, not Element

2012-12-09 Thread Victor Hooi
Hi, Ignore me - PEBKAC...lol. I used "root" both for the os.walk, and also for the root XML element. Thanks anyhow =). Cheers, Victor On Monday, 10 December 2012 11:52:34 UTC+11, Victor Hooi wrote: > Hi, > > > > I'm getting a strange error when I try to run the following: > > > > fo

Re: TypeError: 'in ' requires string as left operand, not Element

2012-12-09 Thread Roy Smith
In article <8c78344a-8019-450a-bfdf-13508bf75...@googlegroups.com>, Victor Hooi wrote: > Hi, > > I'm getting a strange error when I try to run the following: > > for root, dirs, files in os.walk('./'): > for file in files: > if file.startswith('ml') and file.endswith('.

TypeError: 'in ' requires string as left operand, not Element

2012-12-09 Thread Victor Hooi
Hi, I'm getting a strange error when I try to run the following: for root, dirs, files in os.walk('./'): for file in files: if file.startswith('ml') and file.endswith('.xml') and 'entity' not in file: print(root) print(file)

Re: Creating different classes dynamically?

2012-12-09 Thread Dave Angel
On 12/09/2012 07:35 PM, Victor Hooi wrote: > Hi, > > I have a directory tree with various XML configuration files. > > I then have separate classes for each type, which all inherit from a base. > E.g. > > class AnimalConfigurationParser: > ... > > class DogConfigurationParser(Anima

Re: An object is and isn't an instance of a class at the same time

2012-12-09 Thread Dave Angel
On 12/09/2012 07:31 PM, Chris Angelico wrote: > On Mon, Dec 10, 2012 at 10:34 AM, danielk wrote: >> D:\home\python>python jtest.py >> >> Traceback (most recent call last): >> File "jtest.py", line 4, in >> executeResults = jc.execute(cmnd) >> File "D:\home\python\jukebox\jconnection.py",

Creating different classes dynamically?

2012-12-09 Thread Victor Hooi
Hi, I have a directory tree with various XML configuration files. I then have separate classes for each type, which all inherit from a base. E.g. class AnimalConfigurationParser: ... class DogConfigurationParser(AnimalConfigurationParser): ... class CatConfiguration

Re: An object is and isn't an instance of a class at the same time

2012-12-09 Thread Chris Angelico
On Mon, Dec 10, 2012 at 10:34 AM, danielk wrote: > D:\home\python>python jtest.py > > Traceback (most recent call last): > File "jtest.py", line 4, in > executeResults = jc.execute(cmnd) > File "D:\home\python\jukebox\jconnection.py", line 225, in execute > raise TypeError("Command m

An object is and isn't an instance of a class at the same time

2012-12-09 Thread danielk
I was debugging some code using isinstance() to make sure the correct object was been passed to the method and came across something that is really ticking me off. I have a class called 'Jitem' in its own file called 'jitem.py'. It's part of a package called 'jukebox'. I also have '__all__' th

Re: why does dead code costs time?

2012-12-09 Thread Mark Lawrence
On 09/12/2012 14:11, Ramchandra Apte wrote: peehole haha Double spaced crap from you again not so haha. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Running a Python app on a remote server and displaying the output files

2012-12-09 Thread Miki Tebeka
On Saturday, December 8, 2012 12:22:35 PM UTC-8, Jason Hsu wrote: > 1. How do I run my Python script in Google App Engine and make the output > results.csv file publicly available? Probably https://developers.google.com/appengine/docs/python/blobstore/, however https://developers.google.com/app

Re: why does dead code costs time?

2012-12-09 Thread Ramchandra Apte
On Wednesday, 5 December 2012 22:10:51 UTC+5:30, Bruno Dupuis wrote: > On Wed, Dec 05, 2012 at 04:15:59PM +, Neil Cerutti wrote: > > > On 2012-12-05, Bruno Dupuis wrote: > > > > Hi, > > > > > > > > I'm interested in compilers optimizations, so I study python > > > > compilation process >

kishor heart th...@gmail.com

2012-12-09 Thread vasanthfast8
hi -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing in Python

2012-12-09 Thread Mark Lawrence
On 08/12/2012 22:23, subhabangal...@gmail.com wrote: Dear Group, I am looking at a readymade tool to resolve anaphora, and I am looking a Python based one. I checked NLTK. It has DRT parser. But I do not like that. In other parsers you have to insert grammar. But I am looking for a completely