python 常用高效代码写法集锦

一.打开文件

#使用 with 语句操作文件对象
with open(r'somefileName') as somefile:
    for line in somefile:
        print line
        # ...more code
原文地址:https://www.cnblogs.com/vincent90/p/5258312.html