I’m looking at pyGame and all the constants used. PyCharm does not like the capitalized letters as the constants.
What is the correct way to handle constants in Python?
Thanks for clearing that up.
I’m looking at pyGame and all the constants used. PyCharm does not like the capitalized letters as the constants.
What is the correct way to handle constants in Python?
Thanks for clearing that up.
Using uppercase identifiers for constants is a well established convention in Python, described in PEP8. I would be very surprised if PyCharm did not respect that.
I think we could say more only if you show a short, self-contained example of such a code and copy the message PyCharm shows to you.
My bad! Its not the contants but the typos of constants and statements.
I am using a spell checker too. It caught many typos of mine!
I am using “Code Spell Checker” in VS Code where it has to be installed as an extension from the store. I do not know the capabilities of the PyCharm spell checker but in VS Code I can:
_
to separate words. Examples from your screenshot: photo_image
, mouse_icon.png
… I would go this path in your case.Yes, using the ‘_’ between words works, so I will set that as my standard for constants.
Thanks.