here is wht I came up with. thanks mawe for your code :-) is their a max size I can set the font?
#!/usr/bin/env python
#
# readit
#
from Tkinter import *
import random
adj = ('red', 'green', 'yellow', 'blue', 'pink', 'orange', 'purple')
numbers = ( 'one','one','one','one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine')
animals = ('bird', 'teacher', 'cow', 'goat', 'pig', 'dog', 'duck', 'cat', 'sister', 'grandmother', 'friend')
phrase = ('is in a car', 'is on a bike', 'is in a boat', 'is on a train', 'is on skates', 'is on a plane', 'is on a horse')
have = ('school','teacher','classroom','table','book','work')
# I have %s(numbers) %s(adj) %s(have)%s(either "" or 's')
format1 = "I have %s %s %s%s"
# The %s(number) %s(animals)%s(either "", or 's') %(phrase)
format2 = "%s %s%s %s."
def choices():
radj = random.choice(adj)
rnumbers = random.choice(numbers)
ranimals = random.choice(animals)
rphrase = random.choice(phrase)
rhave = random.choice(have)
return radj, rnumbers, ranimals, rphrase, rhave
def one_format(choice):
ret = choice
if ret[1] != 'one':
quant = 's.'
else:
quant = '.'
return format1%(ret[1],ret[0],ret[4],quant)
def second_format(choice):
ret = choice
if ret[1] != 'one':
quant = 's'
else:
quant = ""
sentence = format2%(ret[1].title(),ret[2],quant,ret[3])
if quant == 's':
sentence = sentence.replace(' is ',' are ')
return sentence
def make_sentence():
if random.choice(range(2)) == 0:
return second_format(choices())
else:
return one_format(choices())
# this following code was giving to me my mauve
# I changed the sizes around a bit
def draw_text():
text = make_sentence()
c.delete("all")
c.create_text(500,100,text=text,font="arial 100 bold")
root = Tk()
c = Canvas(width=1000,height=200,bg="white")
c.pack()
Button(text="Next Text", command=draw_text).pack()
root.mainloop()