I am trying to run this command through the Enew package for KennethReitz:
$ sqlite3 foo.db 'select * from sqlite_master'
I tried this:
r = envoy.run("sqlite3 foo.db 'select * from sqlite_master'") sqlite3: Error: too many options: "*"
and this:
r = envoy.run(['sqlite3', 'foo.db', 'select * from sqlite_master']) AttributeError: 'NoneType' object has no attribute 'returncode'
additional quoting and escaping doesn't seem to help. Any suggestions?
FYI: This is what I should have done now:
cmd = "sqlite3 %(database)s 'select * from sqlite_master'" % locals() os.system(cmd)
Please note that this is a contrived example and that most of the unix shell commands that I would like to issue are not just simple choices that can be easily made using SQLAlchemy.
source share