tutorialsPythonBasic.basic.files.list_files_in_folder module

An example on how to list all files and folders inside a directory. Keep in mind that the paths are relative, so you need to run this file from inside the folder it is located in for the tests to work.

tutorialsPythonBasic.basic.files.list_files_in_folder.list_files_and_folders(folder='')[source]

Lists files and folders in the (relative) folder by the name ‘folder’. If you don’t specify a folder, it is called on the current directory.

>>> list_files_and_folders('example_folder')
a.txt
b.txt
c.txt
folder
tutorialsPythonBasic.basic.files.list_files_in_folder.list_files_only(folder='')[source]

Lists only files in the (relative) folder by the name ‘folder’. If you don’t specify a folder, it is called on the current directory.

>>> list_files_only('example_folder')
a.txt
b.txt
c.txt