#jython IRC Log (v0.9)


IRC Log for 2011-12-10

Timestamps are in GMT/BST.

[0:11] * stakkars_ (~tismer@ Quit (Read error: Operation timed out)
[1:26] * juneau001 (~juneau@ has joined #jython
[1:36] * shashank (~shashank@ucb-np2-84.colorado.edu) Quit (Ping timeout: 252 seconds)
[1:53] * shashank (~shashank@ucb-np2-84.colorado.edu) has joined #jython
[2:19] * diminoten (~diminoten@reddit/operator/diminoten) has left #jython
[3:25] * shashank (~shashank@ucb-np2-84.colorado.edu) Quit (Ping timeout: 252 seconds)
[3:52] * r0bby_ (~wakawaka@guifications/user/r0bby) has joined #jython
[3:55] * r0bby (~wakawaka@guifications/user/r0bby) Quit (Ping timeout: 240 seconds)
[5:20] * shashank (~shashank@65-101-219-90.hlrn.qwest.net) has joined #jython
[6:12] * offbyone (u910@gateway/web/irccloud.com/x-tlluobnhwejpmduv) has joined #jython
[6:31] * juneau001 (~juneau@ Quit (Quit: juneau001)
[9:08] * stakkars_ (~tismer@p5DDB72FD.dip.t-dialin.net) has joined #jython
[9:12] * stakkars (~tismer@p5DDB7E68.dip.t-dialin.net) Quit (Ping timeout: 252 seconds)
[9:12] * stakkars_ is now known as stakkars
[9:32] * shashank (~shashank@65-101-219-90.hlrn.qwest.net) Quit (Ping timeout: 252 seconds)
[14:08] * juneau001 (~juneau@ has joined #jython
[15:22] * Shapeshifter (~Shapeshif@unaffiliated/shapeshifter) has joined #jython
[15:23] <Shapeshifter> Hi there. One thing I'm not sure about: Is Jython only for writing python code and accessing python libs from Java or can I also use it to access Java libs from Python? As in; I'd like to write only Python but I may need a Java lib here and there, is Jython the thing I need?
[15:25] <agronholm> Shapeshifter: jython is for using java libs from python
[15:26] <Shapeshifter> agronholm: But I see indications that if I want to use Jython, I need to write everything in Jython.
[15:26] <agronholm> you mean in Python?
[15:27] <agronholm> and why?
[15:28] <Shapeshifter> No, that's just what I read on the internet. Jython code looks like Python code, but it runs in jvm. I mean, can I write normal Python (e.g. I need to use CherryPy and stuff like that), but then also write a module in Jython and use this module from my regular Python application?
[15:28] <agronholm> Jython is just an implementation of the Python language in a JVM
[15:29] <agronholm> so I don't understand what you mean by writing something in Jython
[15:29] <Shapeshifter> agronholm: Okay let's say I write an application in Python, I run it in Python, it's Python. Now I want to use a library which is only available for Java. What do I do?
[15:30] <agronholm> write your module so it imports and uses said java library
[15:30] <Shapeshifter> Do I now need to run all of my python code in JVM and as Jython, or can I continue to run my Python code using the normal cpython implementation, but also import a module I wrote for Jython which will run in JVM.
[15:30] <agronholm> and run it with Jython
[15:30] <Shapeshifter> agronholm: okay so the answer is: If I want to profit of Jython's capabilities of using java libs, I need to run the whole program as Jython.
[15:31] <agronholm> Shapeshifter: I recommend that you use py4j instead
[15:31] <agronholm> if you only need to use a couple java libs
[15:31] <Shapeshifter> agronholm: ahh, nice. thank you.
[15:31] <agronholm> jython is for deeper integration of java and python
[15:32] <agronholm> be warned though, py4j has a design flaw in its protocol that causes bytestreams to be corrupted
[15:32] <agronholm> I think the protocol is pretty idiotic
[15:32] <agronholm> I use py4j for generating printouts with JasperReports
[15:32] <agronholm> my application runs on cpython otherwise
[15:32] <Shapeshifter> Mhh.
[15:33] <Shapeshifter> I'm not sure yet if I need any Java classes, just checking my options. Of course I'd like to avoid them best I can.
[15:33] <agronholm> so I ended up having the jvm write the data into a file and then cpython read and delete it afterwards
[15:33] <Shapeshifter> thanks for your advice.
[15:34] <Shapeshifter> well, when it doubt, you could always wrap the java lib in a little service (e.g. webservice) or whatever
[15:34] <agronholm> you need to run tomcat or similar then
[15:35] <Shapeshifter> yeah. well it does get big.
[15:35] <Shapeshifter> Mh, if I do use Jython for everything, can I still use all python libraries?
[15:36] <agronholm> not the ones that depend on C extensions
[15:36] <agronholm> also, some stdlib modules are either stubbed out or unavailable
[15:36] <agronholm> due to jvm limitations
[15:37] <Shapeshifter> I see.
[15:38] <Shapeshifter> Seems like JPype is something similar to Py4J
[15:38] <agronholm> jpype is ancient history
[15:38] <Shapeshifter> ah
[16:09] * stakkars_ (~tismer@p5DC4680D.dip0.t-ipconnect.de) has joined #jython
[16:32] * SinZ is now known as SinZ|offline
[17:05] * stakkars_ (~tismer@p5DC4680D.dip0.t-ipconnect.de) Quit (Quit: schnarch)
[17:53] * shashank (~shashank@65-101-219-90.hlrn.qwest.net) has joined #jython
[19:48] * shashank (~shashank@65-101-219-90.hlrn.qwest.net) Quit (Ping timeout: 244 seconds)
[21:21] * thijstriemstra (~thijs@5249260E.cm-4-2a.dynamic.ziggo.nl) has joined #jython
[21:22] * thijstriemstra (~thijs@5249260E.cm-4-2a.dynamic.ziggo.nl) has left #jython
[21:31] * shashank (~shashank@ucb-np2-84.colorado.edu) has joined #jython
[22:46] * shashank (~shashank@ucb-np2-84.colorado.edu) Quit (Ping timeout: 240 seconds)
[23:00] * thijstriemstra (~thijs@5249260E.cm-4-2a.dynamic.ziggo.nl) has joined #jython
[23:59] * SinZ|offline is now known as SinZ


These logs were automatically created by JythonLogBot_ on irc.freenode.net using a slightly modified version of the Java IRC LogBot (github).