#!/usr/bin/env python #...for the path. import os #...for getting file information. import inspect #...for getting the files in the current directory. import glob # Get the path of the current directory path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) if __name__ == "__main__": print("*===========*") print("* test02.py *") print("*===========*") print("") print("* Current path is '%s'" % (path)) print("") print("* Found files:") # Loop over the files in the current directory. for fn in glob.glob(path + "/*"): print("*--> '%s'" % (fn)) print("")