import re
text = open('eq.txt','r').read()
regex = '[^A-Z][A-Z]{3}([a-z])[A-Z]{3}[^A-Z]'
pattern = re.compile(regex)
match = pattern.findall(text)
print ''.join(match)
However, when I try to run it, I get this error:
Traceback (most recent call last):
File
"/Applications/Komodo.app/Contents/SharedSupport/dbgp/bin/pydbgp", line
66, in <module>
import dbgp.client
File
"/Applications/Komodo.app/Contents/SharedSupport/dbgp/pythonlib/dbgp/client.py",
line 44, in <module>
import traceback, re
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/re.py",
line 5, in <module>
#
AttributeError: 'module' object has no attribute 'compile'
-------------------------------------------------------------------------------
Here is the error outside of Komodo:
Traceback (most recent call last):
File "reg1.py", line 1, in <module>
import re
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/re.py",
line 5, in <module>
#
AttributeError: 'module' object has no attribute 'compile'
------------------------------------------------------------------------------
This is running 2.5 on my OSX box. If I run it (again with 2.5) on my
SUSE machine, I get no errors.
I am sure that I have overlooked something trivial here - so please be
gentle if it is on the stupid side of things.
Thanks,
Brian
From http Wed Nov 8 19:01:56 2006
From: http (Paul Rubin)
Date: 08 Nov 2006 10:01:56 -0800
Subject: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?
References: <eiddl5$qpn$[email protected]>
<[email protected]>
<eit1ab$q9j$[email protected]>
Message-ID: <[email protected]>
robert <no-spam at no-spam-no-spam.invalid> writes:
what about speed. Is it true that IronPython is almost as fast as C-Python meanwhile?
When this all is really true, its probably a proof that putting out
LOCK-INC-lock's (on dicts, lists, mutables ...) in CPython to remove
the GIL in future should not be really so expensive as it was teached
in the past :-)
I don't think IronPython uses locks that way. AFAIK it doesn't useWhen this all is really true, its probably a proof that putting out
LOCK-INC-lock's (on dicts, lists, mutables ...) in CPython to remove
the GIL in future should not be really so expensive as it was teached
in the past :-)
reference counts, and relies on user-supplied synchronization to keep
stuff like dictionaries safe.