Hi
Is there anyway to view a list of what eg.globals variables are defined and what their values are?
thanks
Phil
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.
View Variables in use
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: View Variables in use
The answer to your question is yes, there is any way.Phil wrote:Is there any way to view a list of what eg.globals variables are defined and what their values are?
You would possibly even want to know how to do it.
Well - here is one possible solution:
Code: Select all
def getGlobalVariables():
keys = list(eg.globals.__dict__.keys())
keys.remove('__builtins__')
keys.remove('eg')
for key in sorted(keys):
print key,"=",repr(eg.globals.__dict__[key])
getGlobalVariables()Re: View Variables in use
Excellent, thank you and even some comedy thrown in for good measure! 
Re: View Variables in use
Another option, if you just want to browse through all of the variables, is to use the menu item Help...Python Shell. This will open a PyCrust interface and you can browse through the EG variables in the Namespace tab.