涵盖pdf至csv语法错误

时间:2018-06-27 16:20:24

标签: python csv pdf

为什么我总是收到此错误消息

  

文件“ sfctabcvrt.py”,第3行cat test.csv#查看内容   test.csv文件SyntaxError:语法无效

当我尝试在Linux中运行此代码时:

from tabula import convert_into
convert_into("Trialpage.pdf", "test.csv", output_format="csv") 
cat test.csv #view the contents of the test.csv file

2 个答案:

答案 0 :(得分:1)

Cat 不是python语句。

在脚本的第一行中添加

import os

用这一行替换包含cat命令的行:

os.system("cat test.csv")

答案 1 :(得分:0)

我实际上发现在我使用python 2.7时,tabula-py模块安装在python 3上的问题,所以一旦更改版本,执行的代码就会出现。

相关问题