open file in python demo

来源:互联网 发布:java中接口怎么看 编辑:程序博客网 时间:2024/05/21 18:32
#quote from 'think python, how to think like a computer scientist'fh = open('words.txt')for line in fh:    word = line.strip()    if len(word) > 20:        print wordfh.close()

0 0
原创粉丝点击