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
• 880 points
493 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

+1 vote
2 answers

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

class Solution:     def firstAlphabet(self, s):             self.s=s              k=''              k=k+s[0]              for i in range(len(s)):                     if ...READ MORE

answered Oct 28, 2020 in Python by Anurag
12,374 views
+5 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
17,550 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 13, 2019 in Python by Usha
22,456 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, 2019 in Python by Neel
• 3,020 points
4,355 views
0 votes
2 answers
+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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,422 views
0 votes
1 answer
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
4,042 views
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
654 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
685 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP