Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def ps(s: str, t: str, f: tuple) -> str:
- """Creating a parametric query substring"""
- r = s + " " + t + " " + str(f).replace("'", "") + " VALUES (" + ("?, " * len(f))[0:-2] + ")"
- return r
- s="INSERT INTO"
- t = "TableName"
- f = ('1', '2', '3')
- x = ps(s, t, f)
- print(x)
Add Comment
Please, Sign In to add comment