Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- def listnewdir():
- for i, filename in enumerate(os.listdir(d)):
- print (i+1),filename
- def listdir():
- for i, filename in enumerate(os.listdir('/')):
- print (i+1),filename
- listdir()
- l=os.listdir('/');
- c = input("Choose a number: ")
- c = c-1
- if c > 26:
- print("no such option")
- else:
- print l[c]
- d=[]
- d = l[c]
- d = list(d)
- d[1:]=list('/')
- print d
- listnewdir()
Add Comment
Please, Sign In to add comment