Exemple #1
0
def createYaml(filepath,username,password,fname,lname,age,gender,hobby):
	personDict = dict(
		Username = username,
		Password = password,
		FirstName = fname,
		LastName = lname,
		Age = age,
		Gender = gender,
		Hobby = hobby,
		Admin = False
		)
	with open(filepath, 'w') as outfile:
		newAcc = outfile.write(yaml.dump(personDict,default_flow_style=False) )
	return newAcc
def createYaml(filepath, username):
    with open(filepath, 'w') as outfile:
        newAcc = outfile.write(
            yaml.dump(personDict[username], default_flow_style=False))
    return newAcc
def dumpYaml(filepath, option):
    with open(filepath, 'w') as outfile:
        newAttb = outfile.write(yaml.dump(option, default_flow_style=False))
    return newAttb
def createYaml(filepath,username):
    with open(filepath, 'w') as outfile:
        newAcc = outfile.write(yaml.dump(personDict[username],default_flow_style=False) )
    return newAcc
def dumpYaml(filepath, option):
    with open(filepath, 'w') as outfile:
        newAttb = outfile.write(yaml.dump(option,default_flow_style=False) )
    return newAttb