擅长:python、mysql、java
<p>在阅读了一些关于子进程的内容之后,我发现这些选项都不是立即有效的,因为我不仅需要使用Popen运行子进程,还需要使用<a href="https://docs.python.org/2/library/os.path.html#os.path.expanduser" rel="nofollow">Pathname expansion</a></p>
<p>最后我做了:</p>
<pre><code>subprocess.Popen([os.path.expanduser("My_File.bat")])
</code></pre>
<blockquote>
<p>expanduser will expand a pathname that uses ~ to represent the current
user's home directory. This works on any platform where users have a
home directory, like Windows, UNIX, and Mac OS X; it has no effect on
Mac OS.</p>
</blockquote>
<p>否则,我的应用程序将在关闭rdp会话后运行所有后续命令。这允许我独立于我的web应用程序运行多个子进程,并允许它同时响应</p>