def test(): print "printing from test func" dic = {'a':1,'b':2,'c':test} if len(dic) == 3: print (dic['c']) output: <function test at 0x106887578>
此代码打印函数对象作为输出,如何从测试函数获取print语句作为输出.
python python-2.7
python ×1
python-2.7 ×1