Class is not defined despite being imported

Use the fully-qualified name:

sayinghi = testmodule.Greeter("hello world!")

There is an alternative form of import that would bring Greeter into your namespace:

from testmodule import Greeter

import testmodule
# change to
from testmodule import Greeter

or

import testmodule
sayinghi = Greeter("hello world!")
# change to
import testmodule
sayinghi = testmodule.Greeter("hello world!")

You imported the module/package, but you need to reference the class inside it.

You could also do this instead

from testmodule import *

but then beware of namespace pollution