A bit fun with Python

Greg Ewing (using news.cis.dfn.de) me at privacy.net
Mon Mar 24 18:30:00 EST 2003


Ulrich Petri wrote:
> how does this script:
> ------------------
> re.fork("this works")
> print sys.compile
> ------------------
> produce that output:
> 
> ------------------
> this works
> posix
> ------------------

Um... it doesn't, for me -- it produces

   Traceback (most recent call last):
     File "foo.py", line 1, in ?
        re.fork("this works")
   NameError: name 're' is not defined

If I add some import statements, it produces

   Traceback (most recent call last):
     File "foo2.py", line 2, in ?
       re.fork("this works")
   AttributeError: 'module' object has no attribute 'fork'

Are you sure you ran it using the Python interpreter,
and not something else?

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg





More information about the Python-list mailing list