aboutsummaryrefslogtreecommitdiff
path: root/examples/src/main/python/streaming/hdfs_wordcount.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/src/main/python/streaming/hdfs_wordcount.py')
-rw-r--r--examples/src/main/python/streaming/hdfs_wordcount.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/src/main/python/streaming/hdfs_wordcount.py b/examples/src/main/python/streaming/hdfs_wordcount.py
index f7ffb53796..f815dd2682 100644
--- a/examples/src/main/python/streaming/hdfs_wordcount.py
+++ b/examples/src/main/python/streaming/hdfs_wordcount.py
@@ -25,6 +25,7 @@
Then create a text file in `localdir` and the words in the file will get counted.
"""
+from __future__ import print_function
import sys
@@ -33,7 +34,7 @@ from pyspark.streaming import StreamingContext
if __name__ == "__main__":
if len(sys.argv) != 2:
- print >> sys.stderr, "Usage: hdfs_wordcount.py <directory>"
+ print("Usage: hdfs_wordcount.py <directory>", file=sys.stderr)
exit(-1)
sc = SparkContext(appName="PythonStreamingHDFSWordCount")