> # code to get filename from either sys.argv or raw_input

Another common approach would be to just read sys.stdin.