fibonaccios/bin/ls.py

20 lines
423 B
Python
Raw Normal View History

2022-11-29 19:46:03 -08:00
import os
def get_app_class(template):
class App(template):
def F_main(self):
2022-11-30 12:34:25 -08:00
if len(self.argv) == 1:
directory = "."
else:
directory = self.argv[1]
try:
for file in os.listdir(directory):
print(file)
except OSError as e:
print(str(e))
2022-11-29 19:46:03 -08:00
self.exit()
return App