import os
def getfile():
path = r'.'
file_list = os.listdir(path)
for file_name in file_list:
if os.path.splitext(file_name)[1] == '.py':
print file_name
if __name__ == '__main__':
getfile()
def getfile():
path = r'.'
file_list = os.listdir(path)
for file_name in file_list:
if os.path.splitext(file_name)[1] == '.py':
print file_name
if __name__ == '__main__':
getfile()