Thursday, February 3, 2011

Solution : raise TypeError("bufsize must be an integer")

Error : subprocess.call(['vim'],['/home/patelm/.bashrc'])

Solution: subprocess.call(['vim','/home/patelm/.bashrc'])


Whenever you're running subprocess.call and you see this
error, say to yourself: "Have I passed the command line
as one parameter in a list; or have I passed it as a series
of parameters?"

4 comments:

paurullan said...

I usually prefer:

command = "find /tmp -name '*.jpg'"
subprocess.call(command.split())

Mihir said...

Thanks.. That's a good idea

Dana said...

Wow, thank you!

Anonymous said...

Thank you for your message!