Python Forum
how can i send a list of tuples from the server to the client using sockets?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how can i send a list of tuples from the server to the client using sockets?
#1
I have a list of tuples that I don't know the length of (I selected it from a sqlite3 database table).

how can I send this list from the server to a client using sockets so that the client could access the values of the list and the tuples and use them? All tuples contain 4 string values.

data = [("cooking","josh", "recepie", "cookies") ,
("fashion", "jessica", "shopping", "dresses"),
("sport", "jake", "basketball", "kobe bryant")]

how can i send this 'data' list of tuples from the server socket to the client socket so that he could access its values?

I'd really appreciate it if you could help me ! Smile
Reply
#2
SQL has built-in for getting count of query.
simple example: select count(mycolumn) from mytable where myfilter;
for the socket part, see: https://docs.python.org/3.8/howto/sockets.html
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Paramiko Server -- Exception (server): Error reading SSH protocol banner ujlain 3 4,277 Jul-24-2023, 06:52 AM
Last Post: Gribouillis
  Client/Server proper finalizing transfer wolfman5874 1 1,422 Jul-04-2022, 07:35 PM
Last Post: wolfman5874
Bug Problem connecting TLS client written in C++ and Twisted server gpropf 0 1,361 Jun-12-2022, 05:57 PM
Last Post: gpropf
  Server/client basic communication ebolisa 0 2,009 Sep-30-2021, 12:22 PM
Last Post: ebolisa
  Client server Multithreading Anan 6 5,754 Apr-21-2021, 08:19 PM
Last Post: SheeppOSU
  Sockets interferring with USB ? epif18 0 2,602 Mar-19-2021, 07:45 PM
Last Post: epif18
Question Trouble with Client/Server reverse Shell! Gilush 0 2,757 Feb-03-2021, 01:04 PM
Last Post: Gilush
  Basic client server code question swisscheese 4 3,192 Dec-12-2020, 08:51 AM
Last Post: Larz60+
  How can i create a server for already existing client using Python? Chapanson 21 7,317 Aug-19-2020, 09:12 AM
Last Post: DeaD_EyE
  Simple TCP Client and TCP Server Problem Vapulabis 5 4,336 Jul-12-2020, 05:09 PM
Last Post: ndc85430

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020