-1

I am creating a greeting card in python turtle graphics using the following code in IDLE, but i would like to insert a few pictures at different locations. Is it possible to insert images using a link, such as in HTML with " ..."link"..."? I am aware of the .bgpic function, but that requires the image to be downloaded to my computer, and will not work when i send the code to other people.

wn = turtle.Screen()
wn.setworldcoordinates(-100,-100,100,100)
alex = turtle.Turtle()
alex.color("green")
alex.ht()
alex.speed(10)

alex.up()
alex.goto(-95,-95)
alex.down()

def drawPattern(t):
    t.left(90)
    for i in range(4):
        for i in range(19):
            t.stamp()
            t.up()
            t.forward(10)
        t.right(90)


if pattern == "1":
    alex.shape('turtle')

elif pattern == "2":
    alex.shape('circle')

else:
    alex.shape('arrow')

drawPattern(alex)
Li ZhengYu
  • 11
  • 1
  • 2

1 Answers1

1

As it's python, packaging is not a real solution.

Your best bet is to send a .zip file with the pictures and the code file in it.

If you're using the turtle module, you likely aren't needing to delve into putting your images up on the web somewhere (imgur or other hosting site), then having your code download the image and then displaying it with the method you discussed above. You're welcome to learn about it here though: Downloading a picture via urllib and python

Community
  • 1
  • 1
duims
  • 40
  • 4