Importing strings/lists form an other Script

first sorry for my English skills.
And now, my Problem:
I´m making a Point and Click Adventure and I want to organize all dialogues from a single Cube. The Cube have a Python script and the Script contains all strings (in different Lists). I want to import the strings or the lists from the Script. Did somebody know how to do this with a Python command?
All the objects are on the same Scene.

Thanks for answering! ^^

You can’t.
Scripts live as long as they are executed. As only one Python controller is executed at the time only one script is present.

But … you can put your data into a module and import the module.

If you think a little bit more ahead, I suggest to look for some Python libraries that allow to take your text data from other files. E.g. .properties, .ini or even .txt. There are quite a few libraries out there, even with multilanguage support.

You can store lists and variables in bge.logic.
Run this once:

bge.logic.first_list = [ “Hello”,“hi”]
bge.logic.next_list = [“Good bye”, “See you later”]

and then you can access the lists in any script, in what you import bge.

hello_list = bge.logic.some_list

Thanks that is useful! ^^

Danke! Das war eine Option wen es sonst nichts anderes als Möglichkeit zu Verfügung stand.