Вопрос

here's the code I am using

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

Now, when I run this code I am getting an error: module 'object' has no attribute 'Number'

I took a screenshot of the whole output that I got when I run the above code, with errors and everything. so,please take a look and let me know what's wrong?

enter image description here

Это было полезно?

Решение

That's a printout of all numbers up to 50 that aren't divisible by 3. It's probably in a numbers module on sys.path that's shadowing the standard library numbers. See where it is:

import numbers
print numbers.__file__
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top