maybe this is simple, i'm not sure.
but how do i save a variable value for use later?
i have a couple of python scripts that gather info, whether it was the indoor Temperature, or the condition outside..... i need to read these variables in different macros for later use.
now i use the File Write and File read and have EG write the values to a notepad file, but i'm thinking there must be an easier way to do that, instead or reading and writing to file all the time.
if this is my best option, i'll just delete this Topic.
thank you in advance.
Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
How to save a variable for later use.
Re: How to save a variable for later use.
This code sets a "global variable" named "test1" to "123" then prints eg.globals.test1 in the Log.
I believe your are looking to set eg.globals.your_variable_name_here
I believe your are looking to set eg.globals.your_variable_name_here
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1700">
<Action Name="Python Script Set EG Global Variable">
EventGhost.PythonScript(u'eg.globals.test1 = "123"\nprint eg.globals.test1')
</Action>
</EventGhost>Re: How to save a variable for later use.
thank you very much for the help.
i will give it a try as soon as i get home from work.
i will give it a try as soon as i get home from work.