Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: regular expression to extract exception/errors in python code base

by Anonymous Monk
on Sep 09, 2012 at 16:40 UTC ( #992605=note: print w/replies, xml ) Need Help??


in reply to regular expression to extract exception/errors in python code base

Um, what do they look like (sample input)?
  • Comment on Re: regular expression to extract exception/errors in python code base

Replies are listed 'Best First'.
Re^2: regular expression to extract exception/errors in python code base
by Anonymous Monk on Sep 09, 2012 at 16:47 UTC

    ack -i "\b(?:raise|except)\b" --python C:\Python25

    ack -i "^\s*(?:raise|except)\s" --python C:\Python25

    But, it seems to me python already has introspection ( Guide to Python introspection ), so this grep/ack probably isn't required, but I perl

      This promises to be the closest that I was looking at

        Asab,

        I suspect that you're asking the wrong question. Grepping like that you'll miss anything uncaught but raised from standard libraries and code, etc. Suggest for python questions that you post a sufficiently detailed description/example of what you actually want to achieve on python-tutor or python-list (aka comp.lang.python). The correct answer probably involves the traceback module.

        -T.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://992605]
help
Chatterbox?
[Corion]: Hi marto!
[Corion]: I hope you were able to catch up on some sleep
Corion is slowly, slowly relaxing. Yesterday I spent vegging out in front of the PC, today at a friends, and hopefully I have the books for our Perl club done by Monday. I guess I'll only really relax once I get back from LPW
[marto]: last night, well this morning was a 5am finish, up from 4 am the previous day. Oddly I feel better today than I did yesterday
[Corion]: marto: I think the first thing sleep deprivation does is kill your sense of how tired you are :)

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2017-11-19 11:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (280 votes). Check out past polls.

    Notices?