Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. s = str(input('Enter command'))
  2. if 'cd' not in s:
  3. out = os.popen(s).read()
  4. print(out)
  5. else:
  6. try:
  7. sh.cd(s[s.index("d")+2:])
  8. print(f'''Changed directory to {s[s.index("d")+2:]}''')
  9. except:
  10. print("Something went not right.....")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement