cmd1 = 'psql -h hello.com -p 5433 -U hell_ro-d hello-c \"COPY (SELECT info1,info2,info3,info4 FROM logs_info WHERE info1 > \''+str(timing)+'\' and info1 < clock_timestamp() ORDER BY info1 desc limit 100) TO STDOUT With CSV HEADER\" > filedetails.csv'
答案 0 :(得分:0)
您可以使用os.system
运行shell命令:
$ python -c 'from os import system; system("cat >/dev/stderr <<<\"shelly stuff\"")'
shelly stuff