G
G
German2020-05-14 20:56:46
Python
German, 2020-05-14 20:56:46

How to get full paths to files in a folder?

Hello. There is a
directory on the desktop, it contains directories b and c , in each of the directories there are more directories with files or files. I need to get a list of absolute paths to these files. Something like

C:\Users\UserName\Desktop\a\file.txt
C:\Users\UserName\Desktop\a\b\file1.txt
C:\Users\UserName\Desktop\a\b\file2.txt
C:\Users\UserName\Desktop\a\c\d\file.txt

How can I do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2020-05-14
@mrjbom

https://docs.python.org/3/library/os.path.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question