1
我想創建一個運行PyPy的進程。我試過以下,它的工作原理:創建pypy進程
import os
os.chdir('<path-to-pypy-download>/bin/')
os.execl('pypy', 'pypy', '-c', 'print "Hi!"')
然而,當我刪除chdir
爲:
import os
os.execl('<path-to-pypy-download>/bin/pypy', 'pypy', '-c', 'print "Hi!"')
我得到:
debug: WARNING: Library path not found, using compiled-in sys.path.
debug: WARNING: 'sys.prefix' will not be set.
debug: WARNING: Make sure the pypy binary is kept inside its tree of files.
debug: WARNING: It is ok to create a symlink to it from somewhere else.
debug: OperationError:
debug: operror-type: ImportError
debug: operror-value: No module named os
請,沒有人知道如何釀出PyPy進程不改變工作目錄?
您是否嘗試過爲'arg0'和'path'傳遞完整路徑?因爲大概它使用(sys.argv [0])的(RPython /編譯爲C的等價物)來查找它的庫路徑。 – abarnert 2014-12-05 20:08:56