Help Requested Understanding JSON Network Programming

Help Requested Understanding JSON Network Programming

Postby joedirgy » Sat Feb 01, 2014 11:59 pm

Hello,

I am trying to understand the best way I can send a list of lists across the network using network python and maybe JSON since it looks like it might be the easiest thing to use. Ideally, I would like the client to transmit to the server letting the server know how large the list of lists will be and then the client sends the list.

My question is does anyone know where some sample code may lie that I could hack to make this work. Ideally I would like something very simple or maybe someone can point me to some good tutorials. Thanks in advance.

Joe
joedirgy
 
Posts: 3
Joined: Tue Nov 19, 2013 3:59 am

Re: Help Requested Understanding JSON Network Programming

Postby micseydel » Sun Feb 02, 2014 11:09 pm

It sounds like you could create a dictionary with entries that indicate the size and contain the lists. Then just use json.dumps() and send that string over the network. These things are all very basic, so basic docs should have code that you can "hack" for your purposes. Let us know if you encounter any particular problems in doing so and we can give you more specific feedback.
Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.
User avatar
micseydel
 
Posts: 1443
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA


Return to Networking

Who is online

Users browsing this forum: No registered users and 3 guests