Wednesday, 2 February 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?"

2 comments:

  1. I usually prefer:

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

    ReplyDelete