0

I need to execute Altair Accelerator, previously known as NetworkComputer (NC), through python script. My shell command is: nc run -q vnc01 run -C TEST -wl -I -r+ CORES/32 -r+ RAM/150000 -- /bin/tcsh I have tried this code:

with open('test.txt', 'w') as f:
    process = subprocess.Popen(['nc run',' -q vnc01  run -C TEST -wl -I -r+ CORES/32 -r+ RAM/150000 -- /bin/tcsh'], stdout=f)

Returned the following error:

Traceback (most recent call last):   File "nc.py", line 11, in <module>
    process = subprocess.Popen(['nc run',' -q vnc01 run -C TEST -wl -I -r+ CORES/32 -r+ RAM/150000 -- /bin/tcsh'], stdout=f)   File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)   File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception OSError: [Errno 2] No such file or directory Exit 1
1
  • why python 2.7 ? Commented Oct 3, 2021 at 17:32

1 Answer 1

0

You need to split the command arguments properly:

process = subprocess.Popen([
    'nc',
    'run', '-q', 'vnc01',
    'run', '-C', 'TEST',
    '-wl', '-I',
    '-r+', 'CORES/32',
    '-r+', 'RAM/150000',
    '--',
    '/bin/tcsh'
], stdout=f)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.