2 years ago

#69434

test-img

LoganLee

How to run a binary file with python script

Code: terminal

./foldx_20221231 --command=Stability --pdb=./input_file.pdb --out-pdb=1

Code: python

import os
import subprocess

# path
input_file='./input_file.pdb'
path_foldx_scores_out=f'{path_input_file}/foldx.fxout'
path_foldx='Tool/foldx5/foldx_20221231'
path_foldx_softlink=f'{source}/foldx_20221231'

# 10-1.run foldx
with open(path_foldx_scores_out, 'w') as out_stream:
    os.symlink(path_foldx, path_foldx_softlink)
    execute_foldx=subprocess.Popen([path_foldx_softlink, '--command=Stability', f'--pdb={input_file}', '--out-pdb=1'], stdout=out_stream) 
    execute_foldx.wait()

Created files: terminal

input_file_0_ST.fxout, rotabase.txt

Created file: python

foldx.fxout

(context in foldx.fxout file)
No pdbs for the run found at:
"./"
Foldx will end

I'm trying to get result by running the foldx binary file with python script, not terminal. When I tried to execute foldx on terminal, it works well enough. However, with python script, I couldn't get the results like the results from terminal. Could you let me know what can I do in this situation?

python

binary

operating-system

subprocess

popen

0 Answers

Your Answer

Accepted video resources