随笔分类 -  【017】Python

摘要:带命令行参数的代码在IDE下调试,需要把参数赋值,本文mark一下具体的命令行参数在代码中赋值方法。if __name__ == "__main__": sys.argv = ['a.py', '--src=vi', '--tgt=en'] 对应的参数顺序为:sys.argv = [arg0, arg1, arg2] 阅读全文
posted @ 2018-07-27 23:54 AllenLYU 阅读(2229) 评论(0) 推荐(0)
摘要:# coding=gbkimport osimport os.path #读取目录下的所有文件,包括嵌套的文件夹def GetFileList(dir, fileList): newDir = dir if os.path.isfile(dir): fileList.append(dir) elif os.path.isdir(dir): for s ... 阅读全文
posted @ 2016-09-25 14:08 AllenLYU 阅读(11391) 评论(0) 推荐(1)

levels of contents