User working directory

I already have a program written in PySimpleGUI; now, as my first learning exercise, I am re-writing it in Streamlit.

In the PySimpleGUI version, when picking the input file (Browser button), it comes in with full path: directory and filename. Then, I know where to place output files.

When running the Streamlit version locally (after typing “streamlit run .py”), the file_uploader reports the filename without a path…How can I found out where the input file came from, so I can write resulting output files in the same directory?

Hey @gsal,

Thanks for sharing!

To get the path, you’d need to create a st.text_input and ask the user to share the path.

Feel free to upvote/share your thoughts on the official GitHub Issue here for adding functionality to st.file_uploader to make the file’s path accessible.