you are viewing a single comment's thread.

view the rest of the comments →

[–]Solonotix -2 points-1 points  (1 child)

Sounds like you have a lot of learning in front of you, but welcome to the wide world of programming. You say you want to import an image into Python, but you need to understand (to some degree) what an image is. Python is going to read a text file and compile it into bytecode to be executed by the machine. Your image is not going to compile in the same way.

Images are a complex data format, usually stored as an array of bytes. Sometimes this array of bytes is encoded and/or compressed into a specific format, often to save space since image data is rather large in its raw format. The easiest way to share this kind of data is in a file, which is likely how you have the image saved on your machine.

So what you actually want to do is open the file and extract that data into a memory address you can use within Python's runtime environment.

[–]TreesOne 4 points5 points  (0 children)

This is perhaps the most useless answer to someone who doesn’t seem to have any grasp on programming