1
0
Fork 0
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:
oloturia 2019-09-12 19:53:57 +02:00
parent 68c5dfc21d
commit 86d3f0794f
2 changed files with 53 additions and 7 deletions

24
randstrip.py Normal file → Executable file
View 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
View 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,
1 A00.png,Che giornata \ndel cacchio\n oggi,C'è nessuno?,Come vorrei\nundolciume,Il telefono non prende,Hey!,Bobby; dove sei?,Ciccioli di mare
2 A01.png,
3 A02.png,
4 A03.png,
5 A04.png,
6 A05.png,
7 A06.png,
8 A07.png,
9 A08.png,
10 A09.png,
11 A10.png,
12 A11.png,
13 A12.png,
14 B00.0.png,
15 B00.1.png,
16 B00.2.png,
17 B01.png,
18 B02.png,
19 B03.png,
20 B04.png,
21 B05.png,
22 B06.png,
23 B07.png,
24 B08.png,
25 B09.png,
26 B10.png,
27 B11.png,
28 B12.png,
29 B13.png,
30 B14.png,
31 B15.png,
32 B16.png,