Suppose I am given the following traceback:
Traceback (most recent call last):    
  File "<wingdb_compile>", line 3, in <module>    
  File "C:\Python34\lib\ftplib.py", line 419, in login    
    resp = self.sendcmd('PASS ' + passwd)    
  File "C:\Python34\lib\ftplib.py", line 272, in sendcmd    
    return self.getresp()    
  File "C:\Python34\lib\ftplib.py", line 245, in getresp    
    raise error_perm(resp)    
ftplib.error_perm: 530 Login incorrect.
I have managed to extract the Error details but what has stumped me is how would I extract the line:
File "<wingdb_compile>", line 3, in <module>
I was looking at methods in the trace back package but wondered if any one had experience with that here
                        
The function
traceback.format_excis built primarily for thisSo now you wanted the first line then you can simply use
Voila! You have what you want