From: Jingzhao Ou <jin...@sb...> - 2003-07-31 05:50:38
|
HI, Jeff and Jonathan, I just tried and it works! The code is something like the following: ================================================== import java url = java.lang.ClassLoader.getSystemResource("Data/somefile.dat") ins = url.content print java.io.DataInputStream(ins).readLine() ================================================== Thanks a lot for your help! Best regards, Jingzhao --- Jeff Emanuel <JEm...@lg...> wrote: > > I don't know whether you can do it with jythonc, but you can add > your Data directory to your jar file with this command: > > jar uf test.jar Data > > With the jar file on the classpath, you can do something like > this: > > url=java.lang.ClassLoader.getSystemResource("Data/somefile.dat") > instream=url.content > > > Then read your data from instream. > |