In Python, def is an executable statement. Your function is not
defined until the def statement is run by Python. If you move your
function definitions earlier in the code so that your functions are
defined before they're used, this code will run properly.
Josh R.
On Aug 14, 2008, at 4:0
On Aug 9, 2008, at 10:46 PM, Josh Rosen wrote:
There are a few different problems in your code. First off, regular
expressions must be passed to re.compile() as strings.
patt = re.compile(\[0-9]{1,3})\.(\[0-9]{1,3})\.(\[0-9]{1,3})\.
(\[0-9]{1,3})
should read
patt = re.compile(r"
I was browsing through the source code of Django when I found the
following regular expression:
tspecials = re.compile(r'[ \(\)<>@,;:\\"/\[\]\?=]')
As it turns out, this line from the message module in the Python
standard library's email module. It seems to be used to determine if
an ema
How about the following:
import os
print os.path.abspath(__file__) # the full absolute path to the
current module's file
print os.path.split(os.path.abspath(__file__)) # if you need the
individual components of the path.
On Jul 5, 2008, at 11:00 AM, Monika Jisswel wrote:
import sys