shell调用python权限不足_使用权限从python运行shell脚本

我有一个最简单的脚本update.sh#!/bin/sh

cd /home/pi/circulation_of_circuits

git pull

当我用./update.sh从终端调用它时,我得到一个已经是最新的或者它像预期的那样更新文件。在

我还有一个python脚本,在scip中是:

subprocess.call(['./update.sh'])

当它调用相同的脚本时,我得到:Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

(我使用SSH)。在

----------------更新------------------

有人在找我:OK so some progress. When I boot your image I can't run git pull in

your repo directory and the bash script also fails. It seems to be

because the bitbucket repository is private and needs authentication

for pull (the one I was using was public so that's why I had no

issues). Presumably git remembers this after you type it in the first

time, bash somehow tricks git into thinking it's you typing the

command subsequently but running it from python isn't the same.

I'm not a git expert but there must be some way of setting this up so

python can provide the authentication.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值