Store os.system( 'curl -u "username:password" "https://<url>") in a python variable to stream data in another framework? -
i lookup on internet using curl. automated using python script take ip argument , further run curl using that.
i tried following:
maxm = os.system('curl -u "username : password " %s' %url)
but still output gets displayed on terminal , not value variable maxm
.
i tried subprocess.popen
. dint work though.
seeking resolve this.
regards richa
you use subprocess.pipe
, easiest way use subprocess.check_output
import subprocess maxm = subprocess.check_output('curl -u "username : password " %s' % url)
Comments
Post a Comment