"Portability" (was: How to create a Unix Domain Socket?)

Donn Cave donn at u.washington.edu
Wed Oct 18 17:50:53 EDT 2000


Quoth Darren New <dnew at san.rr.com>:
| Cameron Laird wrote:
|> I'm getting tired of calling Python "wonderfully por-
|> table" or whatever it is I say when I'm acting as an
|> advocate. 
|
| On a related note, is Python really portable, or does it just expose the
| underlying OS?  (I'm *still* waiting for my books to get here. I kind of
| hate the whole christmas card thing.)  In other words, could I take a
| program that listens on lots of sockets and does things with the data and
| put up outgoing connections, and have it work without changing the source on
| Windows, Mac, and Unix? Or would I have to use the Mac version of select on
| the Mac, etc etc etc?

Well, I think it's reasonably portable, I think your program might work,
and it does mainly expose the underlying OS.

You wouldn't need a separate OpenTransport version for MacOS, because
MacOS Python supports sockets.  So far, so good.  I haven't run Python
on MacOS for a couple of years, but I bet you could use select() with
multiple sockets just as on UNIX.  Now, as long as "does things with
the data" doesn't require the dread User Interface, you're set.

Realistically, though, it's a little queer for a MacOS application
to have no User Interface, or a tty-like console window.  In practice
I suspect that there aren't many Python applications in actual use that
run across platforms without any platform-specific tweaks - is that true?

	Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list