Difference between Python 2 and Python 3:

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

See it completely depends on what you required and what you have to do with your darling(Python).

Here going to discuss, merits of Python 2, and the merits of Python 3, comparison between both, suggests which one to choose

Merits and Advantages of Python 2 or Why you 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 has been ruling the world of computers for almost 20 years, so there are a lot of projects and modules are implemented which may solve your problem without writing from scratch.
  • Python 2 Had good materials and books, sites throughout the world.
  • A lot of code in the world so you may come out easily from your issue

Merits and Advantages of Python 3:

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

Module Supports:

  • Some of the modules are not yet compatible with 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) ).

Interested in Python 3 but stopping you afraid of Python 3 support in the market, and module supports.

For this, you have a tool that will convert your Python 2 module code into Python 3 code (2to3 tool that allows 3.x code to be generated from 2.x). Have a detailed look at Python official language site.

Suggestion:

If you really a person who is always interested in doing experiments with code, sure you are welcome by Python 3.

No, I am not like that:

Then Better to go Python 2 because the world exists a lot of code it

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/