擅长:python、mysql、java
<p>这真的是你想要的吗</p>
<pre><code>import os.path
import subprocess as sp
AVL_FOLDER_PATH = '~/Desktop/AVL_VLM'
AVL_EXE_NAME = 'avl335'
avl_path = os.path.join(AVL_FOLDER_PATH, AVL_EXE_NAME)
def avl_command(cmd):
return sp.run(cmd, capture_output=True, shell=True)
ret = avl_command(['open ', avl_path])
ret = avl_command(['LOAD','/Users/vianneydubois/Desktop/AVL_VLM/test_gen.avl'])
</code></pre>
<p>或者你的意思是:</p>
<pre><code>ret = avl_command('open' + avl_path + '; LOAD /Users/vianneydubois/Desktop/AVL_VLM/test_gen.avl')
print(ret.stdout.decode())
</code></pre>