I am not getting how to write the output of the command "show tunneled-node-mgr tunneled-nodes" to the file output.txt............ I tried the below but it doesnt work
import subprocess
f=open("output.txt","w")
subprocess.Popen("show tunneled-node-mgr tunneled-nodes",stdout=file)
But I got the error as
File "1.py", line 3, in <module>
subprocess.Popen("show tunneled-node-mgr tunneled-nodes",stdout=file)
File "/usr/lib64/python2.6/subprocess.py", line 642, in __init__
errread, errwrite)
File "/usr/lib64/python2.6/subprocess.py", line 1238, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
open
call is namedf
, so you needstdout=f
notstdout=file
I think?