Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
semi-extrinsic
4 months ago
|
parent
|
context
|
favorite
| on:
Why LLMs Can't Write Q/Kdb+: Writing Code Right-to...
Dunno if it counts as funny, but the following code only works if you keep the matplotlib import:
import matplotlib import PIL im = PIL.Image.open("foo.png")
aidos
4 months ago
[–]
What? There’s no way that’s correct. I use PIL exactly like that and don’t have matplotlib in my codebase.
semi-extrinsic
4 months ago
|
parent
[–]
Just try it. IIRC, to do the PIL import correctly you have to
import PIL.Image
Turns out that matplotlib (and probably lots of other stuff) does that, and then it gets resolved correctly.
aidos
4 months ago
|
root
|
parent
[–]
Oh right, gotcha. I always do from PIL import Image
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: