I execute the following code in my "app.py" and it works, while session.execute
return not only the value of the cell but also characters like ()
and ,
.
var = db.session.execute(text(f"SELECT city FROM world WHERE country = Germany")).fetchone()
without using fetchone()
, the code showed me the memory address.
The output is ('Berlin',)
, How can I get only Berlin
?