spacepaste

  1.  
  2. Jython 2.7b1+ (default:a984d658882a, Oct 1 2013, 12:02:56)
  3. [OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.7.0_21
  4. Type "help", "copyright", "credits" or "license" for more information.
  5. >>> from org.python.util import PythonInterpreter
  6. >>> from java.lang import System
  7. >>> PythonInterpreter.initialize(System.getProperties(), System.getProperties(), ["one", "two"])
  8. >>> pi = PythonInterpreter()
  9. >>> pi.exec("import sys; print(sys.argv)")
  10. ['']
  11. >>> import sys
  12. >>> sys.argv = ["setting the host vm argv"]
  13. >>> pi.exec("import sys; print(sys.argv)")
  14. ['setting the host vm argv']
  15.