1

I use python on Ubuntu, and I am (as my name suggests) a complete noob at it all. I want to insert a very basic image, I have looked around, copied coding etc, but mothing seems to work. I want to insert an image, nothing else, so it just appears on the screen when I run it in shell. Please help? and please explain in simple terms, i'd like to know what I'm actually doing! Thank-you in advance.

3
  • 1
    This is not really a basic task, since you have to create a window and everything. However try looking at pygame, it has this capability. Commented Apr 22, 2011 at 15:53
  • 5
    Generally, I just don't know the answers to SO questions. Now, I don't even know what the question is. :| Commented Apr 22, 2011 at 15:54
  • I am just asking how to insert an image, using python coding, so that when i hit f5 and run the code in shell, an image will appear. I don't get how you don't know what i'm talking about?!?!? Commented Apr 24, 2011 at 19:46

2 Answers 2

3

you can install PIL imagemagick

then:

import Image

im = Image.open("your_image")
im.show()
Sign up to request clarification or add additional context in comments.

Comments

2

I would try something like:

import webbrowser
webbrowser.open('file:///path/to/my/file.jpg')

1 Comment

why -1 after all it open the image in a new window?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.