使用 .join 我从数据库收集一个字符串
示例:
st.write(f"{' '.join(str(conn.query(f'SELECT department_name from view_personals WHERE id = {df_search.iloc[people].index[0]+1};')).split()[2:])} \n")
我得到以下输出:
some example text to de...
但是在数据库中:
some example text to demonstrate the error
如何修复?(获得完整输出)
结果 = conn.query(f'从 view_personals 中选择部门名称,其中 id = {df_search.iloc[people].index[0]+1};')
部门名称 = 结果[0]['部门名称']
st.write(部门名称)