Re: [f2py] cancel fortran module inside python shell
Mark Andrews <[email protected]> Wed, 5 Jan 2011 20:37:40 +0000
| Newsgroups | gmane.comp.python.f2py.user |
|---|---|
| Message-ID | <[email protected]> |
Hi - Thanks for the advice. I see what you mean about it being dangerous. -m On Wed, Jan 5, 2011 at 8:02 PM, Kevin Mitchell <[email protected]> wrote: > As far as I know there is no good way to implement this. The problem > is that the Fortran code is called by the process running the python > shell. Therefore the two cannot be distinguished at the operating > system level. That said, it would be dangerous if python actually > heeded your request and ceased running the module midway through > because it might cause memory leaks or undefined behaviour since there > is no way for python to know what Fortran is actually doing so that it > can stop at an opportune time. > > On 1/5/11, Mark Andrews <[email protected]> wrote: >> Hi, >> I have a simple question, sorry if the answer is out there and my >> googling missed it. >> To cancel or interrupt a running python script inside a python shell >> like e.g., ipython, I press 'ctrl+c'. >> If I write a pure fortran program and run it from a linux bash shell, >> I can also cancel by pressing "ctrl+c". >> However, if I write a fortran module for python using f2py and run >> that in a python shell, I can not cancel with "ctrl+c". The only way I >> can interrupt it is (with linux) issuing a kill command to the entire >> python shell process. >> I was wondering if there is something I am missing? Is there something >> I should add to the fortran code or maybe to the f2py command line >> flags? >> thanks, >> Mark >> >> _______________________________________________ >> f2py-users mailing list >> f2py-users-Y4l6ocDipWCuvFJfX82//[email protected] >> http://cens.ioc.ee/mailman/listinfo/f2py-users >> > > _______________________________________________ > f2py-users mailing list > f2py-users-Y4l6ocDipWCuvFJfX82//[email protected] > http://cens.ioc.ee/mailman/listinfo/f2py-users >