Forums

How to create a folder on desktop while in python anywhere

I want to create folder on my desktop when a user click a certain route and save a receipt in the the said folder. How do i go about that? My program creates the folder in the website instead of out of the website. Any ideas??

Your web app on PythonAnywhere runs on remote server, not on your computer. It can't write to your desktop.

You won't be able to force something to download onto a users desktop, but you can trigger a 'normal' download (i.e what happens when you click 'download' on any other website' which will place the file can in the user's Downloads folder (or any folder they chose from the download popup from their browser). This example shows you how to create and download a csv file but you can adapt it to whatever file you're trying to get the user to download.

nice, thanks for explaining in more detail!

No problem, I spent a long time a while ago trying to get downloads to work for my stock database (my username is quite self-explanatory...) to export csv, xlsx and pdf reports and the Django docs were surprisingly helpful :P

I have a script that writes to a csv (direct file path on my computer). Can I just upload the csv to PythonAnywhere, then change the file path in my script to a location that will work on PythonAnywhere?

As you've been asking about this on another forum thread, I've answered there.

i am unable to download video from pytube in my pc after hosting at pythonanywhere..downloaded video saved in pythonanywhere's directory not in user pc.

please suggest the codes for views.py

PythonAnywhere cannot write to your local pc's disk. If you want to download the file to your pc, you can do that from the Files tab.