老师我一运行 就出现这样的usage: C:\\Desktop\pdfminer3k-1.3.1\tools\pdf2txt.py [-d] [-p pagenos]
[-m maxpages] [-P password] [-o output] [-C] [-n] [-A] [-V] [-M char_margin] [-L
line_margin] [-W word_margin] [-F boxes_flow] [-Y layout_mode] [-O output_dir]
[-t text|html|xml|tag] [-c codec] [-s scale] file ...
[-m maxpages] [-P password] [-o output] [-C] [-n] [-A] [-V] [-M char_margin] [-L
line_margin] [-W word_margin] [-F boxes_flow] [-Y layout_mode] [-O output_dir]
[-t text|html|xml|tag] [-c codec] [-s scale] file ...
2016-10-06
import re # 通过正则表达式查找a标签中的链接
pattern = '<a\s+.*href=["\'](.+)["\']\s*.*/*>'
href = re.findall(pattern,html)
pattern = '<a\s+.*href=["\'](.+)["\']\s*.*/*>'
href = re.findall(pattern,html)
2016-09-30
确实测试中无法存储的错误出在这一句:with connection.cursor() as cursor
表面上是出现在这一句:cursor.execute(sql,('**','**'))
如楼下所言,改成如下后正常存储 cur = connection.cursor()
测试环境:py2.7 mysql5.7.15
表面上是出现在这一句:cursor.execute(sql,('**','**'))
如楼下所言,改成如下后正常存储 cur = connection.cursor()
测试环境:py2.7 mysql5.7.15
2016-09-25
最新回答 / 皓羽如风
我用的是Eclipse中PyDev 插件编程,Python2.7.12对应的MySQL版本是MySQL-python-1.2.4b4.win32-py2.7.exe,我一直使用的是cursor=connection.cursor()表达。Python2.7我没试过,但是在3.4.3中(需要安装pymysql插件),用那个语句会报错。
2016-09-25