我有一個Python腳本在Github的要點,我可以從我的終端捲曲與我如何將參數傳遞給一個已經傳入Python進程的捲曲腳本?
curl -s https://gist.githubusercontent.com/.../script.py
腳本有被執行的一個主要功能,我可以管捲曲語句的輸出到Python,它執行腳本。
curl -s https://gist.githubusercontent.com/.../script.py | python
上述說明適用,但我想爲腳本提供一些命令行參數,而不必將其下載到文件中。我現在面臨的問題是Python的命令把它後面是什麼來執行,而不是作爲管道文件的參數中的任何文字,所以
curl -s https://gist.githubusercontent.com/.../script.py | python arg1 arg2
不工作,也沒有
curl -s https://gist.githubusercontent.com/.../script.py arg1 arg2 | python
如何將兩個參數傳遞給文件,作爲標準輸入或腳本可以讀取的命令行選項?
這工作完全按照我需要它。 – iamseiko