alexforencich / python-hpgl

Python HPGL parsing library
MIT License
18 stars 3 forks source link

How to use Your wouderful program #2

Open XM03 opened 5 years ago

XM03 commented 5 years ago

I Was looking for a program that converts a DPGL data to CSV (or popular one like that) on python. and I have found this Great one. But there is no useful readme. Could you tell me how to use this one, please.

alexforencich commented 5 years ago

Depends on what you want to do. For HPGL, the code is in hpgl.py. You can call hpgl.parse_hpgl with a file name, file object, or BytesIO object and it will parse the HPGL format and return a list of paths. This can be passed to hpgl.generate_svg, which returns a string containing an SVG image (XML format). Not sure what you need as output; but you'll probably want to do something with the path data from parse_hpgl.