Removing pycache, and csv files after downloading

Hello there,
My Streamlit app has a feature that enables the user to download a CSV file of their dataframe, inspired by this great work here!

Every time I run to test the app, it automatically saves a copy from the CSV file into my Github repo, and I’m having an issue removing these downloaded files, as well as all the __pycache__ files from my Github repo after executing Streamlit app. I think I need to add something to my code that removes these files automatically after execution.

I don’t want to have a machine full of files, that’s it.
Not sure this is a Streamlit issue though, but I’d appreciate any help!

You can create a .gitignore file and add all the extensions or file name which you want to ignore while making a push to your GitHub repo. That should solve one of the issues. I don’t know about the file getting downloaded again.