reprise du code et renommages

This commit is contained in:
rep
2017-08-25 17:06:32 +02:00
parent 1987401616
commit 103687984a
27 changed files with 1136 additions and 4 deletions

42
motif.py Normal file
View File

@@ -0,0 +1,42 @@
#!/usr/bin/python
# coding: utf-8
import sys
import Image
import random
import os
import ImageDraw
import ImageFont
import ImageFilter
from time import gmtime, strftime
# MILLISECONDES
from datetime import datetime
dt = datetime.now()
dt.microsecond
heure = str(dt.hour)+"h"+str(dt.minute)+"m"+str(dt.second)+"s"+str(dt.microsecond)+"ms"
image = Image.new("1", (512,512,), "white")
h = image.size[0]
l = image.size[1]
img = ImageDraw.Draw(image)
n = 0
ecart = 4
tranches = h / ecart
while n < tranches :
rx = random.randint(0,l/2)
img.rectangle(((rx,n*tranches),(rx+l/2,n*tranches+tranches)),"white")
n = n + 1
img.save(heure+".png",'PNG', quality=100)
def txt(strii):
print strii