How to use wildcards with Envoy

痞子三分冷 提交于 2019-12-06 11:53:04

You could use subprocess:

from subprocess import check_output as qx

output = qx(['sqlite3', 'foo.db', 'select * from sqlite_master'])
print output

Or sqlite3 module:

import sqlite3

conn = sqlite3.connect('foo.db')
for row in conn.execute('select * from sqlite_master'):
    print row

If you still want to use envoy then you could fix it as:

import envoy

r = envoy.run([["sqlite3", "foo.db", "select * from sqlite_master"]])
print r.std_out

This will not work in envoy because envoy splits the commands and pass them to subprocess. Even if you try with subprocess.Popen(command, shell = False) you will end up getting sqlite3 terminal. Both subprocess and envoy fails to address this, I will be happy if you can open an issue in envoy since I am contributing to it, I will be thinking about this.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!