I am using python make some of the SQL queries I have to for my JDBC connections more modular and would like to execute parts of my string literals with print statements.
fh = open("data.txt","w")
print("42 is the answer, but what is the question?", file=fh)
fh.close()
I know I can use this to write to text but I would like to save the outputs of my print in a local variable to call later in other statements.
Is this possible?