S
silkenpy
Hi,
please help me to find a solution to run this program correctlly or tell me
my basic mistake.
import thread
import threading
import time
from jpype import *
def sleepFunction():
print"ya ali"
classpath = "-Djava.class.path=praat.jar"
startJVM(getDefaultJVMPath(),"-ea",classpath)
Formant=JPackage("praat").Formant
s=Formant("iia-001-000.Formant")
w=s.getF2_frequency()
print w
shutdownJVM()
for i in range(1):
thread.start_new_thread(sleepFunction, ())
time.sleep(1)
print "goodbye!"
The result is
ya ali
ya ali
Unhandled exception in thread started by <function sleepFunction at
0x00BFE370>
Traceback (most recent call last):
File
"C:\Downloads\_extracted\py_threading.zip.extracted\py_threading\sle.py",
line 19, in sleepFunction
startJVM(getDefaultJVMPath(),"-ea",classpath)
File "D:\Python25\Lib\site-packages\jpype\_core.py", line 43, in startJVM
_jpype.startup(jvm, tuple(args), True)
RuntimeError: Unable to start JVM at src/native/common/jp_env.cpp:54
Unhandled exception in thread started by <function sleepFunction at
0x00BFE370>
Traceback (most recent call last):
File
"C:\Downloads\_extracted\py_threading.zip.extracted\py_threading\sle.py",
line 19, in sleepFunction
startJVM(getDefaultJVMPath(),"-ea",classpath)
File "D:\Python25\Lib\site-packages\jpype\_core.py", line 43, in startJVM
_jpype.startup(jvm, tuple(args), True)
RuntimeError: Unknown Exception
goodbye!
Thanks a lot.
please help me to find a solution to run this program correctlly or tell me
my basic mistake.
import thread
import threading
import time
from jpype import *
def sleepFunction():
print"ya ali"
classpath = "-Djava.class.path=praat.jar"
startJVM(getDefaultJVMPath(),"-ea",classpath)
Formant=JPackage("praat").Formant
s=Formant("iia-001-000.Formant")
w=s.getF2_frequency()
print w
shutdownJVM()
for i in range(1):
thread.start_new_thread(sleepFunction, ())
time.sleep(1)
print "goodbye!"
The result is
ya ali
ya ali
Unhandled exception in thread started by <function sleepFunction at
0x00BFE370>
Traceback (most recent call last):
File
"C:\Downloads\_extracted\py_threading.zip.extracted\py_threading\sle.py",
line 19, in sleepFunction
startJVM(getDefaultJVMPath(),"-ea",classpath)
File "D:\Python25\Lib\site-packages\jpype\_core.py", line 43, in startJVM
_jpype.startup(jvm, tuple(args), True)
RuntimeError: Unable to start JVM at src/native/common/jp_env.cpp:54
Unhandled exception in thread started by <function sleepFunction at
0x00BFE370>
Traceback (most recent call last):
File
"C:\Downloads\_extracted\py_threading.zip.extracted\py_threading\sle.py",
line 19, in sleepFunction
startJVM(getDefaultJVMPath(),"-ea",classpath)
File "D:\Python25\Lib\site-packages\jpype\_core.py", line 43, in startJVM
_jpype.startup(jvm, tuple(args), True)
RuntimeError: Unknown Exception
goodbye!
Thanks a lot.