i have this function
pymssql.connect(host=”my host”,user=”my user”,password=”my pass”,database=”mydb”)
I want to read the user and password from the user and put them there is that possible or named arguments lvalue should not be variable and if yes then how could i do that ?
i.e is it possible to call this function like:
pymssql,connect(host=varaible,…)
Your question is worded… strangely. Are you having trouble with setting default arguments in a function definition?
If that wasn’t what you were looking for, did you want to prompt the user for a missing argument?
Using a sentinel value of None for a missing argument is the idiomatic way in Python to detect a missing argument and execute another function.