Forums

SMTP daily email sent to a CSV (UTF-8) on my PC

I run a python script every morning that sends an email to a list of my website subscribers. The script re-writes the CSV file (on my PC) every time with an updated list of all the email addresses, and subscription statuses. I don't want to re-write my python script to use SQL instead of the CSV. How would I go about this? Is this even possible? I want to automate this daily sending so I don't have to wake up at 6 AM everyday (the emails are time sensitive).

What part of that runs on PythonAnywhere?

It's just a single script. Nothing is running on PythonAnywhere yet. I want PythonAnywhere to run this script every M-F at the same time. The problem is that the script references a direct file path to the csv on my PC. I don't want to rewrite everything to an SQL. Can I just upload the csv file to PythonAnywhere and make a change to the file's path in the script? How would I go about solving this issue?

The script functionality: 1. scrapes web 2. https request 3. writes to csv 4. sends emails to that csv

Sure, you could certainly change your code so that it writes to a CSV file with a path that is valid on PythonAnywhere, like /home/mperryolive/myfile.csv.

One potential issue with your script as you describe it is that it might not work in a free account; free accounts have only restricted Internet access to specific whitelisted public APIs.