摘要: 当函数要接受元组或者字典参数时,它分别使用*前缀。 在变量前加*,则多余的函数参数会作为一个元组存在args中,如: def func(*ages): func(1,2,3) #args表示(1,2,3)这个元组 如果使用**前缀,多余的参数会被认为是字典 def func(**args): fun 阅读全文
posted @ 2021-07-23 13:55 chamie 阅读(411) 评论(0) 推荐(0) 编辑
摘要: import osimport sys print '***获取当前目录***' print os.getcwd() print os.path.abspath(os.path.dirname(__file__)) print '***获取上级目录***' print os.path.abspath 阅读全文
posted @ 2021-07-23 10:46 chamie 阅读(1260) 评论(0) 推荐(0) 编辑