I am trying to write a function that can define functions.
I tried this:
def function_writer():
    print "I am a function writer"  
    def new_function():
        print "I am a new function"
             pass
    pass
function_writer()
new_function()
However, my debugger complains that new_function is not defined and so this obviously is not the way to do it.
Does anyone know how to do this?
Thanks.

function_writeractually does is create a function, so let's hope that's what the questioner means by "write" :-) I suppose that to someone coming from a language where functions cannot be dynamically created, the only way a function exists is because you (the programmer) have written it. This might be the reason for conflating the two concepts.