发布时间:2019-09-18 07:24:51编辑:auto阅读(1594)
import os from subprocess import Popen,PIPE sqlplus = Popen(["sqlplus", "-S", "andy/root"], stdout=PIPE, stdin=PIPE) sqlplus.stdin.write("select sysdate from dual;"+os.linesep) sqlplus.stdin.write("insert into t_python values(1,'chenlong');"+os.linesep) sqlplus.stdin.write("insert into t_python values(2,'xiao');"+os.linesep) sqlplus.stdin.write("select count(*) from t_python;"+os.linesep) sqlplus0.stdin.write("select count(*) from emp;"+os.linesep) out, err = sqlplus.communicate() print out sqlplus0 = Popen(["sqlplus", "-S", "scott/root"], stdout=PIPE, stdin=PIPE) out0, err0 = sqlplus0.communicate() print out0
上一篇: Python -- str 类
下一篇: python版wc
47840
46387
37279
34731
29312
25970
24909
19949
19541
18026
5790°
6411°
5926°
5960°
7063°
5911°
5942°
6437°
6404°
7776°