Get stackoverflow answers automatically based on uncaught exceptions.
$ git clone [email protected]:rahulnair23/pyRecommender.git
$ cd pyRecommender
$ export PYTHONPATH=$PYTHONPATH:$(pwd)
The pyRecommender sessions are active for all interactive and command line python sessions.
$python test.py
pyRecommender session enabled (remove sitecustomize.py from PYTHONPATH to disable).
Traceback (most recent call last):
File "test.py", line 4, in <module>
print(float('k'))
ValueError: could not convert string to float: 'k'
Have you looked at:
1.If you want to handle exceptions different depending on their origin, it is best to separate the different code parts that can throw the exceptions. Then you can just put a try/except block around the respective statement that throws the exception, e.g.:
while True:
try:
...
Source: http://stackoverflow.com/questions/13297748/python-except-valueerror-only-for-strings
2.replace this code
GAIA_HOST = 'www.google.com'
LOGIN_URI = '/accounts/ServiceLoginAuth'
by this
GAIA_HOST = 'accounts.google.com'
LOGIN_URI = '/ServiceLoginAuth'...
Source: http://stackoverflow.com/questions/19915335/python-cloud-print-authorization
Python automatically imports the site
package during initialization which in turn looks for sitecustomize
which registers the custom hooks to get unhandled exceptions.