Guest User

Untitled

a guest
Feb 19th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import os
  2.  
  3. def listnewdir():
  4. for i, filename in enumerate(os.listdir(d)):
  5. print (i+1),filename
  6.  
  7. def listdir():
  8. for i, filename in enumerate(os.listdir('/')):
  9. print (i+1),filename
  10.  
  11. listdir()
  12.  
  13. l=os.listdir('/');
  14. c = input("Choose a number: ")
  15. c = c-1
  16. if c > 26:
  17. print("no such option")
  18. else:
  19. print l[c]
  20.  
  21. d=[]
  22. d = l[c]
  23. d = list(d)
  24. d[1:]=list('/')
  25. print d
  26.  
  27. listnewdir()
Add Comment
Please, Sign In to add comment