How to execute? [closed]
- by Viswa
Possible Duplicate:
how to read the password from variable?
I did the below code in my python script,but its not work.
#! /usr/bin/python
import os
address = "rsync -avrz [email protected]:/opt/script/python/data/ /opt/script/python/data/"
passwd ="my server password"
os.system('%(address)s "echo %(passwd)s"' %locals())
it throws below error.
If arg is a remote file/dir, prefix it with a colon (:).
rsync error: syntax or usage error (code 1) at main.c(1236) [Receiver=3.0.7]
If i run os.system('%(address)s' %locals()) means it work without any error but it ask password. I need that password should be read from my passwd variable.
How to write python script to read server password from my variable.