python-envoy

How to use wildcards with Envoy

孤街醉人 提交于 2019-12-22 17:55:03
问题 I'm trying to run this command through KennethReitz's Envoy package: $ sqlite3 foo.db 'select * from sqlite_master' I've 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 & escaping doesn't seem to help. Any suggestions? FYI: This is what I had to do for now: cmd = "sqlite3

Using rm * (wildcard) in envoy: No such file or directory

梦想的初衷 提交于 2019-12-10 04:24:39
问题 I'm using Python and Envoy. I need to delete all files in a directory. Apart from some files, the directory is empty. In a terminal this would be: rm /tmp/my_silly_directory/* Common sense dictates that in envoy, this translates into: r = envoy.run('rm /tmp/my_silly_directory/*') However: r.std_err -> "rm: cannot remove `/tmp/my_silly_directory/*': No such file or directory" Naturally there are alternatives to using envoy in this case, I am simply wondering why it doesn't work. Any clues? 回答1

How to use wildcards with Envoy

痞子三分冷 提交于 2019-12-06 11:53:04
I'm trying to run this command through KennethReitz's Envoy package: $ sqlite3 foo.db 'select * from sqlite_master' I've 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 & escaping doesn't seem to help. Any suggestions? FYI: This is what I had to do for now: cmd = "sqlite3 %(database)s 'select * from sqlite_master'" % locals() os.system(cmd) Note that this is a contrived

Using rm * (wildcard) in envoy: No such file or directory

我们两清 提交于 2019-12-05 08:16:59
I'm using Python and Envoy. I need to delete all files in a directory. Apart from some files, the directory is empty. In a terminal this would be: rm /tmp/my_silly_directory/* Common sense dictates that in envoy, this translates into: r = envoy.run('rm /tmp/my_silly_directory/*') However: r.std_err -> "rm: cannot remove `/tmp/my_silly_directory/*': No such file or directory" Naturally there are alternatives to using envoy in this case, I am simply wondering why it doesn't work. Any clues? On UNIX, it's up to the shell to interpret wildcards like * . If you execute a program and pass an