c-jiph
Re:Show HN: Txt2plotter – True centerline vectors from Flux.2 for pen ...
on Friday January 23, 2026 @02:39AM (#46729625)
Yeah using AI to do a first stage pass seems to work well. I did something similar with Nano Banana: https://github.com/c-jiph/bitmap-to-gcode
I didn't actually end up playing with it too much but the problem I found was it's a hard to get a one-size-fits-all prompt. The AI generated images are usually okay but some features aren't great for a plotter or just don't look visually pleasing. It's still better than having to manually mess with the initial image.
Re:Show HN: Making Python one-liner-fit with the new pwk (Python With ...
on Sunday November 22, 2020 @09:05PM (#25182908)
> (To the best of my knowledge, there is as of 2020 no purely pythonic way to write one-lined try-blocks.)
You can do this using contexlib. For example the following in pwk:
try: { print(os.listdir("/"+s.strip())) } except: pass
Can be written in pure Python as: with contextlib.suppress(Exception): print(os.listdir("/"+s.strip()))
(Assuming contextlib is imported, and you're okay with letting things which don't extend Exception slip through.)You could probably also make a context manager which takes a function/lambda to define how to handle exceptions etc.