add first names from a cologne name registry csv

This commit is contained in:
AntonObersteiner 2024-06-02 21:16:21 +02:00
parent 8f06d4e1ee
commit dd525cec26
2 changed files with 11 additions and 1 deletions

View file

@ -4,6 +4,15 @@ from random import randint, random, choice
from choice_network import Choice, FixedText, RandInt, Network from choice_network import Choice, FixedText, RandInt, Network
def get_first_names():
lines = []
with open("vornamen.csv") as file:
lines = file.read().split("\n")
names = [
name + " "
for name in lines
]
return names
greeting = """ greeting = """
Englisch version below. Englisch version below.
@ -32,7 +41,7 @@ network = Network(
student = ["Student ", "Studentin ", "", "Studierende:r "], student = ["Student ", "Studentin ", "", "Studierende:r "],
), ),
student = Choice( student = Choice(
last_name = ["Anna ", "Anton ", "Amal "], last_name = get_first_names(),
matr_nr = [""], matr_nr = [""],
), ),
last_name = Choice( last_name = Choice(

1
vornamen.csv Symbolic link
View file

@ -0,0 +1 @@
../vornamen/vornamen.csv
1 ../vornamen/vornamen.csv