josu | 1 Oct 11:29
Picon
Picon

Re: parameter to jython console

Really, I want to start a jython  console from a java application, 
passing to  jython several variables for data and pointers to different 
elements as buttons etc, since I want to access from jython to elements 
defined in the java application.
I known the existence of set method but maybe there are different ways.

Thanks for the response

Regards

josu

Jeff Emanuel(e)k dio:
> Yes, you would call methods or set fields on PySystemState
> or its constituents.  If you provide more details about what
> you want to set, I can point you in the right direction.
>
>
> josu wrote:
>> Hi
>>
>> I want to know if it is posible to start the jython console in a java 
>> program sending any kind of parameter from java to jython.
>>
>> Thank you in advance
>>
>> josu
>>
>> ------------------------------------------------------------------------- 
>>
(Continue reading)

Jeff Emanuel | 1 Oct 15:56
Favicon

Re: parameter to jython console

PythonInterpreter.set is exactly correct.

josu wrote:
> Really, I want to start a jython  console from a java application, 
> passing to  jython several variables for data and pointers to different 
> elements as buttons etc, since I want to access from jython to elements 
> defined in the java application.
> I known the existence of set method but maybe there are different ways.
> 
> 
> Thanks for the response
> 
> Regards
> 
> josu
> 
> Jeff Emanuel(e)k dio:
>> Yes, you would call methods or set fields on PySystemState
>> or its constituents.  If you provide more details about what
>> you want to set, I can point you in the right direction.
>>
>>
>> josu wrote:
>>> Hi
>>>
>>> I want to know if it is posible to start the jython console in a java 
>>> program sending any kind of parameter from java to jython.
>>>
>>> Thank you in advance
>>>
(Continue reading)

astigmatik | 2 Oct 04:32
Picon

Wikipedia Entry for Jython

IMHO, it needs updating... but I got no access..

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Ramana | 2 Oct 13:12
Picon

How to sort a dictionary

Hi,

Can any one tell me how to sort a dictionary; both in ascending and descending order?

Any help is greatly appreciated.

Thanks
--
DREAM IT, DO IT

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
claudef | 2 Oct 13:27
Picon
Gravatar

Re: How to sort a dictionary


Dear Ramana,

  Enclosed a quick hack for ascending sort order. Not sure if this is smartest solution.
The routine below does a sort of the key list.

# Print in sequence----------------------------------------------
key_names = dict1.keys()
key_names.sort()
for k in key_names:
    v_tot = tot_rev[k]
    c_tot = tot_count[k]        
...

Regards,
Claude

Claude Falbriard
Developer
AMS Hortolândia / SP - Brazil
phone: +55 13 8117 3316
e-mail:  claudef <at> br.ibm.com
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jython-users mailing list
Jython-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
werckmeister1 | 2 Oct 13:27
Picon
Picon

Softlinks under Windows HowTo?

Dear all,

is there any way to create a softlink under Windows XP with Jython?
The os routines only seem to support soft links under Unix.

What I want to do is to move a file to another directory, but I want
to leave a link to the new location in the old directory.

Thanks for all hints

Kind regards

Markus
--

-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
josu | 2 Oct 14:13
Picon
Picon

java options with jython

Hi

I have a java program which need some parameters in the call like:

java -Djava.security.policy=my_policy My_App

I am trying to write the jython version but I don't known how  pass the 
parameters from the jython console.

Is possible?

Thanks

josu

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Jeff Emanuel | 2 Oct 16:13
Favicon

Re: java options with jython

Copy the jython startup script and edit
the copy to add the flags you need to the java
command.

josu wrote:
> Hi
> 
> I have a java program which need some parameters in the call like:
> 
> java -Djava.security.policy=my_policy My_App
> 
> I am trying to write the jython version but I don't known how  pass the 
> parameters from the jython console.
> 
> Is possible?
> 
> Thanks
> 
> josu
> 
> 
>  
> 
>  
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Jython-users mailing list
> Jython-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jython-users

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Alan Kennedy | 2 Oct 16:58
Favicon

Re: Exception handling

[Greg]
 >>>>> try:
 >>...     x = socket.gethostbyname("por-wq-moore")
 >>...     print 'host ip addr: ', x
 >>... except gaierror, ge:
 >>...     print 'something exceptional happened'
 >>...     print ge
 >>
 >>And got an unexpected:
 >>
 >>Traceback (innermost last):
 >>  File "<console>", line 2, in ?
 >>NameError: gaierror

[Pekka]
 > You probably should say "from socket import gaierror" before
 > your try/except.

Or, more simply, properly scope the exception as socket.gaierror, like so

try:
     x = socket.gethostbyname("por-wq-moore")
     print 'host ip addr: ', x
except socket.gaierror, ge:
     print 'something exceptional happened'
     print ge

Regards,

Alan.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Alan Kennedy | 2 Oct 17:20
Favicon

Re: differing results with gethostbyaddr()

[Greg]
 > Maybe someone can shed some light on this. I just want to quickly see if
 > a server is 'there' so I was playing around with functions in the socket
 > lib like gethostbyname and gethostbyaddr. I read Alan Kennedy's
 > NewSocketModule page on the wiki but it didn't seem to apply to this.

[snip]

 > Is there a better way to do this?

Well, gethostbyaddr is not the right way to find out if a server is 
available on the network. This function simply looks up the given 
address in the name->address database. That is, it consults 
configuration, it does not attempt to actually contact the relevant 
server to see if it exists.

Without knowing on which OS you're running the cpython version, I can't 
give you specific details on why you get different behaviour between 
cpython and jython (because name resolution is different on most OS 
flavours). But I can tell you that the jython function is implemented 
using the java.net.InetAddress.getAllByName() method.

http://java.sun.com/j2se/1.4.2/docs/api/java/net/InetAddress.html#getAllByName(java.lang.String)

As Raghuram suggested, I think your best option is to try to actually 
connect to the server in question, with a small timeout. If it times 
out, then you know the server is not responding.

Lastly, I didn't actually write this function; it was inherited from the 
previous version of the socket module.

But I am prepared to fix any demonstrated bugs in this and any other 
function in the socket and related modules.

Regards,

Alan.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Gmane