array tofile fromfile tosocket? fromsocket?
SpreadTooThin
bjobrien62 at gmail.com
Tue Oct 3 19:31:05 EDT 2006
Thomas Jollans wrote:
> On Tue, 03 Oct 2006 10:29:00 -0700, "SpreadTooThin" <bjobrien62 at gmail.com>
> let this slip:
>
> > I was under the impression that a file and socket were interchangable
> > (like a file descriptor). Does anyone have an idea that might help me
> > minimize the impact on my code?
>
> are you looking for sockets' makefile method ?
>
Yes.. but also I'm thinking about a new python class based on array...
like (psuedo code)
class myArray(array):
def todevice(self, device):
if device is a file:
self.tofile
else
writesocket(data)
def fromdevice(self, device):
Is this advisable?
> --
> Thomas Jollans alias free-zombie
More information about the Python-list
mailing list