Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #101898

bgpic doesn't show background image for turtle

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Jean Richelle <jean.richelle@ulb.ac.be>
Newsgroups comp.lang.python
Subject bgpic doesn't show background image for turtle
Date Tue, 19 Jan 2016 10:13:53 +0000 (UTC)
Lines 50
Message-ID <mailman.104.1453198813.15297.python-list@python.org> (permalink)
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de BpaZAB8fki+JTgaMuVOgPAr2Ef0boVThYigxtZtCG+ew==
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'turtle': 0.07; '__init__': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.10; 'from:addr:ulb.ac.be': 0.16; 'message-id:@post.gmane.org': 0.16; 'options)': 0.16; 'received:164.15': 0.16; 'received:80.91.229.3': 0.16; 'received:ac.be': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'received:ulb.ac.be': 0.16; 'subject:image': 0.16; 'subject:show': 0.16; 'subject:turtle': 0.16; '"",': 0.22; 'trying': 0.22; 'seems': 0.23; 'header:User-Agent:1': 0.26; "doesn't": 0.26; 'header:X-Complaints-To:1': 0.26; 'skip:" 20': 0.26; 'error': 0.27; 'jean': 0.29; "i'm": 0.30; 'received:be': 0.30; 'skip:s 30': 0.31; 'skip:_ 10': 0.32; 'getting': 0.33; 'open': 0.33; 'correctly': 0.34; 'file': 0.34; 'exist': 0.35; 'skip:" 50': 0.35; 'skip:p 30': 0.35; 'but': 0.36; 'skip:i 20': 0.36; 'located': 0.36; 'there': 0.36; 'mode': 0.36; 'to:addr:python-list': 0.36; 'received:org': 0.37; 'charset:us-ascii': 0.37; 'skip:p 20': 0.38; 'to:addr:python.org': 0.40; 'hello,': 0.40; 'telling': 0.61; 'p.s.': 0.65; '**kw)': 0.84
X-Injected-Via-Gmane http://gmane.org/
X-Gmane-NNTP-Posting-Host sea.gmane.org
User-Agent Loom/3.14 (http://gmane.org/)
X-Loom-IP 164.15.211.34 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/537.86.3)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:101898

Show key headers only | View raw


Hello,
I'm trying to have a background image for the turtle graphics.
bgpic("filename.gif") works correctly in terminal mode but I'm
getting an error when it is in a python program :

  File "VisuProg3.0.564.py", line 2206, in afficheLabyrinthe
    bgpic("L1.gif")
  File "<string>", line 8, in bgpic
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/
python3.5/turtle.py", line 1482, in bgpic
    self._setbgpic(self._bgpic, self._bgpics[picname])
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/
python3.5/turtle.py", line 738, in _setbgpic
    self.cv.itemconfig(item, image=image)
  File "<string>", line 1, in itemconfig
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/
python3.5/tkinter/__init__.py", line 2417, in itemconfigure
    return self._configure(('itemconfigure', tagOrId), cnf, kw)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/
python3.5/tkinter/__init__.py", line 1321, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
_tkinter.TclError: image "pyimage64" doesn't exist

Regards,

Jean

P.S.

Note that the image file seems to have been corretly located because 
if the file is not there the error message is telling it :

  File "VisuProg3.0.564.py", line 2206, in afficheLabyrinthe
    bgpic("L1.gif")
  File "<string>", line 8, in bgpic
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/
python3.5/turtle.py", line 1481, in bgpic
    self._bgpics[picname] = self._image(picname)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/
python3.5/turtle.py", line 479, in _image
    return TK.PhotoImage(file=filename)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/
python3.5/tkinter/__init__.py", line 3393, in __init__
    Image.__init__(self, 'photo', name, cnf, master, **kw)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/
python3.5/tkinter/__init__.py", line 3349, in __init__
    self.tk.call(('image', 'create', imgtype, name,) + options)
_tkinter.TclError: couldn't open "L1.gif": no such file or directory

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

bgpic doesn't show background image for turtle Jean Richelle <jean.richelle@ulb.ac.be> - 2016-01-19 10:13 +0000

csiph-web