You need to indent your code properly:
import os
for x in os.listdir("/home/"):
print x
More Related Contents:
- Does Python have a string ‘contains’ substring method?
- Find if 24 hrs have passed between datetimes
- Python JSON serialize a Decimal object
- List comprehension rebinds names even after scope of comprehension. Is this right?
- Syntax behind sorted(key=lambda: …)
- How do I sort unicode strings alphabetically in Python?
- How can I split and parse a string in Python?
- Iterating through list of list in Python
- Reversing a regular expression in Python
- Longest increasing subsequence
- What version of Visual Studio is Python on my computer compiled with?
- How does my input not equal the answer?
- How to remove whitespaces and newlines from every value in a JSON file?
- using Python logger class to generate multiple logs for different log levels
- multiprocessing.pool.MaybeEncodingError: ‘TypeError(“cannot serialize ‘_io.BufferedReader’ object”,)’
- Python and how to get text from Selenium element WebElement object?
- IPython: redirecting output of a Python script to a file (like bash >)
- How to make two plots side-by-side
- How should I write a Windows path in a Python string literal?
- Why does ENcoding a string result in a DEcoding error (UnicodeDecodeError)?
- Format numbers in django templates
- Saving and loading objects and using pickle
- Numpy sub-array assignment with advanced, mixed indexing
- How to find pg_config path
- TypeError: ‘WebElement’ object is not iterable error
- no module named urllib.parse (How should I install it?)
- BeautifulSoup getText from between , not picking up subsequent paragraphs
- Django Tastypie: How to Authenticate with API Key
- End of support for python 2.7?
- Speedup scipy griddata for multiple interpolations between two irregular grids