Skip to content

Instantly share code, notes, and snippets.

@bartdag
bartdag / README.md
Created October 22, 2017 01:06
Py4J - Multiple GatewayServer and CallbackServer instances

Py4J Multiple GatewayServer and CallbackServer instances

Compile and run TestApplication.java with py4j.jar in your classpath.

Then execute python3 test.py

Explanations

This creates three pairs of GatewayServer and CallbackServer with different ports on both the Java and Python sides. Python is driving the communication by asking Java to print

@evandrix
evandrix / pep20_by_example.py
Created March 13, 2012 18:45
PEP 20 (The Zen of Python) by example
#!/usr/bin/env python
"""
=====================================
PEP 20 (The Zen of Python) by example
=====================================
Usage: %prog
:Author: Hunter Blanks, hblanks@artifex.org / hblanks@monetate.com