感覺Python的變長參數還蠻好用的,記錄下,方便查詢。
def selectsql(self, sqlstr, *condition):
arr = sqlstr.split("?")
return
rs = ""
for i in range (len(arr)-1):
rs += arr[i] + str(condition[i])
for key in condition:
print(key,condition[key])