预期类型 'dict','str' 而不是 PyCharm。尝试使用 tabula 将所有 PDF 页面转换为 CSV 文件?

Expected type 'dict', for 'str' instead PyCharm. Trying to convert all PDF pages into CSV using tabula?

我的代码只能首先转换我的 PDF 的上半部分 sheet,当我试图转换所有页面时我不能,因为我的代码中出现错误。

import tabula

tabula.convert_into("/Users/gfidarov/Desktop/Python/KH_Profilansicht_13.11.2019-2.pdf", "/Users/gfidarov/Desktop/Python/test.csv", output_format="csv",pages='all')

我得到的错误是关于页面功能的

当我写它时 PyCharm 说 预期类型 'dict',而不是 'str'

我在 PyCharm 中使用 python 3.x 版本。

是否有其他方法可以选择所有页面进行转换,而不仅仅是第一页的上侧

您有运行时错误吗? PyCharm 抱怨只是一种警告,可以 "safely" 忽略。问题是 tabula.convert_into 的文档字符串类型注释不正确:

kwargs (dict)

应该是例如

kwargs (str)

https://www.python.org/dev/peps/pep-0484/#arbitrary-argument-lists-and-default-argument-values