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

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -