Hi There,
If i using python, and i run this code, i can get new file with name "howtodownload.pdf)
import requests
URL = "https://www.codingem.com/python-download-file-from-url/"
response = requests.get(URL)
open("howtodownload.pdf", "wb").write(response.content)
NOW, my problem, i want to make st.button, when st. button clicked can download my url and then do some code.
saveto_gsheet=st.button("Save to Google Sheet")
if saveto_gsheet:
import requests
URL = "https://www.codingem.com/python-download-file-from-url/"
response = requests.get(URL)
open("instagram.pdf", "wb").write(response.content)
(and then some code to save to google sheet)
With this code, when i click button “Save to Google Sheet”, i can’t get my file (that code isn’t download my file). Why ?
If i not using st. button i can get that file, now if i using st.button i can’t get that file. thanks before