I want to write a third party module to generate random numbers. It contains a class that includes a method to generate random numbers. The method calls on the NTL library:
r = ntl.ZZ_random(2**512)
However, after I installed the module via:
sage --python GenRan.py install
and imported the module, I get a NameError:
sage: from GenRan import *
sage: genran = GenRan()
sage: genran()
NameError: global name 'ntl' is not defined
But when I attach the python file directly via:
sage: attach GenRan.py
sage: genran = GenRan()
sage: genran()
32094823048203948204890234
I get the random number I desire. May I know why this is so?
I am using Sage version 5.7 on Linux version 2.6. Any help is greatly appreciated. Thanks!