Trying to backup the sqlite db using a python script using subprocess. I get the following error message: File Not Found: 'sqlite3 /home/<myusername>/<djangoapp>/db.sqlite3 ".backup \'/home/<myusername>/<djangoapp>/db_backup_20231205\'"'
The following Python statement works in Python on Windows, but fails per the noted error message in Python Anywhere when the .py file is run.
process_output = subprocess.run('sqlite3 /home/<myusername>/<djangoapp>/db.sqlite3' + '".backup \'/home/<myusername>/<djangoapp>/sqlite3_backup/db_backup_20231205\'"')
The following (one line) command works in Python Anywhere from the bash console: sqlite3 /home/<myusername>/<djangoapp>/db.sqlite3 ".backup '/home/<myusername>/<djangoapp>/sqlite3_backup/db_backup_20231205'"
Guessing the problem has something to do with the string escape character "\" processing problem