0

Running a daily scheduled python file using PythonAnywhere. By default, when running python files under Tasks, it runs the python file in a python interpreter terminal, instead of the bash terminal.

The file uses the python subprocess module, to output commands to the terminal. In this case, I want to create a log after the event and upload it github.

Using PythonAnywhere Tasks, how can I instruct the scheduling to run the file in the bash terminal instead of the python interpreter.

isherwood
  • 58,414
  • 16
  • 114
  • 157
stiction
  • 13
  • 5
  • Do you mean pythonanywhere scheduled tasks? https://help.pythonanywhere.com/pages/ScheduledTasks/ You can run the bash command or script there. – Filip Feb 02 '21 at 09:13
  • I added !#/bin/bash to the top of the script as suggested here, but it's still not working https://stackoverflow.com/questions/13872048/bash-script-what-does-bin-bash-mean – stiction Feb 02 '21 at 21:53
  • 2
    PythonAnywhere creates log files for you -- you'll find them in `/var/log/`. Can you specify what you actually need (it's not a common thing to keep log files under version control) or show relevant bits of your code? – caseneuve Feb 03 '21 at 09:31

0 Answers0