私はPythonの初心者であり、Pythonがテキストファイルから引用符で囲まれたすべてのテキストをキャプチャすることを望んでいます。私は以下を試しました:
filename = raw_input("Enter the full path of the file to be used: ")
input = open(filename, 'r')
import re
quotes = re.findall(ur'"[\^u201d]*["\u201d]', input)
print quotes
エラーが発生します:
Traceback (most recent call last):
File "/Users/nithin/Documents/Python/Capture Quotes", line 5, in <module>
quotes = re.findall(ur'"[\^u201d]*["\u201d]', input)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 177, in findall
return _compile(pattern, flags).findall(string)
TypeError: expected string or buffer
誰かが私を助けることができますか?