Random ...
 
December 2017
S M T W T F S
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Tags ...
Links



python+zope++:: All pythons are created equal - or are they?
Posted at 23.May,2006 20:49  Comments 0 / Trackbacks 0 / Like this post!
Technorati tag(s):

Cross platform programming is always a problem. Even with python.

Yes, python runs everywhere, but there are stuff that may be missed. Or maybe it's me :P

Anyway, here's what happened. I wanted to learn some GUI programming. So I got myself a project. Build a small app that I can use to ping hosts and get the current IP address.

I use ping.py by Matthew Dixon Cowles, http://www.visi.com/~mdc/.

Here's the excerpt:

  def doPing(self):
        ip = self.entryPing.get()
        res = []
        msg = 'Pinging %s:\n' % ip
        msg +='-' * 10
        msg +='\n'
        for i in xrange(0,3):
           try:
               ptime = ping.doOne(ip)
               res.append(str(ptime*100))
           except socket.gaierror, e:
               res.append(e[1])
        #print res
        msg += '\n'.join(res)
        self.txtRes.delete(0.0,END)
        self.txtRes.insert(0.0,msg)

I chose tkinter since I want to run this on my pocket pc. So, I started with a small class and got it running on Linux (although I need to be root to actually run it).

And I took the code to Windows 2000, and ran it. And it worked too.

Great, I thought.

I moved the code to my pocket pc. That's where the code b0rked.

b0rked getprotobyname

It seems that socket.getprotobyname(icmp) don't work correctly. I wondered whether pocket pc has the notion of administrator?

If anyone knows why, please do tell. If this pinger app works, it'll be an accomplishment to me! :)


Bookmark and Share

Is this entry helpful? Comments/Donate/Click some google ads.  
Trackback is http://myzope.kedai.com.my/blogs/kedai/80/tbping 

Comments
Post a comment