Making all variables accessible to namespace

Posted by Gökhan Sever on Stack Overflow See other posts from Stack Overflow or by Gökhan Sever
Published on 2010-04-09T21:08:00Z Indexed on 2010/04/09 21:13 UTC
Read the original article Hit count: 295

Filed under:

Hello,

Say I have a simple function:

def myfunc():
    a = 4.2
    b = 5.5
    ... many similar variables ...

I use this function one time only and I am wondering what is the easiest way to make all the variables inside the function accessible to my main name-space.

Do I have to declare global for each item? or any other suggested methods?

Thanks.

© Stack Overflow or respective owner

Related posts about python