Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert multiple files from a folder #24

Closed
imv7 opened this issue Nov 21, 2019 · 1 comment
Closed

Convert multiple files from a folder #24

imv7 opened this issue Nov 21, 2019 · 1 comment

Comments

@imv7
Copy link

imv7 commented Nov 21, 2019

import pdftables_api
import os

c = pdftables_api.Client('XYZ')
root_dir = 'C:\PythonTests\pdf'

for directory, subdirectories, files in os.walk(root_dir):
    for file in files:
        print (file)
        c.html(file, file) 

File "c:/PythonTests/for.py", line 10
c.html('file, file)
^
SyntaxError: EOL while scanning string literal

I am trying to get every single file and convert it. How to fix this issue?

@imv7
Copy link
Author

imv7 commented Nov 21, 2019

Solved with:

import pdftables_api
import os

c = pdftables_api.Client('')

file_path = "C:\\PythonTests\\"

for file in os.listdir(file_path):
    if file.endswith(".pdf"):
        c.html(os.path.join(file_path,file), file+'.html')

@imv7 imv7 closed this as completed Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant