[Chicago] sockets Question

Daniel Griffin dgriff1 at gmail.com
Fri Dec 26 19:18:34 CET 2008


Yup, pickle would work. I ended up turning the datetimes into strings then
parsing them back into datetimes on the other end, I might end up writing a
client in Java or C so this is the most flexible approach I think.

Dan

On Fri, Dec 26, 2008 at 12:08 PM, Carl Karsten <carl at personnelware.com>wrote:

> "just cast it to char*" is just a form of serializing.  (I am pretty sure
> it is a poor form, but that's debatable.)
>
> >>> help(pickle)
>    pickle - Create portable serialized representations of Python objects.
>
> http://doc.python.org/lib/module-pickle.html
> "The pickle module can transform a complex object into a byte stream and it
> can transform the byte stream into an object with the same internal
> structure. Perhaps the most obvious thing to do with these byte streams is
> to write them onto a file, but it is also conceivable to send them across a
> network or store them in a database."
>
> Carl K
>
>
> Daniel Griffin wrote:
>
>> C is the one true language. Python sockets are really easy to use and
>> everything, but due to the way python works you have to pass everything as
>> a
>> string, which makes sending things like datetime's a pain. In C you just
>> cast it to char* and then cast it back on the other end.
>>
>> Dan
>>
>>
>>
>> On Fri, Dec 26, 2008 at 11:11 AM, Pete <pfein at pobox.com> wrote:
>>
>>  On Dec 26, 2008, at 11:31 AM, Massimo Di Pierro wrote:
>>>
>>>  On Dec 26, 2008, at 10:24 AM, Pete wrote:
>>>>
>>>>  When I look at C, I can see the Python within.
>>>> Actually it is Python that calls Posix inside and exposes similar APIs
>>>> ;-)
>>>>
>>>>  Yeah, they read Knuth so I don't have to.
>>>
>>> I never learned C. ;-)
>>>
>>> --Pete
>>>
>>> PS- I think that's quoteboard worthy, no?
>>>
>>> _______________________________________________
>>> Chicago mailing list
>>> Chicago at python.org
>>> http://mail.python.org/mailman/listinfo/chicago
>>>
>>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Chicago mailing list
>> Chicago at python.org
>> http://mail.python.org/mailman/listinfo/chicago
>>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> http://mail.python.org/mailman/listinfo/chicago
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20081226/246b6810/attachment-0001.htm>


More information about the Chicago mailing list