我想从 python 中获取 pw 值,比如
spawn python3 $pscript
expect "password:"
send "$enc_password\r"
set outcome $expect_out(buffer) --getting empty array in outcome
文件.py
import keyring
pw = keyring.get_password("system","user")
print(pw)
让我知道是否有其他方法可以做到这一点。