Firstly, names starting and ending with two underscores, like
__starfile__
, are reserved for Python’s own use. You should name your
variables differently.
Secondly, after importing a module, to access the module’s contents, you
need to access the module first:
>>> import math
>>> pi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'pi' is not defined
>>> math.pi
3.141592653589793
You can import a module with a shorter name:
import startrader_defines_base as base
or you can import the contents directly:
from startrader_defines_base import starfile, spam, eggs, aardvark
With care, you can even tell Python to import “everything”, although
this is not good practice and you should generally be very careful about
doing this:
from startrader_defines_base import *