Help with OnscreenText

Hey I am struggling with this code to align left but in all ways it always says TextNode is not defined when in some examples I saw this being executed the same way without defining “TextNode” in the code

the hp attribute is an integer thats why I used str() to convert it into a string
I tied it up with some normal text and inserted it into the OnscreenText()

,thx in advance for helping

def renderStats(hp):
    hpstr = "HP:", str(hp)
    OnscreenText(text = hpstr, pos = (-1.2, -0.65), align= TextNode.ALeft, scale = 0.07)

Did you put this at the top of your file?

from pandac.PandaModules import TextNode

I thought it was included if you imported OnscreenText.
Heh thx it works now ^^, thats the second time today I make such stupid errors damn