Q's on my first python script
MRAB
google at mrabarnett.plus.com
Sun May 10 13:37:56 EDT 2009
Andre Engels wrote:
> On Sun, May 10, 2009 at 5:56 PM, Steven D'Aprano
> <steve at remove-this-cybersource.com.au> wrote:
>
>>> 5. The variable wd is meant to be "global" to the script. In other
>>> languages I've programmed in I've seen some typographic convention
>>> used for the name of such variables (e.g. all caps) to signal this
>>> widened scope. Does python have such a convention?
>> As a general rule, it's best to avoid globals variables as much as
>> possible.
>
> However, this is not really a global variable, this is a constant,
> which is not something to be avoided, nor something that there is a
> convention for (as far as I know).
>
In Python the convention for constants is CAPS_WITH_UNDERSCORES.
More information about the Python-list
mailing list