3

これが私が使っているコードです

import os
import decimal
from pyPdf import PdfFileReader
path = r"E:\python\Real Python\Real Python\Course materials\Chapter 8\Practice files"
inputFileName = os.path.join(path,"Pride and Prejudice.pdf")
inputFile = PdfFileReader(file(inputFileName,"rb"))

print "Number of pages:", inputFile.getNumPages()
print "Title:", inputFile.getDocumentInfo().title

このコードを実行すると、エラーが発生します。

'module' object has no attribute 'Number'

上記のコードを実行したときに取得した出力全体のスクリーンショットを、エラーとすべてを含めて撮りました。だから、見て、何が悪いのか教えてください。

ここに画像の説明を入力してください

コードで使用import decimalした後、いくつかのエラーが発生しました。そこで、全体のスクリーンショットを撮り、ここに添付します。 ここに画像の説明を入力してください

4

0 に答える 0