On Friday, Nov 2nd 2007 at 14:14 -0000, quoth matthias:

=>Howdy !
=>
=>I started using the assert() stmt and found it quite useful :-)  I
=>have only one problem:  I don't
=>know how to turn them off again.
=>
=>I know that "-O" turns off assertions in general.  However, how do I
=>pass thus parameter to
=>python to an executable script ?

I had similar questions and I decided that what I really needed for my 
app was a preprocessor. I looked around and found what I thought to be 
really cool:

http://nedbatchelder.com/code/cog

It's a preprocessor written in python which allows you to embed python 
code (called cogs) in your python such that the cogs execute and are 
replaced by what they output.

I have print statements (effectively) which produce either output or 
nothing, depending on what I pass from the Makefile. The files that I 
write are called .cog.py and when I execute make, it produces .py files as 
output. It's a hugely useful thing to have available. The only slight 
disadvantage is that you have to (remember to) run make if you change your 
.cog.py files before retrying something.

-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to