Encoding `$` sign when reading a plain text file

Hello,
I’m using the example (st.file_uploader - Streamlit Docs) to upload a plain text file.

The file contains the $ sign (the file is about currencies). However, when displayed using st.write, every word or character after the $ sign appear in italic.

Is there a special encoding needed, or some options when using st.file_uploader ?

thanks in advance for any help.
Regard.

Python 3.11.4
streamlit : 1.26.0

Hey @jonathanbouchet , thanks for posting.
You can use st.text instead of st.write to write the text as it is without any formating.

1 Like

It works file for me
I have used both st.text() and st.write()

image

1 Like

thanks for the help.
using st.text fixes the formatting.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.