create global variables?

Steve Holden steve at holdenweb.com
Tue Oct 31 03:57:02 EST 2006


aking at mappi.helsinki.fi wrote:
> 
> J. Clifford Dyer wrote:
> 
>>Alistair King wrote:

[... advice and help ...]

> this worked a treat:
> 
> def monoVarcalc(atom):
> 
>    a = atom + 'aa'
>    Xaa = a.strip('\'')
>    m = atom + 'ma'
>    Xma = m.strip('\'')
>    Xaa = DS1v.get(atom)
>    Xma = pt.get(atom)
>    return Xaa, Xma
> 
> 
> Caa, Cma = monoVarcalc('C')
> 
In which case I suspect you will find that this works just as well:

def monoVarcalc(atom):

    Xaa = DS1v.get(atom)
    Xma = pt.get(atom)
    return Xaa, Xma


Unless there is something decidedly odd about the side-effects of the 
statements I've removed, since you never appear to use the values of a, 
m, Xaa and Xma there seems little point in calculation them.

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Skype: holdenweb       http://holdenweb.blogspot.com
Recent Ramblings     http://del.icio.us/steve.holden




More information about the Python-list mailing list