Well since my version of ply was greater than 3.4 I modified the requirements.txt file with the following change (click hide/show):
Then added this to the list Language list in setup.py under the 3.4 version of python(click hide/show):
I uninstalled the prior attempt and then installed html5print with 'python setup.py install'. This ran without error.
The outcome of this is that I haven't been able to do the command line version of html5-print nor have I been successful with any of the code examples using the IDE. The only reference to html5print in the /python/scripts folder is a file named the same that has no extension on it. The file in question has the following 4 lines:
While looking for answers to this I ran across something that I thought might be a more elegant solution using pdfkit. So, I loaded up pdfkit v0.6.1 and did this test code:
I'm working on Windows 10 with Python 3.6 32bit
I'm moving the reference above to a thread by itself. I had formatting errors causing the unicode errors. Once corrected another issue popped up, so it really belongs by itself.
Then added this to the list Language list in setup.py under the 3.4 version of python(click hide/show):
I uninstalled the prior attempt and then installed html5print with 'python setup.py install'. This ran without error.
The outcome of this is that I haven't been able to do the command line version of html5-print nor have I been successful with any of the code examples using the IDE. The only reference to html5print in the /python/scripts folder is a file named the same that has no extension on it. The file in question has the following 4 lines:
#!C:\Python\python.exe # EASY-INSTALL-SCRIPT: 'html5print==0.1.2','html5-print' __requires__ = 'html5print==0.1.2' __import__('pkg_resources').run_script('html5print==0.1.2', 'html5-print')Each time I attempt to invoke the module in python I get this error:
Error: cmd /C "set "PYTHONIOENCODING=UTF-8" && set "PYTHONUNBUFFERED=1" && C:\Python\python.exe c:\Users\cartken\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\ptvsd_launcher.py --default --client --host localhost --port 63492 c:\Users\cartken\Downloads\py\blabel\htmlprinttest.py "
Traceback (most recent call last):
File "c:\Users\cartken\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\ptvsd_launcher.py", line 48, in <module>
main(ptvsdArgs)
File "c:\Users\cartken\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\lib\python\old_ptvsd\ptvsd\__main__.py", line 432, in main
run()
File "c:\Users\cartken\.vscode\extensions\ms-python.python-2020.2.64397\pythonFiles\lib\python\old_ptvsd\ptvsd\__main__.py", line 316, in run_file
runpy.run_path(target, run_name='__main__')
File "C:\Python\lib\runpy.py", line 261, in run_path
code, fname = _get_code_from_file(run_name, path_name)
File "C:\Python\lib\runpy.py", line 236, in _get_code_from_file
code = compile(f.read(), fname, 'exec')
File "c:\Users\cartken\Downloads\py\blabel\htmlprinttest.py", line 8
@media (-webkit-min-device-pixel-ratio:0) {
^
SyntaxError: invalid syntax
The example code I am using that generated this is as follows:from html5print import CSSBeautifier css = '''@media (-webkit-min-device-pixel-ratio:0) { h2.collapse { margin: -22px 0 22px 18px; } ::i-block-chrome, h2.collapse { margin: 0 0 22px 0; } } ''' print(CSSBeautifier.beautify(css, 4)) @media (-webkit-min-device-pixel-ratio:0) { h2.collapse { margin : -22px 0 22px 18px; } ::i-block-chrome, h2.collapse { margin : 0 0 22px 0; } }Now, I'm not sure if this module is just not compatible with Python 3.6 (only tested by creator to 3.4). Or if I'm doing something wrong in testing.
While looking for answers to this I ran across something that I thought might be a more elegant solution using pdfkit. So, I loaded up pdfkit v0.6.1 and did this test code:
import os import pdfkit pdfkit.from_file("C:\Users\cartken\Downloads\py\blabel\pngtest.html", "out.pdf") os.startfile("out.pdf", "print")Which gave me the unicode error below:
Error: File "c:\Users\cartken\Downloads\py\blabel\pdfkitprint.py", line 4
pdfkit.from_file("C:\Users\cartken\Downloads\py\blabel\pngtest.html", "out.pdf")
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
Any input that may be helpful for me resolving either issue would be greatly appreciated.I'm working on Windows 10 with Python 3.6 32bit
(Mar-11-2020, 03:42 PM)KipCarter Wrote: While looking for answers to this I ran across something that I thought might be a more elegant solution using pdfkit. So, I loaded up pdfkit v0.6.1 and did this test code:
import os import pdfkit pdfkit.from_file("C:\Users\cartken\Downloads\py\blabel\pngtest.html", "out.pdf") os.startfile("out.pdf", "print")Which gave me the unicode error below:
Any input that may be helpful for me resolving either issue would be greatly appreciated.
Error:File "c:\Users\cartken\Downloads\py\blabel\pdfkitprint.py", line 4 pdfkit.from_file("C:\Users\cartken\Downloads\py\blabel\pngtest.html", "out.pdf") ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
I'm working on Windows 10 with Python 3.6 32-bit
I'm moving the reference above to a thread by itself. I had formatting errors causing the unicode errors. Once corrected another issue popped up, so it really belongs by itself.
Through a cloudy window,
Kip...
“Progress means getting nearer to the place you want to be. And if you have taken a wrong turn, then to go forward does not get you any nearer.
If you are on the wrong road, progress means doing an about-turn and walking back to the right road; and in that case the man who turns back soonest is the most progressive man.” ― C.S. Lewis
Kip...
“Progress means getting nearer to the place you want to be. And if you have taken a wrong turn, then to go forward does not get you any nearer.
If you are on the wrong road, progress means doing an about-turn and walking back to the right road; and in that case the man who turns back soonest is the most progressive man.” ― C.S. Lewis