Print contents of a folder

0 votes
How do I list all the contents of a directory/folder using python?
Jun 18, 2018 in Python by nightshade
• 870 points
29 views

1 answer to this question.

0 votes
There is a function provided in python for this-  check it out https://docs.python.org/2/library/os.html#os.listdir
answered Jun 18, 2018 by Hamartia's Mask
• 1,580 points

Related Questions In Python

0 votes
1 answer

How to print first character of each word in upper case of a string in Python

You can use split() using space as ...READ MORE

answered Jun 1, 2018 in Python by george
• 200 points
1,768 views
+2 votes
1 answer

Print the odd and even factors of a number in Python

x = int(input("Enter any number \n")) print("The factors ...READ MORE

answered Nov 19, 2018 in Python by Nabarupa
556 views
0 votes
1 answer

How to print the index of a Pandas Dataframe?

You can do this using the code ...READ MORE

answered May 12 in Python by Usha
44 views
+1 vote
1 answer

How to print a pyramid of asterisks in Python?

This is one of the most frequently ...READ MORE

answered Aug 1 in Python by Neel
• 3,010 points
30 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 216 views
+4 votes
6 answers
0 votes
1 answer

List all contents of a folder

Use listfor() from the os library READ MORE

answered Jun 22, 2018 in Python by Hamartia's Mask
• 1,580 points
26 views
0 votes
1 answer

Split a string into a list of characters

This is easy. Just use the list() ...READ MORE

answered Jun 19, 2018 in Python by Hamartia's Mask
• 1,580 points
22 views