/
githubmirror
/
cpython
Обзор
Документация
Войти
/
githubmirror
/
cpython
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
3.9
Tools/scripts/lll.py
27 строк
748 B
Zackery Spytz
bpo-14546: Fix the argument handling in Tools/scripts/lll.py (GH-13026)
02 май 2019, 18:03
02 май 2019, 18:03
c4e78b1
Код
Авторство
О чём код?
#! /usr/bin/env python3 # Find symbolic links and show where they point to. # Arguments are directories to search; default is current directory. # No recursion. # (This is a totally different program from "findsymlinks.py"!) import sys, os def lll(dirname): for name in os.listdir(dirname): if name not in (os.curdir, os.pardir): full = os.path.join(dirname, name) if os.path.islink(full): print(name, '->', os.readlink(full)) def main(args): if not args: args = [os.curdir] first = 1 for arg in args: if len(args) > 1: if not first: print() first = 0 print(arg + ':') lll(arg) if __name__ == '__main__': main(sys.argv[1:])