-
|
In a university computational course I teach, I have a unit on image processing and use Pillow. I was going over the demo code I have for my course and discovered that dir() does not work anymore when applied to an image object. Odd. I don't think I've ever encountered an object where I could not use dir() to inspect its elements. Here's the code: from PIL import Image
im = Image.open('Jordingray.bmp')
print(type(im))
print(dir(im))It shows the type as: Here's the error: TypeError Traceback (most recent call last) TypeError: 'str' object is not callable |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
I can't replicate, either locally or on GitHub Actions. If you can still replicate, would you be able try >>> from PIL import Image
>>> im = Image.new("RGB", (1, 1))
>>> print = "test"
>>> print(im)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'str' object is not callableIf that doesn't yield anything, could upload the image? |
Beta Was this translation helpful? Give feedback.
-
|
Sorry. I hadn't seen that my graduate student had overwritten the dir() function in my code. Should have been the first thing I checked. |
Beta Was this translation helpful? Give feedback.
Sorry. I hadn't seen that my graduate student had overwritten the dir() function in my code. Should have been the first thing I checked.