だから私はこのコードを持っていて、ファイルを開こうとしています。ただし、コードの例外部分は常に実行されます。
def main():
#Opens up the file
try:
fin = open("blah.txt")
independence = fin.readlines()
fin.close()
independence.strip("'!,.?-") #Gets rid of the punctuation
print independence
#Should the file not exist
except:
print 'No, no, file no here'
if __name__ == "__main__":
main()
ファイル名のスペルが正しいかどうかを確認しましたが、正しく、ファイルは python ファイルと同じディレクトリにあり、以前にこのコードを使用したことがあります。なぜ機能しないのですか?