9-1.文件过滤。显示一个文件的所有行,忽略以#号开头的行。
f = open('./test.txt')
for eachLine in f:
eachLine.strip()
if not eachLine.startswith('#'):
print(eachLine)
f.close()f = open('./te9-1.文件过滤。显示一个文件的所有行,忽略以#号开头的行。
f = open('./test.txt')
for eachLine in f:
eachLine.strip()
if not eachLine.startswith('#'):
print(eachLine)
f.close()f = open('./te