#jython IRC Log (v0.9)

Index

IRC Log for 2011-08-04

Timestamps are in GMT/BST.

[0:05] * rcbart (cb1e6364@gateway/web/freenode/ip.203.30.99.100) has joined #jython
[0:05] <rcbart> got a problem with jython, can anyone help?
[0:07] <rcbart> I am trying to import java swing components into my jython project and getting an import error, no module name javax.swing
[0:07] <rcbart> I am using Eclipse 3.7
[0:08] <rcbart> the same problem occurs when I try to run the same command line in native python
[0:10] <MacRohard> you have like from javax.swing import *; ?
[0:10] <agronholm> of course native python will give you that error
[0:10] <MacRohard> 'cause that seems to work for me..
[0:10] <agronholm> native python cannot access java libs
[0:10] <agronholm> cpython that is
[0:10] <MacRohard> oh well yea
[0:11] <rcbart> yes that is the case
[0:13] <rcbart> if I add the following to my python file in eclipse "from java.lang import Math"
[0:13] <rcbart> I can not call the math functions in the package
[0:14] <agronholm> what happens if you try
[0:15] <rcbart> I get an unresolved import error on "Math"
[0:15] <agronholm> and you are sure that your jython interpreter is configured correctly and set for that project?
[0:15] <rcbart> no, I am not sure of that
[0:15] <MacRohard> rcbart, Jython 2.5.2 (Release_2_5_2:7206, Mar 2 2011, 23:12:06)
[0:15] <MacRohard> [OpenJDK Client VM (Sun Microsystems Inc.)] on java1.6.0_0
[0:15] <MacRohard> Type "help", "copyright", "credits" or "license" for more information.
[0:15] <MacRohard> >>> from javax.swing import *;
[0:15] <MacRohard> >>>
[0:15] <MacRohard> >>> win = JWindow()
[0:15] <MacRohard> >>> win.setSize(200,200)
[0:15] <MacRohard> >>> win.setVisible(1)
[0:15] <MacRohard> err crap. meant to paste the pastebin, not that
[0:16] <MacRohard> but anyway, that opens a window
[0:17] <rcbart> I have set the interpreter as c:\Python27\python.exe
[0:17] <agronholm> wha?
[0:17] <MacRohard> so you are using cpython
[0:17] <agronholm> and you're wondering why you can't import Java stuff?!?
[0:18] <rcbart> yes
[0:18] <agronholm> what do you think jython was made for?
[0:18] <rcbart> I am, and being new to jython and python as a whole, thats where I learn from
[0:18] <agronholm> you should start with the jython book
[0:19] <rcbart> I assumed that it was configuration issue in the filepath
[0:19] <agronholm> http://www.jython.org/jythonbook/en/1.0/index.html
[0:19] <agronholm> you don't need cpython at all
[0:19] <agronholm> just jython
[0:19] <agronholm> have you even downloaded it?
[0:20] * thobe (~Adium@63-235-13-3.dia.static.qwest.net) has joined #jython
[0:20] <rcbart> yes I have
[0:21] <agronholm> installed?
[0:21] <agronholm> if so, configure jython in pydev and set it as your project's interpreter
[0:21] <agronholm> then you may get somewhere
[0:24] <rcbart> its downloaded and installed, problem is that I can not use a jar file as an interpreter in Eclipse
[0:25] <agronholm> huh?
[0:25] <agronholm> you have pydev installed, right?
[0:25] <rcbart> yes
[0:25] <rcbart> In the pydev interpreter definitions
[0:25] <agronholm> so, in preferences/pydev/interpreter - Jython
[0:25] <rcbart> it requires a *.exe file as the interpreter
[0:25] <agronholm> you are unable to add a new interpreter?
[0:26] <rcbart> not a jar file no
[0:26] <rcbart> it forces me to use a .exe
[0:26] <agronholm> and you are absolutely, 100% sure you are in the Jython section, not Python?
[0:29] <rcbart> my configuration is as follows
[0:29] <agronholm> just answer the question please
[0:30] <rcbart> yes I am
[0:30] <agronholm> and it says "Jython interpreters (e.g.: jython.jar)" there?
[0:30] <rcbart> it is installed and I hae a jython project set up
[0:30] <rcbart> OK I see the problem
[0:30] <agronholm> what is it
[0:31] <rcbart> The radio button for python is selected
[0:31] <rcbart> not jython
[0:31] <agronholm> :/
[0:31] <agronholm> you just told me you weren't even able to add the jython interpreter
[0:33] <rcbart> I just went over it
[0:33] <rcbart> deleted the project and created a new one
[0:33] <rcbart> now it is a pydev project
[0:33] <rcbart> with jython selected
[0:34] <rcbart> and it is pointing to jython.jar
[0:34] <rcbart> however the import issue is not resolved
[0:34] <rcbart> I still get the unresolved import on Math
[0:35] <agronholm> you tried running it?
[0:35] <agronholm> pydev is buggy, shows import errors on java packages on all my jython projects
[0:35] <agronholm> but it runs fine
[0:35] <rcbart> cant run
[0:35] <rcbart> one error
[0:35] <rcbart> unresolved import
[0:35] <agronholm> you created a new run configuration?
[0:36] <agronholm> and made sure it's running jython?
[0:36] <rcbart> yes
[0:36] <rcbart> its automatic in Eclipse
[0:36] <rcbart> you just have to be careful to run as jython
[0:36] <agronholm> well that import error is impossible in jython
[0:37] <agronholm> since jython requires java.lang.* to function at all
[0:39] <rcbart> I assume that I dont have to explicitly add the various java jars as external libraries
[0:39] <agronholm> correct
[0:42] <rcbart> Eclipse restart resolved this issue
[0:42] <agronholm> cool
[0:44] <rcbart> thanks for the help
[1:16] * lopex (~lopx@84-10-213-252.dynamic.chello.pl) Quit ()
[1:53] * w3bcrawler (~w3bcrawle@156.34.40.36) Quit (Remote host closed the connection)
[1:56] <rcbart> question: If I have a java app, do I have to package it as a jar before I can reference it in jython or can I directly access the classes via jython code
[1:56] <rcbart> ?
[3:27] * millertimek1a2m3 (~millertim@c-71-227-188-237.hsd1.wa.comcast.net) has joined #jython
[5:38] <pr3d4t0r> rcbart: You may acess any classes in the package as long as the .jar containing it is in your classpath.
[5:38] <pr3d4t0r> rcbart: Unless you're using custom class loaders.
[5:38] <pr3d4t0r> rcbart: If you don't know what the latter is, then for your purposes don't worry about it.
[6:14] * kuja (~kuja@unaffiliated/kuja) Quit (Read error: Operation timed out)
[6:23] * kuja (~kuja@byteflux.net) has joined #jython
[6:24] * kuja (~kuja@byteflux.net) Quit (Changing host)
[6:24] * kuja (~kuja@unaffiliated/kuja) has joined #jython
[6:26] * millertimek1a2m3 (~millertim@c-71-227-188-237.hsd1.wa.comcast.net) Quit (Quit: Leaving)
[7:46] * whop|away (~colin@about/cooking/sandwich/whopper) has joined #jython
[7:54] * Trundle (~andy@python/site-packages/trundle) has joined #jython
[8:21] * srcerer_ (~chatzilla@dns2.klsairexpress.com) has joined #jython
[8:24] * srcerer (~chatzilla@dns2.klsairexpress.com) Quit (Ping timeout: 258 seconds)
[9:34] * millertimek1a2m3 (~millertim@c-71-227-188-237.hsd1.wa.comcast.net) has joined #jython
[10:13] * lopex (531346b2@gateway/web/freenode/ip.83.19.70.178) has joined #jython
[10:48] * millertimek1a2m3 (~millertim@c-71-227-188-237.hsd1.wa.comcast.net) Quit (Ping timeout: 240 seconds)
[10:56] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Ping timeout: 264 seconds)
[12:55] * stakkars (~tismer@i59F7291E.versanet.de) has joined #jython
[14:21] * mechnik (4b48807a@gateway/web/freenode/ip.75.72.128.122) has joined #jython
[14:23] <mechnik> i am writing my first jython script and have a very limited python background, is there a better forum for general beginners' python question, my question is not jython specific in this instance
[14:23] <agronholm> mechnik: #python-friendly
[14:23] <agronholm> err
[14:23] <agronholm> mechnik: ##python-friendly
[14:24] <mechnik> many thanks
[14:24] * whop|away is now known as whop
[14:28] * lopex_ (531346b2@gateway/web/freenode/ip.83.19.70.178) has joined #jython
[14:29] * lopex (531346b2@gateway/web/freenode/ip.83.19.70.178) Quit (Ping timeout: 252 seconds)
[14:55] * mechnik (4b48807a@gateway/web/freenode/ip.75.72.128.122) Quit (Ping timeout: 252 seconds)
[15:08] * lopex_ (531346b2@gateway/web/freenode/ip.83.19.70.178) Quit ()
[15:46] * Trundle (~andy@python/site-packages/trundle) Quit (Remote host closed the connection)
[16:21] * thobe (~Adium@63-235-13-3.dia.static.qwest.net) Quit (Quit: Leaving.)
[16:23] * srcerer_ is now known as srcerer
[16:33] * JStoker (jstoker@unaffiliated/jstoker) Quit (Ping timeout: 260 seconds)
[16:44] * JStoker (jstoker@unaffiliated/jstoker) has joined #jython
[17:21] * stakkars (~tismer@i59F7291E.versanet.de) Quit (Quit: schnarch)
[17:28] * remote (~nicolas@unaffiliated/remote) has joined #jython
[17:48] * remote (~nicolas@unaffiliated/remote) Quit (Remote host closed the connection)
[19:12] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[19:12] * lopex (~lopx@84-10-213-252.dynamic.chello.pl) has joined #jython
[19:21] * stakkars (~tismer@f052069141.adsl.alicedsl.de) has joined #jython
[19:28] * stakkars (~tismer@f052069141.adsl.alicedsl.de) Quit (Quit: schnarch)
[19:52] * stakkars (~tismer@f052069141.adsl.alicedsl.de) has joined #jython
[19:59] * stakkars (~tismer@f052069141.adsl.alicedsl.de) Quit (Quit: schnarch)
[20:53] * stakkars (~tismer@89.204.153.71) has joined #jython
[21:10] * stakkars (~tismer@89.204.153.71) Quit (Quit: schnarch)
[21:52] * stakkars (~tismer@91-66-101-126-dynip.superkabel.de) has joined #jython
[23:40] <rcbart> pr3d4t0r: how would I reference a custom class loader?

Index

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