Advertisement
gauravssnl

Dir&file.py

Nov 29th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. import os
  2. d="C:\\"
  3. print [f for f in os.listdir(d)
  4.     if os.path.isdir(os.path.join(d,f))]
  5. print "Ok"    
  6. print [f for f in os.listdir(d)
  7.     if os.path.isfile(os.path.join(d,f))]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement