mirror of
https://gitlab.com/oloturia/fumcaso.git
synced 2024-11-01 01:38:16 +01:00
Added random text generator, started a few lines of the random text file
This commit is contained in:
parent
68c5dfc21d
commit
86d3f0794f
2 changed files with 53 additions and 7 deletions
24
randstrip.py
Normal file → Executable file
24
randstrip.py
Normal file → Executable file
|
@ -1,9 +1,17 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from PIL import ImageFont
|
from PIL import ImageFont
|
||||||
from PIL import ImageDraw
|
from PIL import ImageDraw
|
||||||
import csv
|
import csv
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
def fetchText(indText):
|
||||||
|
with open("rtext.csv") as rtext:
|
||||||
|
csvReader = csv.reader(rtext)
|
||||||
|
for row in csvReader:
|
||||||
|
if (row[0]==indText):
|
||||||
|
return row[random.randint(1,len(row)-1)]
|
||||||
|
|
||||||
def fetchVign():
|
def fetchVign():
|
||||||
starts = []
|
starts = []
|
||||||
startdest = []
|
startdest = []
|
||||||
|
@ -24,12 +32,18 @@ def fetchVign():
|
||||||
nvign +=1
|
nvign +=1
|
||||||
return story
|
return story
|
||||||
|
|
||||||
def writeStrip():
|
def writeStrip(story):
|
||||||
vign = Image.open("A00.png")
|
for indVign in story:
|
||||||
|
if indVign!="000":
|
||||||
|
vign = Image.open(indVign)
|
||||||
addtext = ImageDraw.Draw(vign)
|
addtext = ImageDraw.Draw(vign)
|
||||||
fnt = ImageFont.truetype("ubuntu.ttf",16)
|
fnt = ImageFont.truetype("ubuntu.ttf",16)
|
||||||
addtext.text((268,77),"egadrg",fill="#000000",font=fnt)
|
textVign = fetchText(indVign)
|
||||||
return vign
|
print(textVign)
|
||||||
|
addtext.text((268,77),textVign,fill="#000000",font=fnt)
|
||||||
|
vign.show()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
fetchVign()
|
#story = fetchVign()
|
||||||
|
#writeStrip(story)
|
||||||
|
writeStrip(["A00.png"])
|
||||||
|
|
32
rtext.csv
Normal file
32
rtext.csv
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
A00.png,Che giornata \ndel cacchio\n oggi,C'è nessuno?,Come vorrei\nundolciume,Il telefono non prende,Hey!,Bobby; dove sei?,Ciccioli di mare
|
||||||
|
A01.png,
|
||||||
|
A02.png,
|
||||||
|
A03.png,
|
||||||
|
A04.png,
|
||||||
|
A05.png,
|
||||||
|
A06.png,
|
||||||
|
A07.png,
|
||||||
|
A08.png,
|
||||||
|
A09.png,
|
||||||
|
A10.png,
|
||||||
|
A11.png,
|
||||||
|
A12.png,
|
||||||
|
B00.0.png,
|
||||||
|
B00.1.png,
|
||||||
|
B00.2.png,
|
||||||
|
B01.png,
|
||||||
|
B02.png,
|
||||||
|
B03.png,
|
||||||
|
B04.png,
|
||||||
|
B05.png,
|
||||||
|
B06.png,
|
||||||
|
B07.png,
|
||||||
|
B08.png,
|
||||||
|
B09.png,
|
||||||
|
B10.png,
|
||||||
|
B11.png,
|
||||||
|
B12.png,
|
||||||
|
B13.png,
|
||||||
|
B14.png,
|
||||||
|
B15.png,
|
||||||
|
B16.png,
|
|
Loading…
Reference in a new issue