Professional Documents
Culture Documents
Query
Query
But actually i want to redirect its output to a file in that case it did not work
as expected
as shown:
filename=sys.argv[1]
os.system("ls -l $filename > file_info")
f=open("file_info","r")
str1=f.read()
print(str1)
this code should give details of file that i pass in command line arg
but its giving details of all the files in that directory
i.e
instead of giving output for:
ls -l $filename
please help.