How to go back from %%script python --no-raise-error? - python

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.

Related

Python Debugging: Given an error, can I step backwards, fix the error, and continue the program?

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

How to delete leftover commands in IPython console?

I recently opened Spyder after a really long time, and my IPython console immediately showed some leftover commands? Do they affect my next code, and if they do, how can I get rid of them? Screenshot
EDIT Solved: all i had to do is turn off symbolic mathematics in preferences/ipython console/advanced settings. When I turn it back on, it shows again. I would like to know is there any better solution for this?

Spyder Debug - How to fix code and Continue stepping

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.

Debug why IPython is stuck?

Many times IPython notebook gets stuck showing active cells as [*] but not doing anything anymore. This happens on cells which usually only take milliseconds to execute. It may even happen after a fresh startup of IPython. It happens particularly often after %matplotlib commands. Occasionally it continues after a very long waiting time.
How can I find out what's going on? Where can I try to find error messages or so?
I've started with the --debug option but don't see anything special there. It's certainly possible that the firewall configuration is weird , but how can I configure IPython for that?

Python - I can't see my what my error is because the window disappears immediately

I am pretty new to Python and I have been pretty annoyed with this problem. I am not sure if this matters, but I run my .py file with Python 2.7.6 with python installed on my computer, not using it on any online thing or other program. Every time I come across an error, my program works fine until it comes to the error, but the window disappears right before I can possibly read whatever the error said it was... Anyways, I haven't been able to find out what is wrong with my programming, and I am tired of guessing and guessing what is wrong. How can I extend the time so I can read the error message? Or something like that? Thanks
You should run it from command window/terminal instead of double clicking on the file.
Yes, as #shortfellow said, running it from the terminal should work:
python your_file.py
Another tip that helps in Python, if you are having a hard time with errors, is to use iPython for debugging/testing code on the spot. You can give it a try.
http://ipython.org/

Categories