Skip to content

Instantly share code, notes, and snippets.

@Nilom
Nilom / async_subprocess_tornado.py
Last active January 25, 2018 19:01
Async subprocess for Tornado.
#!/usr/bin/env python2.7
#-*- coding=utf-8 -*-
import shlex
import subprocess
from tornado.gen import coroutine, Task, Return
from tornado.process import Subprocess
from tornado.ioloop import IOLoop
@coroutine
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
Usage: python -m SimpleHTTPServerWithUpload 8888
"""