Sharing variables between two scripts

hi everybody,

i have 2 scripts, one is the external script where i can get 2 external signals from the serial port, and then i write this data in a text file, this script is sending the 2 data continuously.

The other script is in Blender, with this script i get the 2 data from the text file and with these data i can move a cube in BGE.

now my problem, i need to share a variable from the script from blender to the external script. i tried using (from “name of the script of blender” import “the variable”) but doesn’t work, it said “No module named GameLogic”.
I use “import Gamelogic” in the blender script.

What can i do?

Im not an expert in Game Logic, but you should check your writing - Blender Python is case sensitive…

To exchanging variables, you may wish to try writing vars values into a text file, then read then in the other script. You mentioned that one of these is external sooo… use an “external” exchange method :wink: