You can use the hou.session module (where you can store also functions available everywhere in the houdini session) You can write directly to it in the Python Source Editor (access it from Windows menu)
Or you can write to it from any python location hou.session.myVar = 1 print(hou.session.myVar)