Reputation: 11
Hi I am trying to rum a C *.o using python 2.6.5 as follows
import os
import sys
file_type = os.command('./file_type.o %s.txt 2>&1' % file_name)
And, it gives the error message :
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'command'
Being a beginner this might be a very trivial question, I request for the direction / help.
Upvotes: 1
Views: 647
Reputation: 50620
os.command()
doesn't exist. It looks like you are looking for os.system()
Upvotes: 1
Reputation: 400572
There is no function named command
in the os
module, hence the error. You probably meant to call os.system()
instead.
Upvotes: 3