0

In a directory I have three files.

  • test.py, containing print "Hello World"
  • python_runner.bat, containing
    • python test.py PAUSE
  • jython_runner.bat, containing
    • jython test.py PAUSE

The python_runner.bat works as expected, but running Jython_runner.bat causes the PAUSE command to be skipped!

Why is Jython causing the batch script to be prematurely terminated?

(NOTE: I am using Jython2.7b4, I haven't tried with Jython 2.5)

asemahle
  • 20,235
  • 4
  • 40
  • 38
  • 1
    possible duplicate of [Why does calling a nested batch file without prepending "call" to the line exit the parent batch file?](http://stackoverflow.com/questions/11638705/why-does-calling-a-nested-batch-file-without-prepending-call-to-the-line-exit) – User Mar 06 '15 at 20:08

1 Answers1

1

If the jython command is a batch script then the pause and any thing after this will not be executed.

try call

call jython test.py 

What is the outcome?

User
  • 14,131
  • 2
  • 40
  • 59
  • The Jython command does resolve to a batch script! Using `call` makes everything work properly. I didn't know about this strange batch-scripts-calling-batch-scripts behavior... very odd – asemahle Mar 06 '15 at 20:05
  • 1
    Have a look at http://stackoverflow.com/questions/11638705/why-does-calling-a-nested-batch-file-without-prepending-call-to-the-line-exit – User Mar 06 '15 at 20:08