mirror of
https://github.com/stardrophere/InsightRadar.git
synced 2026-06-06 00:52:50 +08:00
backend update
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import os
|
||||
|
||||
def print_tree(root, prefix=""):
|
||||
items = sorted(
|
||||
name for name in os.listdir(root)
|
||||
if name != "__pycache__"
|
||||
)
|
||||
total = len(items)
|
||||
|
||||
for i, name in enumerate(items):
|
||||
path = os.path.join(root, name)
|
||||
is_last = (i == total - 1)
|
||||
|
||||
connector = "└── " if is_last else "├── "
|
||||
print(prefix + connector + name)
|
||||
|
||||
if os.path.isdir(path):
|
||||
extension = " " if is_last else "│ "
|
||||
print_tree(path, prefix + extension)
|
||||
|
||||
root_dir = r"E:\ScnuProject\InsightRadar\backend\app" # 改成你的目录
|
||||
print(os.path.basename(root_dir) + "/")
|
||||
print_tree(root_dir)
|
||||
Reference in New Issue
Block a user