Message6832
There are several solutions for getting the process ID suggested on this blog post.
http://blog.igorminar.com/2007/03/how-java-application-can-discover-its.html
One promising approach is to set a java System property on the command line that starts jython, e.g.
"""
2. Using shell script in addition to Java properties Start your app with a shellscript like this:
exec java -Dpid=$$ -jar /Applications/bsh-2.0b4.jar
then in java code call:
System.getProperty("pid");
"""
you could then monkeypatch the os module like so
>>> import java
>>> import os
>>> os.getpid = lambda: java.lang.System.getProperty("pid") |
|
Date |
User |
Action |
Args |
2012-03-19 18:37:36 | amak | set | messageid: <1332182256.68.0.417138565319.issue1808@psf.upfronthosting.co.za> |
2012-03-19 18:37:36 | amak | set | recipients:
+ amak, irmen, whistler11783 |
2012-03-19 18:37:36 | amak | link | issue1808 messages |
2012-03-19 18:37:36 | amak | create | |
|