From 8ecab48e20c5898a83ba86389353fb8d0e910f72 Mon Sep 17 00:00:00 2001 From: rasbt Date: Sat, 28 Jun 2014 15:32:39 -0400 Subject: [PATCH] python implementation added --- ipython_magic/watermark.ipynb | 25 +++++++++++++++++++++++-- ipython_magic/watermark.py | 11 +++++++---- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/ipython_magic/watermark.ipynb b/ipython_magic/watermark.ipynb index 7e137e4..542227e 100644 --- a/ipython_magic/watermark.ipynb +++ b/ipython_magic/watermark.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:fca7570e5ddd2ad9995dcf8f622de267860c7dac6cb0b275efffc900a181ebd7" + "signature": "sha256:b293f22eb716f74ec27869a5122812437e0a7f4743ddfe8c06a94c39f31c7d3e" }, "nbformat": 3, "nbformat_minor": 0, @@ -81,6 +81,26 @@ ], "prompt_number": 1 }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%install_ext ./watermark.py" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Installed watermark.py. To use it, type:\n", + " %load_ext watermark\n" + ] + } + ], + "prompt_number": 1 + }, { "cell_type": "markdown", "metadata": {}, @@ -205,9 +225,10 @@ "output_type": "stream", "stream": "stdout", "text": [ - "28/06/2014 14:08:08\n", + "28/06/2014 15:29:14\n", "\n", "Python 3.4.1\n", + "Python implementationCPython\n", "IPython 2.1.0\n", "\n", "compiler : GCC 4.2.1 (Apple Inc. build 5577)\n", diff --git a/ipython_magic/watermark.py b/ipython_magic/watermark.py index d54a074..aaff64e 100644 --- a/ipython_magic/watermark.py +++ b/ipython_magic/watermark.py @@ -2,7 +2,7 @@ Sebastian Raschka 2014 watermark.py -version 1.0.0 +version 1.0.1 IPython magic function to print date/time stamps and various system information. @@ -50,7 +50,7 @@ class WaterMark(Magics): """ IPython magic function to print date/time stamps and various system information. - + """ @magic_arguments() @argument('-d', '--date', action='store_true', help='prints current date') @@ -68,6 +68,8 @@ class WaterMark(Magics): IPython magic function to print date/time stamps and various system information. + watermark version 1.0.1 + """ self.out = '' args = parse_argstring(self.watermark, line) @@ -111,7 +113,8 @@ class WaterMark(Magics): def _get_pyversions(self): if self.out: self.out += '\n\n' - self.out += 'Python %s\nIPython %s' %( + self.out += '%s %s\nIPython %s' %( + platform.python_implementation(), platform.python_version(), IPython.__version__ ) @@ -134,4 +137,4 @@ class WaterMark(Magics): def load_ipython_extension(ipython): - ipython.register_magics(WaterMark) \ No newline at end of file + ipython.register_magics(WaterMark)