0

I have a python cgi script, wherein after user enters the details in a form, it is sent to python script for processing and returns throwing a message in the browser. Before throwing a message to the browser, i want to call a python script which runs in the background and sends out mail once its task is completed. Any idea how to call a python script from another python script in the background?

Iowa
  • 2,171
  • 4
  • 22
  • 31

2 Answers2

1

You could use the subprocess module for that, or use a task queue like Celery.

Fabian
  • 4,160
  • 20
  • 32
0

Look at this answer on how to use the subprocess modul for async calls.

Community
  • 1
  • 1
Sigroad
  • 1,771
  • 3
  • 20
  • 17