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.
3 Answers 3
There is no function named command in the os module, hence the error. You probably meant to call os.system() instead.
answered Nov 4, 2014 at 5:12
Adam Rosenfield
403k103 gold badges524 silver badges600 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
os.command() doesn't exist. It looks like you are looking for os.system()
answered Nov 4, 2014 at 5:12
Comments
os.command doesn't exist, using os.system instead.
Comments
lang-py
os.command()is the way to do this?