I am using Spyder (3.2.6) on a Mac, running python code that starts by loading/processing some large data files.
When stepping through my code if I encounter an error, is it possible to fix the error and continue stepping - rather than run everything from the beginning again (and wait for all the data to load/process)?
Encountering an error seems to 'end' the run/debug mode at the point of the error, and I can't seem to find a way to continue.
Thank you for you help.
Related
I ran at some point %%script python --no-raise-error and now I want to go back and stop when there is an error.
I restarted the kernel, the notebook, even the computer but when running all, it still doesn't stop when facing an error.
Maybe at some point I might have done something else because I was trying advice from the forums on how to avoid stopping from errors and now cant go back.
My current (PyCharm based) debugging workflow is to run a program in debug mode. When I run into an error, I fix it, and restart the program from the beginning.
Is it possible to save re-running the healthy part of the program by moving the program back by one step, fix the issue, and continue the program?
Is there a general way to do this, and one specific for PyCharm?
[edit:]
this is related but not similar to Is there "Edit and Continue" in PyCharm? Reload code into running program like in Eclipse / PyDev? , as there the author anticipates halts the program before an error occurs. here, i consider an error state
I was trying to get datetime.py working as one of the functions from it just didn't exist in my datetime.py file. In my datetime.py the fromiso() function is not present in the code. To test it I opened a new VS project and tried compiling a small code snippet that would only invoke the missing function from datetime after import, and that's when I first encountered this problem. I'm not sure if this is related to this problem, but this is the last thing I was doing.
When running the code it will flash console quickly before opening "Launching debug adapter" window, this will prevent me from doing anything for maybe 10s and then will return to the starting point having neither executed my code nor opened the debugger.
Now I am unable to run any program whatsoever, running with either ctr+f5 or fn+f5 leads to same glitch. I have not touched anything in the VS settings prior. I have tried powercycling just for a good measure, but sadly that didn't fix anything. Running as admin yields same result.
I've been using PyScripter for a few months now with no issue, but when I tried to open the application today it's just been crashing with the error message
"PyScripter has stopped working: A problem caused the program to stop
working correctly. Please close the program."
I'm unsure what is causing the error and so far I've been unable to fix it.
I don't believe I did anything the last time I used PyScripter which might have caused it to break.
I've had a strange occurance. I stopped a python script manually, but its still running. It shows it as stopped in my IDE (Spyder) but I can see it's still running in task manager. I also know it still processing because its still outputting files to a directory.
Does anyone know why this is happening and how I can prevent it on a go forward?
Got it, i needed to add Exception to my except statement. Thanks gerosalesc and Dot_Py for your help.
Try/Except in Python: How do you properly ignore Exceptions?