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.
總結
以上是生活随笔為你收集整理的shell调用python权限不足_使用权限从python运行shell脚本的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用vl_sift提取图像特征
- 下一篇: 高斯混合模型 GMM