Skip to content

Instantly share code, notes, and snippets.

View matthew-nm's full-sized avatar

Matthew matthew-nm

  • California, USA
View GitHub Profile
@micktwomey
micktwomey / client.py
Created October 1, 2010 13:03
python multiprocessing socket server example
import socket
if __name__ == "__main__":
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("localhost", 9000))
data = "some data"
sock.sendall(data)
result = sock.recv(1024)
print result
sock.close()
@Finndersen
Finndersen / polymorphic_related_queryset.py
Last active August 29, 2023 12:53
PolymorphicRelatedQuerySet which allows select_related() to return polymorphic child models instead of base model