View Single Post
Old 05-08-2015, 04:13 PM   #4
rflrob
Member
 
Location: Berkeley, CA

Join Date: May 2010
Posts: 50
Default

I'm not familiar with this "do" module you seem to be using, but I'm pretty sure that passing a list is the equivalent of spaces on the command line. For instance, in the original cuffdiff call, it's not "cuffdiff, -o, diff_out4, ...". So you can see that the syntax in python isn't exactly the same as the command that gets generated. Thus, you really do want that comma there.

More generally, Python doesn't know how to combine the two variables if there's no comma between them. Depending on the type (which the syntax parser doesn't know in advance), you could want to concatenate them (if strings), multiply them (if they're numbers), or do something else entirely. Recall the Zen of Python: "In the face of ambiguity, refuse the temptation to guess." Since the syntax could be ambiguous, it instead throws a syntax error.
rflrob is offline   Reply With Quote