Commits

Shashank Bharadwaj committed 28cadf6

adding intro about Jython

Comments (0)

Files changed (2)

+# use glob syntax.
+syntax: glob
+
+*.elc
+*.pyc
+*~
+*\#
+*.\#*

pycon-2013/slides.md

   - Using Java scripting API provided via JSR-223
   - Object factories
 
+Java is (almost) first class in Jython
+======================================
+
+Directly use Java objects
+
+    >>> from java.lang.System import out
+    >>> out.println('Hello World')
+    Hello World
+
+
+Imported Java classes are Mutable [1]
+-------------------------------------
+
+    public class PyCon {
+      private String year;
+
+      public PyCon(String year) {
+          this.year = year;
+      }
+
+      public String getYear() {
+          return this.year;
+      }
+    }
+
+Imported Java classes are Mutable [2]
+-------------------------------------
+
+    >>> import PyCon
+    >>> def greeting(self):
+    ...     print 'Welcome to PyCon %s' % self.getYear()
+    ...
+    >>> PyCon.greeting = greeting
+    >>> p = PyCon('2013')
+    >>> p.greeting()
+    Welcome to PyCon 2013
+