#!/usr/bin/env python import sys, hashlib, re, pathlib, subprocess class Program: def hub(): cmdentred = input("Welcome to the Hub. \n Please enter now a cmd. \n You have access to this options: \n 1. Install Repositories. (into sources.list) \n 2. Basic Languages & modules. (Auto Install)\n 3. \n 4. \n 5. \n 6. \n 7. \n 8. \n 9. \n 00. Exit ") if cmdentred == 1: interpreter.Srcls() elif cmdentred == 2: interpreter.BasicIns() elif cmdentred == 3: #Opt4 elif cmdentred == 4: #opt4 elif cmdentred == 5: #Opt5 elif cmdentred == 6: #Opt6 elif cmdentred == 7: #Opt7 elif cmdentred == 8 #Opt8 elif cmdentred == 9: #Opt9 elif cmdentred == 00 sys.exit() else: print("Sorry i didn't recognized your command. Please try again") class Interpreter: def Srcls(): Srcl = Path("/etc/apt/sources.list")œ if Srcl.is_file(): print("This script will now add the repo to your sources.") else: print("Verify sources.list exists and try agian.") sys.exit() Srcl = file.open("/etc/apt/sources.list" "a") print("Choose which Distro you have:"): Distro = raw_input if Distro == "Ubuntu": Srcl.write("#Source from program \n #Remove this comment and append changes.") program.hub() elif Distro == "Debian": Srcl.write("#Source from program \n #Remove this comment and append changes.") program.hub() elif Distro == "Kali": Srcl.write("#Source from program \n #Remove this comment and append changes.") program.hub() elif Distro == "Other": Srcl.write("Please send a message to the devs, we'll do our best to add your distro.") program.hub() else: print("Sorry i didn't recognized your command. Please try again") Srcls() program.hub() def BasicIns(): pkgentred = input"Choose between 1. modules 2. pkg.") if pkgentred == 1: subprocess.Popen('pip install cryptography requests future paramiko pandas', shell=True) program.hub() elif pkgentred == 2: subprocess.Popen('sudo apt-get update,' shell=True) subprocess.Popen('sudo apt-get upgrade', shell=True) subprocess.Popen('sudo apt-get install git clang golang', shell=True) print("Packages have been Updated, Installed & Upgraded successfully.") program.hub() else: print("Please re-enter i did'nt understood") BasicIns() program.hub() def
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question