Re: Understanding closures

2007-08-18 Thread happyriding
On Aug 18, 11:03 pm, Ramashish Baranwal <[EMAIL PROTECTED]> wrote: > Hi, > > I want to use variables passed to a function in an inner defined > function. Something like- > > def fun1(method=None): > def fun2(): > if not method: method = 'GET' > print '%s: this is fun2' % method

Re: sed to python: replace Q

2008-04-30 Thread happyriding
On Apr 29, 11:27 pm, Raymond <[EMAIL PROTECTED]> wrote: > For some reason I'm unable to grok Python's string.replace() function. line = "abc" line = line.replace("a", "x") print line --output:-- xbc line = "abc" line = line.replace("[apq]", "x") print line --output:-- abc Does the 5 character