سؤال

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