On Thu, Oct 4, 2012 at 7:23 PM, Lynn Oliver <rayco...@gmail.com> wrote:
> I know this isn't exactly what you asked, but I am displaying an image in a
> label in a --onefile distribution, and this code works both while debugging
> and while running the packaged application:
>
>                if getattr(sys, 'frozen', None):
>              basedir = sys._MEIPASS
>         else:
>              basedir = os.path.dirname(__file__)
>         self.photo = tk.PhotoImage(file=os.path.join(basedir,
> 'myImage.gif'))
>         self.myLabel = ttk.Label(self.myFrame, image=self.photo)
>         self.myLabel.grid()
>
> Lynn

i am very new to programming and all that code is confusing me:( sorry:)

> Hi Matthew,
>
> Your first line should in fact be:
>
> from PIL import Image
>
> ...then your line:
>
> my_image = Image.open("imagepath.jpg")
>
> Mick

it gave me an ImportError saying no module named PIL
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to