The argument after > is not part of the command line passed to python. It is the file that the shell writes standard output to. So, for example, print "Hello"
will write Hello to flippedpattern.ppm.
If you want flippedpattern.ppm to be the fourth command line argument, just leave out the > in the call. (Then, standard output will be written to the screen.)
Edit: Given your modified description, you can write sys.stdout.write(method.flip())
. The only difference between this and print(method.flip())
is that print adds a newline character at the end of the string, while .write doesn't.