摘要: 作用:在不修改函数的前提下,为函数增加新的功能 def say(): print("tttt is a good man!") # def outer(): # print("***************") # say() def outer(func): def inner(): print( 阅读全文
posted @ 2019-12-18 16:31 陌小唐 阅读(108) 评论(0) 推荐(0)
摘要: def func(arg,*args_tuple,**args_dic) 带*的参数会以元组的形式导入,带**的参数会以字典的形式导入 def fuc(a,*arg): print(a) print(arg) fuc("hello",1,2,3,4,5) 输出结果: def fuc(a,*arg,* 阅读全文
posted @ 2019-12-18 16:12 陌小唐 阅读(221) 评论(0) 推荐(0)
摘要: 虽然print()函数看起来好像很简单,但每次自己看到format时总会有点遗忘,所以这里把它记一下吧 print("hello{},我在这里{}".format("world","等你")) 默认情况下,format函数里的参数对应前面{}的位置,当然也可以自己决定,{}里的数字表示format函 阅读全文
posted @ 2019-12-17 16:39 陌小唐 阅读(458) 评论(0) 推荐(0)
摘要: 部分内容摘自https://blog.csdn.net/qq_44525050/article/details/87947301 作用:可以将python程序中的对象信息存入到文件中,永久存储。如:将字典、列表、元组存入文件 如:字典 import pickle import pprint date 阅读全文
posted @ 2019-12-17 15:30 陌小唐 阅读(259) 评论(0) 推荐(0)