如何在python中读取pdf文件而不在unix中将其转换? [英] how to read pdf file in python without converting it in unix?
本文介绍了如何在python中读取pdf文件而不在unix中将其转换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
pdfile=open("tutorial.pdf","r")
xyz= pdfile.readlines()
pqr=pdfile.readline()
for a in xyz:
print a
此代码不显示实际内容.而是显示一些问号和框.
this code doesnot display actual content. Instead it displays some question marks and boxes.
推荐答案
PDF文件包含格式化数据,您无法直接阅读
PDF files contain formatted data, you cannot read directly,
所以请使用pyPdf模块! 请点击此处 http://pybrary.net/pyPdf/ 安装后,您无需进行转换即可阅读.
so use pyPdf module! click here http://pybrary.net/pyPdf/ Install and you can read without converting.
这篇关于如何在python中读取pdf文件而不在unix中将其转换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文