Showing posts with label python. Show all posts
Showing posts with label python. Show all posts
Tuesday, 13 December 2016
Sunday, 3 November 2013
A skeletal model for the client-proxy-server system
A skeletal model for the client-proxy-server systemClientThe client should do the following things:
ProxyThe proxy, being basically both a kind of a server and a client, should do the following things:
ServerThe server should do the following things:
Additional notesAfter implementing the basic model described above, you can easily start adding more features. For example, you could add a sleep in the proxy between steps 3 and 4 and instead of directly sending the data received from the client to the server, you could read the file and send the contents - this way you can manually change the file before it gets sent to the server.I also suggest you read Beej's Guide to Network Programming if you want to really learn the basics of network programming. The examples are in C, but the basic principles also apply in Python (and other languages as well). |
Friday, 11 October 2013
What is CPython
19 down vote accepted
|
So what is CPython
CPython is the original Python implementation. It is the implementation you download from Python.org. People call it CPython to distinguish it from other, later, Python implementations, and to distinguish the implementation of the language engine from the Python programming language itself.The latter part is where your confusion comes from; you need to keep Python-the-language separate from whatever runs the Python code. CPython happens to be implemented in C. That is just an implementation detail really. CPython compiles your python code into bytecode (transparently) and interprets that bytecode in a evaluation loop.
What about Jython, etc.
Jython, IronPython and PyPy are the current 'other' implementations of the Python programming language; these are implemented in Java, C# and RPython (a subset of Python), respectively. Jython compiles your Python code to Java bytecode, so your Python code can run on the JVM. IronPython lets you run Python on the Microsoft CLR. And PyPy, being implemented in (a subset of) Python, lets you run Python code faster than CPython, which rightly should blow your mind. :-)
Actually compiling to C
So CPython does itself not translate your Python code to C. It instead runs a interpreter loop. There is a project that does translate Python-ish code to C, and that is called Cython. Cython adds a few extensions to the Python language, and lets you compile your code to C extensions, code that plugs into the CPython interpreter. |
Subscribe to:
Posts (Atom)