2020-10-21 00:22:25 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
import os
|
|
|
|
import random
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
cur_dir = Path(os.path.abspath(__file__)).parent
|
|
|
|
|
|
|
|
# Noms et prénoms les plus fréquents en France:
|
|
|
|
NOMS = [x.strip() for x in open(cur_dir / "noms.txt").readlines()]
|
|
|
|
PRENOMS_H = [x.strip() for x in open(cur_dir / "prenoms-h.txt").readlines()]
|
|
|
|
PRENOMS_F = [x.strip() for x in open(cur_dir / "prenoms-f.txt").readlines()]
|
|
|
|
|
|
|
|
|
|
|
|
def nomprenom(sexe):
|
2020-11-11 22:05:29 +01:00
|
|
|
"""un nom et un prenom au hasard,
|
|
|
|
toujours en majuscules.
|
|
|
|
"""
|
2020-10-21 00:22:25 +02:00
|
|
|
if "e" in sexe.lower() or "f" in sexe.lower():
|
|
|
|
prenom = random.choice(PRENOMS_F)
|
|
|
|
else:
|
|
|
|
prenom = random.choice(PRENOMS_H)
|
2020-11-11 22:05:29 +01:00
|
|
|
return random.choice(NOMS).upper(), prenom.upper()
|