我最近開始使用pew而不是virtualenvwrapper + virtualenv。如何在bash/Python/Fabric/sh腳本中使用pew?
在交互式shell中工作時,這是一個不錯的選擇。不過,我仍然在我的bash腳本中使用virtualenvwrapper [1],並且我正在考慮編寫一些支持virtualenv的Python腳本[2]。
鑑於pew workon
啓動了一個新提示,我可以在shell [3]和Python腳本中使用它嗎?如果是這樣,怎麼樣?
[1]使用下面的代碼片段,而這正是我試圖擺脫掉:
# make sure we can workon (the path is Ubuntu-specific)
[[ $(type -t workon) == "function" ]] || source /etc/bash_completion.d/virtualenvwrapper
[2]我仍在調查這普通的Python,Fabric和sh將最佳滿足我的需求。
[3]背地裏,我寧願在魚,而不是bash中使用它,但似乎深奧:)