Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm trying to write my own protocol so that multiple servers can pass data and connect with each other, kind of like mongo://. I have been looking at TCP & I understand ports, but how do I write something so that people can just do something like connect("proto://example.com:6767/") ?
Also, I'm writing in python.
Thanks!
I believe you need to look into urllib2 and writing a subclass of BaseHandler, specifically the functions protocol_request and protocol_response.
Whether the way urllib2 handles request/response cycles suits your application is up to you to decide -- it may or may not be exactly what you want.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
IPython has a great concept of comm objects, which are basically pairs of objects - one on Python side and the other in JavaScript - which pass messages between them allowing for underlying widget objects to be transformed in unison on the server and client sides.
I'm planning to reuse the same concept in an application I'm writing, so I'm considering simply reusing the actual implementation from IPython rather than writing one of my own. Does anyone have any experience that, and could provide me with some suggestions and caveats?
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Is there any known way to do realtime collaboration stuff (like Google Docs) in Python (not thru the browser)? I'm working on a program, and would like to add said feature to it.
Thanks
You can try Dweet, which is a service that stores JSON data in key values pairs. You can use one of the client libraries listed on their website or you could simply make a request like so:
urllib.urlopen('https://dweet.io/dweet/for/my-thing-name?dweet=awesome')
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I wonder if there's a way to convert pcap packets to byte streams that are usable in C or Python? That would be the best if the conversion can also be done in C or Python.
What I want to do is to regenerate the packets to do some testings, and due to the framework limitations, it can only be done in C/Python. Thanks a lot.
I have not used this tool so I cant comment on how good it is, but a quick google search lead me to http://src.carnivore.it/streams/about which seems to have the pipe and dump function thats seems to do what you want.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I was wondering if there is a proper way to periodically check an api for updated data. I'm looking for a more efficient solution than a while loop with a delay timer.
Are there any standard headers that can be checked to see if content was updated (in order to skip comparing previous results to the new ones?)
Additional notes
I using python at the moment but this is a broad question regarding all programming languages.
You probably want to look at the Conditional Requests spec and the Caching spec.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm sorry that this is probably a re-post of some description, however I couldn't find a question that gave me the answer I need.
I'm coding a basic chat server in Python, and I can get the clients to interact perfectly, however, the clients will only receive data after they have sent some.
I need the clients to be able to receive data at any point.
Does anyone have an example of some code I could look at to see how this could be done, or just a worded explanation of how to do it?
That's a really long story.
You could start by looking at Python's asynchat. Next, you might consider looking at Twisted.