Am Fri, 24 Oct 2008 11:33:33 -0700 schrieb asit: > On Oct 24, 11:18 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: >> On Fri, Oct 24, 2008 at 1:42 PM, asit <[EMAIL PROTECTED]> wrote: >> > I code in both windows and Linux. As python is portable, the o/p >> > should be same in both cases. But why the following code is perfect >> > in windows but error one in Linux ??? >> >> What error message do you get in linux? How are you running your code >> in linux? Your code seems to generally work on my Ubuntu linux box, so >> you need to give us more information. >> >> -- >> Jerry > > this the o/p > [EMAIL PROTECTED]:~/hack$ python portscan.py 59.93.128.10 10 20 > Traceback (most recent call last): > File "portscan.py", line 33, in <module> > print str(port) + " : " + scan(ip,port,timeout) > File "portscan.py", line 22, in scan > return status[result] > KeyError: 11 > [EMAIL PROTECTED]:~/hack$
Python is certainly portable, but ino order to do its job, it relies on the underlying OS and libraries to work, which may be different from OS to OS. The status message you define in your code (e.g. 10056:"already connected") seem to be specific to Windows, IIRC. HTH Martin -- http://mail.python.org/mailman/listinfo/python-list