Advertisement
gauravssnl

scripts_in_current_dir

Sep 30th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. # scripts_in_current_dir.py
  2. #Print scripts in current working directory
  3. import sys,os
  4. def scripts_in_current_dir():
  5.     #get current working direcotory
  6.     path=os.getcwd()
  7.     #will be used for importing files later
  8.     sys.path.append(path)
  9.     # get files in current dir
  10.     files=os.listdir(path)
  11.     print files
  12.    
  13. scripts_in_current_dir()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement