sh 1 sudo未发现在ubuntu上完成的python脚本在bananian上不起作用
我在ubuntu上做了一个脚本,现在我想让它在我的香蕉皮上运行,使用bananian(raspbian代表香蕉皮)。 以下是我的脚本中存在一些问题的部分:sh 1 sudo未发现在ubuntu上完成的python脚本在bananian上不起作用,python,sh,sudo,raspbian,banana-pi,Python,Sh,Sudo,Raspbian,Banana Pi,我在ubuntu上做了一个脚本,现在我想让它在我的香蕉皮上运行,使用bananian(raspbian代表香蕉皮)。 以下是我的脚本中存在一些问题的部分: foundmob= False foundusb= False sudoPassword='figaro'#my sudo password command="usb_modeswitch -v 12d1 -p 1f01 -M '55534243123456780000000000000011062000000100000000000000
foundmob= False
foundusb= False
sudoPassword='figaro'#my sudo password
command="usb_modeswitch -v 12d1 -p 1f01 -M '55534243123456780000000000000011062000000100000000000000000000'" # the command that for ce the modem to be on serial mode
while foundusb!= True : # this allows me to look for the modem as an usb and then force it
foundmob=terminalComAndRead("lsusb",'12d1:1f01')#doing a ls usb and then looking for the id of my device
changemob=terminalComAndRead("lsusb",'12d1:1001')#this is the id of my device when it is already in serial mode
if foundmob == True :
os.system('echo %s|sudo -S %s' % (sudoPassword, command))# this is the line who execute the command on sudo
当我在ubuntu中执行这个脚本时,我没有任何问题,但是当我想用我的香蕉pi在bananian上执行它时,我得到以下错误:
sh:1:sudo:未找到
错误似乎来自这一行:
os.system('echo %s|sudo -S %s' % (sudoPassword, command))# this is the line who execute the command on sudo
所以尝试在sudo上运行它,并在另一个登录(而不是sudo)中运行它。但它仍然不起作用。有人有主意吗?Thx可能sudo它不在路径中或未安装 该错误消息表示python脚本找不到
sudo
命令。bananian安装是否有sudo
命令?您需要sudo
来获得usb\u modeswitch
命令所需的特权吗?我想我需要。脚本的这一部分,我是在我的ubuntu上完成的,我记得我需要使用sudo来完成。谢谢你,你说得对!但我想我以前在航站楼用过sudo。像sudo一样容易得到。。。但无论如何,谢谢你!