import os import random numpage=10 colors = ['red','pink','purple'] for i in range(numpage): print "\\section{}" print "\\Huge\\textbf{dT(Y)Tb}" print "\\newline" print "\\Huge\\textbf{Feed The Bears!}" print "\\begin{picture}(0,0)" for c in range(random.randint(1, 50)): randomop=str(random.randint(1,10)/10.0) randomcolor=colors[random.randint(0,2)] os.system('convert -size 100x60 xc:transparent -fill '+randomcolor+' -stroke white -draw "polygon 0,'+str(random.randint(0, 60))+' '+str(random.randint(0, 100))+',0 60,'+str(random.randint(0, 60))+' 100,'+str(random.randint(0, 60))+'" -flatten draw_polygon'+str(c)+'.gif') os.system('autotrace -corner-threshold 1000 draw_polygon'+str(c)+'.gif -output-file draw_polygon'+str(c)+'.pdf') print "\\put("+str(random.randint(0, 30)/10.0)+","+str(random.randint(0, 50)/-10.0)+"){" print "\\includegraphics[scale=1, angle="+str(random.randint(0,360))+"]{draw_polygon"+str(c)+".pdf}" print "}" print "\\put("+str(random.randint(0, 30)/10.0)+","+str(random.randint(0, 50)/-10.0)+"){" print "\\includegraphics[scale="+str(random.randint(1, 100)/100.0)+", angle="+str(random.randint(0,360))+"]{i/a/utils/graphics/blank/black.pdf}" print "}" print "\\end{picture}" print "\\newpage"