Welcome, guest | Sign In | My Account | Store | Cart

Works in python 2.4 and 2.5

Python, 7 lines
1
2
3
4
5
6
7
def f(**kw):
    for k,v in kw.iteritems():
        locals()[k]=v
    exec('pass') # apply locals %)
    print x

f(x='test')
Created by Oleg Sidorkin on Wed, 25 Jun 2008 (PSF)
Python recipes (4591)
Oleg Sidorkin's recipes (1)

Required Modules

  • (none specified)

Other Information and Tasks