1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Python: How do I create images with text from a text file

Discussion in 'General Programming Chat' started by matt1972, Jan 6, 2013.

  1. matt1972

    matt1972 Regular Member

    Joined:
    Nov 19, 2009
    Messages:
    499
    Likes Received:
    206
    Occupation:
    To make money
    Location:
    192.168.0.1
    I'm looking for some python code or script that will do the following:

    Read a text file and randomly grab one line
    Take the text and create an image file with that text with random background color
    Be able to set how many times to loop (example: create 50 different images with 50 different random lines of text)

    Does anyone know how to do this in python or have a script that will do this?
     
  2. DreamBigWorkHard

    DreamBigWorkHard Registered Member

    Joined:
    Nov 20, 2012
    Messages:
    92
    Likes Received:
    11
    Occupation:
    Daydreamer
    It doesn't hurt to use google:

    http://stackoverflow.com/questions/2431345/text-to-a-png-on-app-engine-python