asynchronous subprocess Popen python 3.5
<p>I am trying to asynchronously run the Popen command from subprocess, so that I can run other stuff in the background.</p>

<pre><code>import subprocess
import requests
import asyncio
import asyncio.subprocess    

    async def x(message):
        if len(message.content.split()) &gt; 1:
            #output = asyncio.create_subprocess_shell(message.content[3:], shell=True, stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
            output = subprocess.Popen(message.content[3:], shell=True, stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
            return output.communicate()[0].decode('utf-8')
</code></pre>

<p>I have tried to understand <a href="https://docs.python.org/3/library/asyncio-subprocess.html" rel="nofollow">https://docs.python.org/3/library/asyncio-subprocess.html</a> but i am not sure what a protocol factory is.</p>

<p>I eventually found the answer to my question, which utilizes async.
<a href="http://pastebin.com/Zj8SK1CG" rel="nofollow">http://pastebin.com/Zj8SK1CG</a></p>

python asynchronous subprocess python-3.5