I want to ask the shell to display a csv file in a nice format in my python script. So I wrote the following:
printout = "column -s, -t < output.csv | less -#2 -N -S " subprocess.call(printout.split(), shell = False) The error I get is:
column: invalid option -- '#' I have a rough idea that it is something to do with shell=False; however when I set it to True and run in cmd line, it puts me into another line and I have to ctrl+C to get out.
shell=Falsemeans you don't have a shell, so there's nothing that knows how to process redirections (<) or pipes (|). It's actually better to useshell=False, but it means you need to do more of your setup in Python.