Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. # Check if curl or wget commands exsit on your computer
  2. if sys.version_info >= (3,0):
  3. status_curl, result = subprocess.getstatusoutput('which curl')
  4. status_wget, result = subprocess.getstatusoutput('which wget')
  5. else:
  6. status_curl, result = commands.getstatusoutput("which curl")
  7. status_wget, result = commands.getstatusoutput("which wget")
  8.  
  9. if status_curl == 0:
  10. cmd='curl -g "'+cmd+'" -o '+ ncout
  11. elif status_wget == 0:
  12. cmd='wget "'+cmd+'" -O '+ ncout
  13. else:
  14. sys.exit('nThe script will need curl or wget on the system, please install them first before running the script !nProgram will exit now !n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement