Environment: python 2.6
path="/this/is/an/example/"
cmd={'Foo': (PATH + 'sh forExample.sh'), 'blah': (PATH + 'sh secExample.sh')}
for app in cmd.keys():
print 'app name', app
它按预期打印Foo
但是,当我尝试访问“sh forExample.sh”时
for app in cmd.keys():
print 'app name', app
run_apps([app])
run_apps 函数看起来像这样..
def run_apps(apps):
for a in apps:
print a
cmdlist = cmd[a][0]
print cmdlist
它没有给出预期的输出,而是给出's'
. 我尝试改变 cmd[a][x] 中的值,它不断给出 X 指向的字符的值。
哦,这是错误:/bin/sh: 1: /: Permission denied
我正在使用Linux, distro: Ubuntu.
知道错误是什么吗?我要去哪里?