2024-03-28 15:54:34 发布
网友
我想从python中获取pw值,类似于
spawn python3 $pscript expect "password:" send "$enc_password\r" set outcome $expect_out(buffer) --getting empty array in outcome
file.py
import keyring pw = keyring.get_password("system","user") print(pw)
如果还有其他方法,请告诉我
我只是错过了一件事:
spawn python3 $pscript expect "password:" send "$enc_password\r" expect "blah" this extra expect, else the outcome will be an empty array set outcome $expect_out(buffer)
我只是错过了一件事:
相关问题 更多 >
编程相关推荐