Post #3098:
bl
📋 Metadata
- Author: roaoao
- Date: 2020-03-23 09:26:00
- Type:
answer - Quality Score: 8/10
- Reply to: post_03096
- Replies (1): post_03099
🏷️ Tags
python-scripting intermediate solved
⚙️ Related PME Features
- Python Scripting
- Macro Editor
- execute_script
💬 Content
blndrusr:
Hey @roaoao,
When I run a any script byexecute_script("..."), all variables and their values are lost once the script is executed. Is there a way to preserve all variables together with values so they are still accessible when the script gets executed next time?
You can store your variables in pme.context.globals dict:
pme.context.globals.get("my_var_name", "my_default_value")
pme.context.globals.update(my_var_name="my_value")
❤️ 3 likes