I have a piece of code I'm trying to write. It is sort of like a lot of functions in one program. I'm giving it the form of a person. So I want to have different "accounts" in it that can change some things in it. This is what I have so far.
from peewee import *
import datetime
from getpass import getpass
db = SqliteDatabase("Butler_knows.db")
class User(Model):
name = TextField()
password = TextField(), IntegerField()
class Meta:
database = db
db.connect()
New_not = raw_input("Do I know you? ")
if New_not.strip().upper() == "NO":
new_name = raw_input("What is your name? ")
new_user = raw_input("What would you like me to call you? ")
passwordcreate = getpass("What would you like your password to be? ")
So what I want to know is, is there a way to use the input from "new_name" and use it as the variable for the dictionaries? This is using the peewee ORM. If you don't understand, this is what I mean.
Randomname = User.create(name="Randomname", username="Randomname123", password="RandomPass")
That is how you create a user if you want to program a name you want. What should I do if I want to use the user's input as the name of the variable?