samedi 2 janvier 2016

Is it possible to redirect the python output to web by using 'sys.stdout' command?

Is it possible to redirect the python output to web by using the redirecting command? I know that we can redirect the output like this

import sys
sys.stdout = open('file', 'w')
print 'test'

or

In terminal like this

$ python foo.py > file

I heard the 'Django' and 'Flask' like web framework can do the trick. I wonder whether by using a simple command like sys.stdout can redirect the output to web?




Aucun commentaire:

Enregistrer un commentaire