2016-05-16 11 views
2

のpython Tkinterのタートル画面の背景

enter image description here

これはコードの部分である:

sc=turtle.Screen() 
    turtle.setworldcoordinates(0, 0, 1000,1000) 
    sc.bgpic('images.jpg') 

とはい画像が保存されます同じファイル名の下でコード内で呼びました。亀の文書毎の

+1

が見えます。それを別のプログラムで開いてみてください。 – martineau

答えて

0

bgpic()はGIFファイルのみを受け付け、ないJPEG:あなた ` 'images.jpg'`ファイルが壊れている可能性がありますように

turtle.bgpic(picname=None)

Parameters: picname – a string, name of a gif-file or "nopic", or None

Set background image or return name of current backgroundimage. If picname is a filename, set the corresponding image as background. If picname is "nopic", delete background image, if present. If picname is None, return the filename of the current backgroundimage.