日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

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

發布時間:2025/3/15 python 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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脚本的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。