摘要: python 中的os.pathos.path.join(path1,path2) 将path1 与path2连接成为一个新的path__file__ 这个变量就直接是当前文件名,os.path.dirname(__file__),就可以拿到当前文件的目录名了os.path.join(os.path... 阅读全文
posted @ 2015-09-15 13:11 ivywenyuan 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 使用 % 将字典中的value嵌入到字符串中对应的key值中dd = {"a":1,"b":2,"c":3}txt = "this is a test : a is %(a)s, b is %(b)s, c is %(c)s "print txt % dd结果为:this is a test : a... 阅读全文
posted @ 2015-09-15 13:01 ivywenyuan 阅读(106) 评论(0) 推荐(0) 编辑