Advertisement
amaimon02

Install partuf

Aug 15th, 2019
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.00 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup
  3. import os
  4.  
  5. instalador = "node.msi"
  6. cmd = os.popen('npm').read()
  7. n = 0
  8.  
  9. if len(cmd) != 0:
  10.     os.system("cls")
  11.     pass
  12. else:
  13.     try:
  14.         print()
  15.         print("Caso seja seu primeiro uso, ignore erros")
  16.         print()
  17.         os.system(instalador)
  18.         n = 1
  19.         print()
  20.     except:
  21.         print("Instalador do node não encontrado!")
  22. print()
  23.  
  24. if n == 1:
  25.     exit()
  26. else:
  27.     pass
  28.  
  29. npm = "npm install -g peerflix"
  30.  
  31. cmd_peerflix = []
  32. cmd2 = os.popen('npm list -g --depth=0').read()
  33. picote = str(cmd2).split()
  34. for pic in picote:
  35.     pi = pic.find("peerflix")
  36.     if pi != -1:
  37.         cmd_peerflix = 10
  38.     else:
  39.         cmd_peerflix = 666
  40.  
  41. if cmd_peerflix == 10:
  42.     os.system("cls")
  43.     pass
  44. else:
  45.     try:
  46.         print()
  47.         print("Continuando a instalação...")
  48.         os.system(npm)
  49.         os.system("cls")
  50.         print()
  51.         print()
  52.     except:
  53.         print("Erro na instalação do peerflix")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement