Hey chums. i want to create a list of files in a specific directory in my renpy project. such as images/ I've tried doing it pythonically but keep running into issues with absolute and relative file paths.
I've no doubt that someone has solved this but the search function doesn't appear to be working for me.
any help would be appreciated.
Listing the contents of a specific directory
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Re: Listing the contents of a specific directory
Ok I figured something out. For those people who want to know how I did it
Code: Select all
listing = renpy.list_files(common=False)
for f in listing:
if f.startswith("[path of folder you want to search]"):
print f (or do whatever you want)
Who is online
Users browsing this forum: Google [Bot], Majestic-12 [Bot], Toma