[Tutor] weird python code

Benoit Dupire bdupire@seatech.fau.edu
Thu, 19 Apr 2001 13:12:16 -0400


I found this on a Python website (i don' t remember where exactly)..
but did not figure out why this does not work....

can someone explain it to me?
thanks...



def f():
 global path
 from sys import *
 print path


>>> f()
Traceback (innermost last):
  File "<pyshell#24>", line 1, in ?
    f()
  File "<pyshell#23>", line 4, in f
    print path
NameError: path

--
Benoit Dupire
Graduate Student
Systems Engineering - FAU
----------------
I'd like to buy a new Boomerang. How can i get rid of the old one?