擅长:python、mysql、java
<p>当您通过Python<a href="https://docs.python.org/3.9/library/subprocess.html" rel="nofollow noreferrer">^{<cd1>}</a>调用运行它时,您可以<strong>指定一个工作目录</strong>:</p>
<pre class="lang-py prettyprint-override"><code>import subprocess
# Possibly put this into a loop to analyse all your files
subprocess.run("pyreverse -AS -o png " + filePath + " -p " + fileName, shell=True, cwd="path/to/output/directory")
</code></pre>
<p>请注意,如果您的<code>filePath</code>s是相对的,那么您可能需要更正它(在它前面加上<code>../</code>)s。在</p>