You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ma...@apache.org on 2013/09/01 23:59:51 UTC
[67/69] [abbrv] git commit: Add banner to PySpark and make wordcount
output nicer
Add banner to PySpark and make wordcount output nicer
Project: http://git-wip-us.apache.org/repos/asf/incubator-spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-spark/commit/bbaa9d7d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spark/tree/bbaa9d7d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spark/diff/bbaa9d7d
Branch: refs/heads/branch-0.8
Commit: bbaa9d7d6e2eef59ff58f97af69dbc5e1cdff82d
Parents: 12495ec
Author: Matei Zaharia <ma...@eecs.berkeley.edu>
Authored: Sat Aug 31 22:38:32 2013 -0700
Committer: Matei Zaharia <ma...@eecs.berkeley.edu>
Committed: Sun Sep 1 14:13:16 2013 -0700
----------------------------------------------------------------------
python/examples/wordcount.py | 2 +-
python/pyspark/shell.py | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/bbaa9d7d/python/examples/wordcount.py
----------------------------------------------------------------------
diff --git a/python/examples/wordcount.py b/python/examples/wordcount.py
index a6de227..b9139b9 100755
--- a/python/examples/wordcount.py
+++ b/python/examples/wordcount.py
@@ -32,4 +32,4 @@ if __name__ == "__main__":
.reduceByKey(add)
output = counts.collect()
for (word, count) in output:
- print "%s : %i" % (word, count)
+ print "%s: %i" % (word, count)
http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/bbaa9d7d/python/pyspark/shell.py
----------------------------------------------------------------------
diff --git a/python/pyspark/shell.py b/python/pyspark/shell.py
index 9b4b4e7..54823f8 100644
--- a/python/pyspark/shell.py
+++ b/python/pyspark/shell.py
@@ -21,6 +21,7 @@ An interactive shell.
This file is designed to be launched as a PYTHONSTARTUP script.
"""
import os
+import platform
import pyspark
from pyspark.context import SparkContext
@@ -28,6 +29,18 @@ from pyspark.context import SparkContext
add_files = os.environ.get("ADD_FILES").split(',') if os.environ.get("ADD_FILES") != None else None
sc = SparkContext(os.environ.get("MASTER", "local"), "PySparkShell", pyFiles=add_files)
+
+print """Welcome to
+ ____ __
+ / __/__ ___ _____/ /__
+ _\ \/ _ \/ _ `/ __/ '_/
+ /__ / .__/\_,_/_/ /_/\_\ version 0.8.0
+ /_/
+"""
+print "Using Python version %s (%s, %s)" % (
+ platform.python_version(),
+ platform.python_build()[0],
+ platform.python_build()[1])
print "Spark context avaiable as sc."
if add_files != None: