Bash 卷曲并运行python脚本

Bash 卷曲并运行python脚本,bash,curl,Bash,Curl,要做到这一点,较短的方法是什么: wget https://bootstrap.pypa.io/get-pip.py sudo python get-pip.py ? 我试过这个: sudo <(python <(curl https://bootstrap.pypa.io/get-pip.py)) sudocurlhttps://bootstrap.pypa.io/get-pip.py |sudo python- curl将把给定的URL输出到标准输出 python-指出,该源

要做到这一点,较短的方法是什么:

wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py

我试过这个:

sudo <(python <(curl https://bootstrap.pypa.io/get-pip.py))

sudo
curlhttps://bootstrap.pypa.io/get-pip.py |sudo python-

curl
将把给定的URL输出到标准输出


python-
指出,该源代码将取自stdin。

安装pip的另一种方法:

sudo python-m ensurepip

-s
curl
的标志(静默)在您计划在某些自动化脚本或工具中使用时应该很有用,这样它就不会因为下载进度而责备您。