我不确定pythonanywhere,但在windows中,我下载了wkhtmltox.zip,在其中,我发现
wkhtmltox.exe
.
您还需要安装
wkhtmltox
.
import imgkit
config_img = imgkit.config(wkhtmltoimage='../path_of_wkhtmltopdf/wkhtmltox.exe') #in windows
config_img = imgkit.config(wkhtmltoimage='../path_of_wkhtmltopdf/wkhtmltox') #in linux
imgkit.from_string(html, file_path + '.jpg', config=config_img)
对于蟒蛇
上传
wkhtmltox公司
文件从上载选项存在于
file
剖面图
pythonanywhere
.
检查当前目录并列出该目录中的文件,然后找到您的文件。
import os
print(os.getcwd()) # current directory path
print(os.listdir(os.getcwd()) # list files present in current directory