def set_guy_profiles(self): for root, dirs, files in os.walk('data/guys'): #### les profiles sont dans 'data_test' for name in files: doc = os.path.join(root, name) try: with open(doc, 'r') as f: profile = json.load(f) guy = man(profile) self.guys.append(guy) except Exception as e: print(" *** Erreur :", e, doc)
def set_guy_profiles(self): for root, dirs, files in os.walk( 'data/guys'): #### les profiles sont dans 'data_test' for name in files: doc = os.path.join(root, name) try: with open(doc, 'r') as f: profile = json.load(f) guy = man(profile) self.guys.append(guy) except Exception as e: print(" *** Erreur :", e, doc)
def set_profiles(self): for name in male_names: guy = man(name) guy.set_results(subjects_guy) guy.set_standards(subjects_girl) self.guys.append(guy) for name in female_names: girl = woman(name) girl.set_results(subjects_girl) girl.set_standards(subjects_guy) self.girls.append(girl) self.capacity[girl.name] = girl.capacity
female_names = ['claire', 'solène', 'anna', 'marion'] subjects_guy = [ 'french', 'english', 'maths', 'physiques', 'biology', 'spanish', 'phylosophy', 'economy', 'sport' ] subjects_girl = [ 'international', 'price', 'prestige', 'doubledegree', 'accessibility', 'campus' ] guys = [] girls = [] for name in male_names: guy = man(name) guy.set_results(subjects_guy) guy.set_standards(subjects_girl) guys.append(guy) for name in female_names: girl = woman(name) girl.set_results(subjects_girl) girl.set_standards(subjects_guy) girls.append(girl) guyprefers = {} galprefers = {} for guy in guys: guy.grade(girls) guy.classify()
from profile import man, woman # il faut que le fichier "profile.py" soit placé dans le même dossier que "gender.py" import random male_names = ['lucien', 'pierre bastard' ,'andréas', 'clément', 'léo', 'adrien', 'pierre', 'remi', 'dan', 'tom', 'bob', 'thomas', 'louis', 'nicolas', 'hyppolite'] female_names = ['claire', 'solène', 'anna', 'marion'] subjects_guy = ['french', 'english', 'maths', 'physiques', 'biology', 'spanish', 'phylosophy', 'economy', 'sport'] subjects_girl = ['international', 'price', 'prestige', 'doubledegree', 'accessibility', 'campus'] guys = [] girls = [] for name in male_names: guy = man(name) guy.set_results(subjects_guy) guy.set_standards(subjects_girl) guys.append(guy) for name in female_names: girl = woman(name) girl.set_results(subjects_girl) girl.set_standards(subjects_guy) girls.append(girl) guyprefers = {} galprefers = {} for guy in guys: