Advertisement
Guest User

liczenie stron pdf

a guest
Nov 24th, 2015
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. import os
  2. import glob
  3. from pyPdf import PdfFileReader
  4.  
  5. ########################TO DZIALA###########################################
  6. sciezka = 'v:\\3575_PARCZEW_SKANOWANIE\\SKANY\\Adam'
  7.  
  8. for dirpath, dirs, files in os.walk(sciezka):
  9.     parent = dirpath
  10.     os.chdir(parent)
  11.     for infile in glob.glob(os.path.basename('*.pdf')):
  12.         input = PdfFileReader(file(infile, "rb"))
  13.         page_count = str(input.getNumPages())
  14.  
  15.         fullpath = os.path.abspath(infile)
  16. #       print fullpath
  17.         print "".join([fullpath, ",", page_count])
  18.         break
  19.  
  20. ########################TO DZIALA###########################################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement