Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Jeff Wincek
- import Image, ImageDraw, math, ImageFilter, random
- # needs a file with a long number in it to run
- # or some other way to generate numbers
- f = open('numString.txt')
- numberString = str(f.read())
- #print numberString
- worldSize = (172,172)
- im = Image.new('L',worldSize,"white")
- draw = ImageDraw.Draw(im)
- stringLength = len(numberString)
- holdOver = 0
- #print numberString
- def printSomeLines(currentX,currentY):
- for k in range(0,stringLength):
- try:
- draw.point((currentX,currentY), fill = int(numberString[k]) * 10)
- except ValueError:
- print "caught error"
- k+=1
- if currentX+1 < worldSize[0]:
- currentX +=1
- else:
- currentY += 1
- currentX = 0
- print "currentY = " + str(currentY)
- return currentY
- for w in range(0,(stringLength / worldSize[0])/worldSize[1]):
- if w == 0:
- howMany = printSomeLines(0,0)
- else:
- printSomeLines(0,w*howMany)
- #while holdOver+15 < worldSize[1]:
- # holdOver = holdOver+ printSomeLines(0,holdOver)
- # print holdOver
- im.show()
- print "length of input string:" + str(stringLength)
- #comment to stop scrolling
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement