0

I have very little python experience but currently playing with PIL (Python Image Library) I am trying to get a variable printed to a screen but cant seem to get it to work. I have tried several things but nothing has worked yet, this is just test code but I'm trying to get it to display the count.

x=0
while x < 100:
    noki.cls
    time.sleep(1)
    im = Image.new('1', (84,48))
    draw = ImageDraw.Draw(im)
    draw.line((0,10, 84,10), fill=1)
    draw.text((30,0), "JEFF", fill=1)
    draw.text((20,10), "count: %x", fill=1)
    x = x + 1
    noki.show_image(im)
    del draw
    del im

Thanks for the help!

1 Answer 1

2
draw.text((20,10), "count: %s" % x, fill=1)

For more information, read about python's string interpolation.

Sign up to request clarification or add additional context in comments.

Comments

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.