摘要:
s=" a b c "" ".join(s.split())awesome python! 阅读全文
posted @ 2011-12-29 17:55
eshizhan
阅读(2739)
评论(0)
推荐(0)
摘要:
run a command as root using sudo from Python: 1 import subprocess 2 3 def mypass(): 4 mypass = '123' #or get the password from anywhere 5 return mypass 6 7 echo = subprocess.Popen(['echo',mypass()], 8 stdout=subprocess.PIPE, 9 )10 11 sudo = ... 阅读全文
posted @ 2011-12-29 09:59
eshizhan
阅读(3430)
评论(0)
推荐(1)
浙公网安备 33010602011771号