[Tutor] Error msg
janos.juhasz@VELUX.com
janos.juhasz@VELUX.com
Fri Nov 29 03:28:01 2002
Hi All,
Does anyone know what it could be ?
It can be seen after running my code in PythonWin with Post-Mortem
[Dbg]>>> line
'15:01:15.315996 0:3:6e:1e:99:24 0:1:e6:54:f5:5f 0800 62:
10.128.40.101.49814 > 192.168.128.12.9100: S 3477628976:3477628976(0) w=
in
32768 <mss 1460,wscale 0,nop> (DF)\n'
[Dbg]>>> len(line)
Traceback (most recent call last):
File "<interactive input>", line 1, in ?
TypeError: 'str' object is not callable
[Dbg]>>>
It is a simple script to format the Windump Etherheader lines.
####
import string
f =3D open('H:/devel/net/out.txt', 'rt')
print 'Time Len Source Source_Port Dest Dest_Port'
while 1:
line =3D f.readline()
if not line:
f.close()
exit()
if len(line) < 20:
continue
cells =3D line.split(' ')
time =3D cells[0][:8]
len =3D cells[4][:-1]
source =3D string.join(cells[5].split('.')[:-1], '.')
sourceport =3D cells[5].split('.')[-1]
dest =3D string.join(cells[7].split('.')[:-1], '.')
destport =3D cells[7].split('.')[-1][:-1]
print time, len, source, sourceport, dest, destport
Best regards,
-----------------------
Juh=E1sz J=E1nos
IT department
=