在字符串中遇到排序错误的问题

时间:2014-11-17 05:40:08

标签: python attributes

import string

def scaryDict(filename1, filename2):
    s= filename1
    Infile=open(filename1,'r')
    OF = open(filename2, 'w')
    for line in Infile:
        Infile= s.lower()
        Infile= s.replace('-',' ')
        Infile= s.split()
        Infile= s.sort()
        scaryWords=[]
        for word in filename1:
            if len(word)>2:
                scaryWords.append(word)
    outfile.write(scaryWords)
    Infile.close()
    OF.close()
    print(scaryWords)
scaryDict('frankenstein.txt', 'scarydict.txt')
当我运行程序时,我得到的消息是字符串没有atrribute类似于####

0 个答案:

没有答案