Python help 2 inputting functions

@whileTRUEpass because replit is limiting me now for another 3 hours im continuing the topic hear

im using your methed that is shown in the other topic

#compile/main
def getfuc(usernameinput,passinput):
	usernameinput=userentry.get()
	passwordinput=passentry.get()
#data
from replit import db
from compile import getfuc
keys = db.keys()
userinput1=compile.getfuc(usernameinput)
passinput1=compile.getfuc(passwordinput)
def createfuc():
	if userinput1 in keys:
		print("username allready exsist")
	else:
		db["key"] = "value"
		db["key"] = "value"
def enterfuc():
	if userinput1=="show-keys" and passinput1=="1234":
		print(keys)
		if userinput1 and passinput1 in keys:
			print("test1")
		else:
			print("username or password is incorect")

tho i am getting an error on the usernameinput and passwordinput variable. am i doing it wrong?

it is the other way around.

You code code stays in main.py and the helping functions in data.py. (assuming main.py is your application).Let me change a bit your code to give you a little help:

#data.py

def getfuc(userentry, passentry):
	return userentry.get(), passentry.get()

#main.py
from replit import db
import data

keys = db.keys()
userinput1, passinput1 = data.getfuc(usernameinput, passwordinput)

# i did not check the code after this point
# PS usernameinput, passwordinput are nowhere declared ....

def createfuc():
	if userinput1 in keys:
		print("username allready exsist")
	else:
		db["key"] = "value"
		db["key"] = "value"
def enterfuc():
	if userinput1=="show-keys" and passinput1=="1234":
		print(keys)
		if userinput1 and passinput1 in keys:
			print("test1")
		else:
			print("username or password is incorect")
1 Like