On Saturday 20 January 2007 20:45, Jorge Vargas wrote: > > Is there any option to return the data as a python pickle? With a good > > Pythoon GUI toolkit (Qt, Gtk, Wx, etc) you could make a really nice front > > end to a nice back-end data service. I realize I could use XML-RPC or > > JSON, but I thought, "Why not keep it in Python's native format, and > > avoid the overhead of conversion?" > > sounds interesting although pickle in itself is not "native"
Well, yes, it is a module, not necessarily built in. I guess what I meant was that "The data format used by pickle is Python-specific." - Python Library Reference, 3.14.2 > and has > several problems you haven't consider like the fact that pickles may > not be compatible between version of python itself. Right, I did know that, having read through the standard library docs a few weeks ago. But, in this case, I would most likely have control over both the back end Python version, as well as the front end Python version. I know, for instance, that "Protocol version 2 was introduced in Python 2.3. It provides much more efficient pickling of new-style classes." - Ibid, 3.14.3 But I can pretty much guarantee that both my front end and back ends will be running Python >= 2.3. > and I think transmitting a json string over the network is faster then a > pickle object (smaller data). That I didn't know. How well does JSON handle binary data? And with pickle you can do truly "scary" things like sending entire class instances over the wire, which opens up a whole bunch of really off-the-wall possibilities when talking about interaction of the client with the server. > that said seems interesting I thought so. :) > > I'm sure it wouldn't be that hard to add. I'll do it > > myself, if someone wants to point me to the right place in the code. :) > > the first thing is that you need to understand generic functions after > that probably you'll need to patch the code in > http://trac.turbogears.org/browser/trunk/turbogears/controllers.py#L168 > and below to add the new rule type (yes the code is a little dense) I'll take a look at that. A template plugin was also suggested too. I'll see if I can grok that first, as it would be more extensible. j -- Joshua Kugler Lead System Admin -- Senior Programmer http://www.eeinternet.com PGP Key: http://pgp.mit.edu/ ID 0xDB26D7CE PO Box 80086 -- Fairbanks, AK 99708 -- Ph: 907-456-5581 Fax: 907-456-3111 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~---
