Differences between Python 2 and Python 3:

If have any question in front of u like which one i need to select either Python 3 or Python 2!

See it’s completely depends on what u required and what u have do with your darling(Python).

Here going to discuss what are merits of Python 2, and merits of Python 3, comparison between both, suggests to which one u go.

Merits and Advantages of Python 2 or Why u want to use only Python 2:

  • Firstly, if you’re deploying to an environment you don’t control, that may impose a specific version, rather than allowing you a free selection from the available versions.
  • Secondly, if you want to use a specific third party package or utility that doesn’t yet have a released version that is compatible with Python 3, and porting that package is a non-trivial task, you may choose to use Python 2 in order to retain access to that package.
  • Python 2 have been ruling world of computers by almost 20 years , so there are lot of solutions projects and modules are implemented which may solves your problem without writing from scratch.
  • Python 2 Had good materials and books, sites throughout world.
  • And there lot of code in world so u may come out easily from your problem.

Merits and Advantages of Python 3:

  • Strings are Unicode by default
  • Non-local variable declarations
  • Function annotations
  • Syntax for keyword-only arguments
  • Including using new-style classes
  • Not using ancient deprecated arcane incantations of print, using lazy iterators where available, etc

Module Supports:

  • Some of The module which are not yet compatible to Python 3 (Twisted (for networking and other applications),gevent (a network library like Twisted, but using micro-threads rather than an explicitly asynchronous style)).
  • Many other major packages have been ported to Python 3 (numpy (for number crunching) ,Django, Flask, CherryPy and Pyramid (for Web sites) ).

U are Interested in Python 3 but stopping u afraid of Python 3 support in market , and module supports.

For this u have tool which will convert your Python 2 module code into Python 3 code (2to3 tool that allows 3.x code to be generated from 2.x). For this detail look into Python official language site.

Suggestion:

If u really a guy who always interested into doing experiments with code , sure u are welcome by Python 3.

No, I am not like that:

Then Better to go Python 2 because world exists a lot of code it may helps u.

 

Socket Programming with Python:

Module For Socket Programming in Python: Socket

For more information and explanation refer the below links.

https://docs.python.org/2/howto/sockets.html

https://www.tutorialspoint.com/python/python_networking.htm

http://www.bogotobogo.com/python/python_network_programming_server_client.php

http://www.techbeamers.com/python-tutorial-essentials-of-python-socket-programming/