How to import an image into a .py program?

This is the place for queries that don't fit in any of the other categories.

How to import an image into a .py program?

Postby Hissing Cockroach » Thu Sep 19, 2013 1:32 am

What I have been wondering is how the heck people import
photos into one of their python programs. I've really been wanting to do it,
but have no idea how. Can someone tell me?
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: How to import an image into a .py program?

Postby stranac » Thu Sep 19, 2013 7:37 am

GUI frameworks usually have ways for handling images.
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1093
Joined: Thu Feb 07, 2013 3:42 pm

Re: How to import an image into a .py program?

Postby ochichinyezaboombwa » Thu Sep 19, 2013 7:50 pm

There is also PIL.
ochichinyezaboombwa
 
Posts: 200
Joined: Tue Jun 04, 2013 7:53 pm

Re: How to import an image into a .py program?

Postby Hissing Cockroach » Fri Sep 20, 2013 9:42 pm

How do you use it?
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: How to import an image into a .py program?

Postby micseydel » Fri Sep 20, 2013 9:54 pm

Both the things mentioned here accomplish different things. What are you trying to accomplish? Do you wish to display the image, edit it, both, or something else?
Join the #python-forum IRC channel on irc.freenode.net!
User avatar
micseydel
 
Posts: 1118
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: How to import an image into a .py program?

Postby Hissing Cockroach » Fri Sep 20, 2013 10:24 pm

I'm wanting to display it.
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: How to import an image into a .py program?

Postby micseydel » Fri Sep 20, 2013 10:42 pm

I was incorrect earlier that PIL and GUIs perform entirely different functions. Anyway, http://lmgtfy.com/?q=display+image+python&l=1
Join the #python-forum IRC channel on irc.freenode.net!
User avatar
micseydel
 
Posts: 1118
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: How to import an image into a .py program?

Postby Hissing Cockroach » Sun Sep 22, 2013 2:32 pm

What the heck?! The guy on the website hacked my mouse or something!
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: How to import an image into a .py program?

Postby dboxall123 » Sun Sep 22, 2013 6:15 pm

Huh?
dboxall123
 
Posts: 108
Joined: Fri Jul 12, 2013 5:28 pm

Re: How to import an image into a .py program?

Postby Marbelous » Mon Sep 23, 2013 2:30 pm

Hissing Cockroach wrote:What the heck?! The guy on the website hacked my mouse or something!


I HOPE that was a joke. He's talking about the Let Me Google That for You page where it types your question for you.

Cockroach, you learn how to use PIL the same way you learn Python, and its modules, and pretty much everything else... RTFM. (Read the Fucking Manual)
If you ever intend to write code you need to learn to research. Don't waste your time (and ours) asking every little thing on a forum. Get out there and find answers. That's what ALL programmers do when they need to do something they aren't familiar with.

For PIL start here: http://effbot.org/imagingbook/pil-index.htm
If you're confused by what you read, go back and study more basic Python before you tackle images. Learn some Tkinter (the GUI that comes with python).
Marbelous
 
Posts: 97
Joined: Fri May 31, 2013 8:12 pm

Re: How to import an image into a .py program?

Postby tnknepp » Mon Sep 23, 2013 7:43 pm

Marbelous wrote:
Hissing Cockroach wrote:What the heck?! The guy on the website hacked my mouse or something!


I HOPE that was a joke. He's talking about the Let Me Google That for You page where it types your question for you.

Cockroach, you learn how to use PIL the same way you learn Python, and its modules, and pretty much everything else... RTFM. (Read the Fucking Manual)
If you ever intend to write code you need to learn to research. Don't waste your time (and ours) asking every little thing on a forum. Get out there and find answers. That's what ALL programmers do when they need to do something they aren't familiar with.

For PIL start here: http://effbot.org/imagingbook/pil-index.htm
If you're confused by what you read, go back and study more basic Python before you tackle images. Learn some Tkinter (the GUI that comes with python).



That comes across as a bit rude, but please understand this is the process we all go through. Everyone here understand the newbie point of view (i.e. even the manual/help function results are scary and confusing), but we all must take off the training wheels some time. Keep coming back and keep learning.
Python: 2.7 via Anaconda
Numpy: 1.7
Pandas: 0.11
OS: Windows 7
IDE: Spyder/IPython
User avatar
tnknepp
 
Posts: 119
Joined: Mon Mar 11, 2013 7:41 pm

Re: How to import an image into a .py program?

Postby Marbelous » Mon Sep 23, 2013 9:40 pm

Well, I didn't mean to be rude. I almost toned it down with "Freakin" or "EFFing" but I figured we're all adults here.
I think it's really important that new coders learn that researching and working problems out for themselves is a critical skill that is required to be a good programmer. Not even the best of us can remember all the details of every module. You must learn to find answers quickly. That means using the help that comes with python through pydocs, docstrings, help options, IDE tricks and yes, even :o MANUALS.
It seems that many of the newbs these days go right to a social forum with every little question and wait to be spoon fed answers before even making any attempt to work it out themselves. This is a bad thing on many levels. ( obligatory link: http://www.catb.org/esr/faqs/smart-questions.html )
Marbelous
 
Posts: 97
Joined: Fri May 31, 2013 8:12 pm

Re: How to import an image into a .py program?

Postby Hissing Cockroach » Mon Sep 23, 2013 10:58 pm

tnknepp wrote:
Hissing Cockroach wrote:What the heck?! The guy on the website hacked my mouse or something!


I HOPE that was a joke. He's talking about the Let Me Google That for You page where it types your question for you.


Yes, that was a joke. I just found the thing weird.
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: How to import an image into a .py program?

Postby Hissing Cockroach » Mon Sep 23, 2013 11:17 pm

Anyway, thanks for the PIL website. This will probably help.
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: How to import an image into a .py program?

Postby tnknepp » Tue Sep 24, 2013 1:52 pm

Marbelous wrote:Well, I didn't mean to be rude.


I understand that, and I had no intention of reprimanding you for your post (despite offensive language). My point was that while your response may seem rude, your intention was likely to be helpful. At some point we must learn to do our research before asking a question.
Python: 2.7 via Anaconda
Numpy: 1.7
Pandas: 0.11
OS: Windows 7
IDE: Spyder/IPython
User avatar
tnknepp
 
Posts: 119
Joined: Mon Mar 11, 2013 7:41 pm

Re: How to import an image into a .py program?

Postby Marbelous » Tue Sep 24, 2013 4:29 pm

Hissing Cockroach wrote:
tnknepp wrote:
Hissing Cockroach wrote:What the heck?! The guy on the website hacked my mouse or something!


I HOPE that was a joke. He's talking about the Let Me Google That for You page where it types your question for you.


Yes, that was a joke. I just found the thing weird.


Yeah, I guess it's supposed to be weird so you get the point. I'm sure a lot of people think "Oh No! I just got a PC virus!" when they first click the link. It's funny :lol: but also a bit evil :evil:
Marbelous
 
Posts: 97
Joined: Fri May 31, 2013 8:12 pm

Re: How to import an image into a .py program?

Postby Hissing Cockroach » Tue Sep 24, 2013 6:58 pm

Marbelous wrote:If you ever intend to write code you need to learn to research. Don't waste your time (and ours) asking every little thing on a forum. Get out there and find answers.


By the way,
I have been doing that.
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth


Return to General Coding Help

Who is online

Users browsing this forum: Letoatreides3508 and 3 guests