img2html icon indicating copy to clipboard operation
img2html copied to clipboard

python3.6下不可以用

Open YouRanLongYing opened this issue 7 years ago • 7 comments

D:\Workspace>img2html -i baby.jpg -o out.html Traceback (most recent call last): File "D:\Software\Python3_6\Scripts\img2html-script.py", line 11, in load_entry_point('img2html==0.0.7', 'console_scripts', 'img2html')() File "d:\software\python3_6\lib\site-packages\img2html_init_.py", line 35, in main font_family=args.font, File "d:\software\python3_6\lib\site-packages\img2html\converter.py", line 73, in init char = char.decode('utf-8') AttributeError: 'str' object has no attribute 'decode'

YouRanLongYing avatar May 05 '18 09:05 YouRanLongYing

遇到了同样的问题,还在纠结是不是应该改成encode

morinstar avatar May 06 '18 11:05 morinstar

更新一下,把72-73行删掉以后再把next()、xrange()问题解决,是可以在3.6环境下运行了,但是得到的图片是由无法识别的符号(黑底?)组成,我也不知道应该怎么搞了,来个大神指导下啊xox

morinstar avatar May 06 '18 12:05 morinstar

实在搞不懂字符串的格式和cycle()能接受的类型,如上更改以后是可以识别英文字符串了,但是中文的还是不行

morinstar avatar May 06 '18 13:05 morinstar

请教一下,生成的html 在哪个文件夹呢

lao-zhang avatar May 18 '18 05:05 lao-zhang

@lao-zhang -i 输出路径

liguobao avatar May 26 '18 12:05 liguobao

python2.7正常运行... @morinstar

liguobao avatar May 26 '18 13:05 liguobao

输出 路径在哪啊?找不到么

Xieliang0724 avatar Jun 06 '18 04:06 Xieliang0724