0

I was happily running my Python files by calling them from IronPython ( I have to use Ir.Py) untill due to our changes in the server, there were some modifications to transfer our user accounts to the new server by IT guys.

given the fact that my IronPython code calls the python.exe (using process.start(..)) a python.exe cmd used to open up when calling. but now after some changes that I am not sure about them since I could not individualize the right one ( first I thought it's antivirus but it wasn't , so it might be my account settings since I am connected to a new server). I also reduced the windows firewall to least, but still the same event. I can not find out what is changed in my system that causes this. any known ones till present ?

this python window flashes for a moment and closes up. Now a lot of my effort is ruined due to this system change.

Update 1 : Could this be a problem of clash of versions? I use IronPython 2.7.0.40 on .NET 4.0.30319.42000 to run Python 3.6.3 |Anaconda, Inc.| (default, Oct 15 2017, 03:27:45) . Do they seem compatible ? Or am I missing an environment variable ?

FabioSpaghetti
  • 790
  • 1
  • 9
  • 35
  • If your problem is that the window closes, try adding a call to `input()` at the end of the file. This will wait for user input and keep the window open. – fafl Sep 13 '18 at 08:41
  • I don't have to do anything during this run, there are some commands in my python file, that should run when IronPython calls it. This window closing indicates that the python.exe can not be executed. Something is preventing it – FabioSpaghetti Sep 13 '18 at 08:50
  • Try putting a `pause` command at the end of the .bat file – fafl Sep 13 '18 at 10:45
  • My IronPython is nested in a software. I just run this code , which .bat file are you refering to ? – FabioSpaghetti Sep 13 '18 at 10:49
  • I added : Process.pause() at the end of my IronPython file, but it gave error that no attribute pause is defined for Process – FabioSpaghetti Sep 13 '18 at 11:02
  • @fafl I did not understand why did you refer to a bat file. My python file runs from Python-spyder, from shell and from cmd of Anaconda and Windows both. but not by using Process.start – FabioSpaghetti Sep 13 '18 at 17:55
  • 1
    Python does not start correctly, it closes instantly. You want to read the reason so you can fix it. So you should add a prompt, try to use Process.start() to open a batch file that then opens python. In the batch file you can add the `pause` command, which will keep the window open. – fafl Sep 14 '18 at 08:48
  • Understood !! thanks a lot – FabioSpaghetti Sep 14 '18 at 11:51
  • @fafl I tried this. in the paused cmd window, I only see the IronPython path directory and then the path to python exe. and my python version info. that's all – FabioSpaghetti Sep 16 '18 at 21:23
  • For those wondering why, after changing their Anaconda installation, command windows are closing instantly and python is breaking, see: [this answer](https://stackoverflow.com/questions/66335300/cmd-crashes-with-exit-code-1-after-uninstalling-anaconda) – Burrough Clarke Mar 03 '22 at 21:59

0 Answers0