Skip to content

Commit

Permalink
Create generate_path.py
Browse files Browse the repository at this point in the history
  • Loading branch information
armync committed Feb 10, 2024
1 parent e3a9118 commit 9843818
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions sounds/generate_path.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import os
import sys

def generate_path(folder_path, output_file):
with open(output_file, 'w') as file:
for root, _, files in os.walk(folder_path):
relative_path = os.path.relpath(root, folder_path)

file.write(f"{relative_path.replace(os.path.sep, '/')}/\n")

for file_name in files:
file.write(f"{relative_path.replace(os.path.sep, '/')}/{file_name}\n")

if __name__ == "__main__":
if len(sys.argv) != 2:
print("python generate_path.py folder_path")
sys.exit(1)

main_folder_path = sys.argv[1]

output_file_name = 'sounds_path.txt'

generate_path(main_folder_path, output_file_name)

print(f"Written to {output_file_name}")

0 comments on commit 9843818

Please sign in to comment.