This question is quite general but it's more for me to understand good coding practices in python...
I'd like to define a constant that I can use inside in any function without having to pass it as argument, and without the need to change it anywhere after its declared - maybe it'd be nice to make it impossible to change but not sure if i can do that.
What'd be the best way to do this, in terms of programming style (coding, name convention, etc.)
I.e., GLOBAL_CONSTANT='this_variable_will_not_be_changed'
My python code would have this form, is it good style as well?
#!/usr/bin/env python
import sys
import os
GLOBAL_CONSTANT='this_variable_will_not_be_changed'
def test():
print GLOBAL_CONSTANT
return 0
def main():
test()
return 0
if __name__ == "__main__":
main()