[Tutor] Class errors

Danny Yoo dyoo at hashcollision.org
Thu Jan 22 19:42:39 CET 2015


On Thu, Jan 22, 2015 at 8:11 AM, jarod_v6 at libero.it <jarod_v6 at libero.it> wrote:
> Dear All,
>
> I created a class that invoke  from another file another class
>  I get an error that I do not understand: gobal name Job is not defined

Please use copy-and-paste.  You just typed out the error message by
hand: we can tell because the error message you're presenting is
misspelled.  Copy-and-paste it, as well as the surrounding text around
it.


> However If I see the class imported I found the class Job.

Ok.  But where?  In the code you present:


> #job,py
> class Jobs:
>     .....
>
> #trial.py
>
> from core.job import *
> class Second:
>     def __initi__:
>         tp = open("/tmp/file.txt")
>
>     def gus(self):
>         tr = Job()


I don't see a class named 'Job'.  I see a class named 'Jobs' defined
in 'job.py', but that's a different class.


More information about the Tutor mailing list