Error

William Miner william.miner at enig.com
Wed May 26 13:48:42 EDT 2010


I¹m relative new to python and I puzzled by the following strange (to me)
behavior. I was taking pieces from two old scripts to build a new one. When
I began to debug it I got the following error message:

Traceback (most recent call last):
  File 
"/Users/williamminer/ex2gen/ex2gen-3.0.5/src/ScriptDev/run_ex2gen_scan.py",
line 38, in <module>
    if re.search('varm',line):
AttributeError: 'function' object has no attribute 'search'

This had worked in the previous script but not the new one. I noticed that
the new script had an additional line at the beginning (line 3)

#!/usr/bin/env python
import sys, math, os, shutil, commands, re, mpmath
from mpmath import *

When I deleted this line, the script ran. Why did the line

from mpmath import *

Trash the search function fro the regular expression module?

I¹m running Python 2.6.2 on  Mac running OS 10.6.3.

Thanks!

Buff Miner
-- 
Enig Associates, Inc.
Suite 500, Bethesda Crescent Bldg.
4600 East West Hwy
Bethesda, Maryland 20814
Tel:(301)680-8600
Fax:(301)680-8100

This message is intended only for the use of the intended recipient(s), and
it may be privileged and confidential. If you are not the intended
recipient, you are hereby notified that any review, retransmission,
conversion to hard copy, copying, circulation or other use of this message
is strictly prohibited and may be illegal. If you are not the intended
recipient, please notify the sender immediately by return e-mail, and delete
this message from your system. Thank you.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100526/b5d08ed2/attachment.html>


More information about the Python-list mailing list