Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Class and methods
#11
Quote:Traceback (most recent call last):
File "<main.py>", line 11, in <module>
ModuleNotFoundError: No module named 'Pillow'

=== Code Exited With Errors ===
This is what I got trying to import a Pillow package into my computer. Will it import if I write out a exception and then run it? It's for a picture file I'm still on it. Online interpreter and compiler.

I don't know how to write a exception yet. But from the looks of it, similar to Java. And it has the same affect. Run time. I'll look it up.
Programs are like instructions or rules. Learning it gets us closer to a solution. Desired outcome. Computer talk.
Reply
#12
Why are you trying to import Pillow? There is no module named Pillow. Before trying something new, read some documentation.

https://pillow.readthedocs.io/en/stable/...orial.html
Reply
#13
data = "Some data"
filename = "test.txt"

try:
    file = open(filename, 'w+')
except:
    print("Error opening file")
else:
    try:
        file.write(data)
    except:
        print("Error writing to file")
finally:
    file.close()
A picture file, .jpg extension. name is the full url assuming. The file is the picture. Then write it like that. It should compile and run. Just learning ideas and concepts. No heart to go through that now. But will get there. Thank for your input.
Programs are like instructions or rules. Learning it gets us closer to a solution. Desired outcome. Computer talk.
Reply
#14
(May-23-2024, 07:31 PM)deanhystad Wrote: Why are you trying to import Pillow? There is no module named Pillow. Before trying something new, read some documentation.

https://pillow.readthedocs.io/en/stable/...orial.html

okay. I saw it on stack overflow
Programs are like instructions or rules. Learning it gets us closer to a solution. Desired outcome. Computer talk.
Reply
#15
(May-23-2024, 08:04 PM)ebn852_pan Wrote: okay. I saw it on stack overflow
I don't think so. Unless it was the example code that didn't work.
Reply
#16
I read the tutorial on images, thanks. I still need to get my chrome book to c:\ figuring it out. Well, I like python so far because it's a software language. Pretty much like how basic was or Java. Same idea. Application is what the aim is for, downloading pictures.
Does this script rotate my pictures back when the other person views it. It places in like that, even though I did not write the script.

Just figuring out what's going to happen. The codes on images I understand, just the import and modules I'll have to memorize. What modules and what's happening. C# or C++ is what I'm concentrating on. That way application just comes natural because the codes say so. Easy to understand from a applications point of view.

from PIL import Image
with Image.open("hopper.jpg") as im:
    im.rotate(45).show()
Programs are like instructions or rules. Learning it gets us closer to a solution. Desired outcome. Computer talk.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Class and methods Saida2024 2 364 May-13-2024, 04:04 AM
Last Post: deanhystad
  Class test : good way to split methods into several files paul18fr 4 651 Jan-30-2024, 11:46 AM
Last Post: Pedroski55
  [split] Class takes no arguments bily071 2 765 Oct-23-2023, 03:59 PM
Last Post: deanhystad
  Structuring a large class: privite vs public methods 6hearts 3 1,237 May-05-2023, 10:06 AM
Last Post: Gribouillis
  access share attributed among several class methods drSlump 0 1,132 Nov-18-2021, 03:02 PM
Last Post: drSlump
  a function common to methods of a class Skaperen 7 2,813 Oct-04-2021, 07:07 PM
Last Post: Skaperen
  Listing All Methods Of Associated With A Class JoeDainton123 3 2,464 May-10-2021, 01:46 AM
Last Post: deanhystad
  too many methods in class - redesign idea? Phaze90 3 2,630 Mar-05-2021, 09:01 PM
Last Post: deanhystad
  Special Methods in Class Nikhil 3 2,461 Mar-04-2021, 06:25 PM
Last Post: Nikhil
  cant able to make methods interact with each other in the class jagasrik 2 1,915 Sep-16-2020, 06:52 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020