I'm getting the following problem using Spyder:
If I name a variable just with upper case letters, it is not shown at the Variable Explorer window.
For example, if I name a variable like: Var = 1, it is in the Variable Explorer.
Otherwise, if I name it like: VAR = 1, it is not shown there.
Anyone know why is that and if there is any way to fix it?
(ps: please, I know that I could just "not name them like that", but that's not what I'm asking)
Thanks
By Convention: Variable names begin with a lowercase letter, and class names begin with an uppercase letter. If a variable name consists of more than one word, the words are joined together, and each word after the first begins with an uppercase letter, like this: isVisible .
Go to View/Panes and select Variable Explorer. Save this answer. Show activity on this post. Save this answer.
The Variable Explorer shows the namespace contents (all global object references, such as variables, functions, modules, etc.) of the currently selected IPython Console session, and allows you to interact with them through a variety of GUI-based editors.
I am a newbie in Python and Spyder but I think I can help you. According with the PEP 8 -- Style Guide for Python Code:
"Constants are usually defined on a module level and written in all capital letters with underscores separating words. Examples include MAX_OVERFLOW and TOTAL".
I guess that Spyder uses this convention. If this is the case, the variable explorer does not support constants. The Spyder 2.3 documentation have a list of the types of objects supported and constants are not included:
Hope this helps you.
UPDATE: I have just found an Options icon in the vertical bar at the right of the Variables explorer which allows you to enable/disable the uppercase variables.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With