mysql - How can I supply a Bash variable to Python's getpass()? -
i calling python script supplied part of package bash script wrote, calls script in addition doing various other things. specifically, earlier on in bash script, use zenity password dialog user's mysql root password , store in bash variable database setup. later on, python script called, , wants user's mysql root password.
i tried reusing variable containing password using pipe , here string, neither works; script hangs there until return terminal , enter password again. dug bit python script , found uses getpass ask password. there way can give password previously-created bash variable have ask user once through gui?
if information allready present in bash variable (say name pwd), imho simplest solution export environment.
export pwd then can in python script :
pwd = os.environ('pwd')
Comments
Post a Comment