Python Environment

     Python comes pre-installed on most Linux distributions and is available as packages or installers on all other operating systems. To install python
      1.go to www.python.org
      2. scroll down and click and download the latest version of python.
   After installing Python, open a new terminal (Unix/ MacOS) or Powershell (windows). Enter python 3 to run the Python IDLE shell.
   IDLE stands for Integrated Development and Learning Environment. This process evaluates each line of code you write and outputs the result.
   We shouldn't use the IDLE interpreter for longer snippets of code, however. It is much easier to write Python code using a text editor. There are a lot of option here, such as Atoms, Emacs, Vim, Sublime, PyCharm or Visual Studio Code, each with its advantages. Visual Studio Code, is a good option, as it was built on top of Atom's architecture, but avoids lot of overheads Atom doesn't. It is still highly customizable and much more responsive than Atom.
   To run Python file, which must have a .py extension, invoke a new terminal inside the directory that contains the file and write:
                              python3 myPythonfile.py

Hello World!
   We can write our first program, and print Hello World to the console!
To do this, in the Python 3 interpreter (IDLE), use Python's print function as follows:
           >>> print ('Hello World')
Note that print, as a method which you pass argument to, is specific syntax to Python 3.x. In Python 2.x print is a statement and would be used as follows:
          >>> print 'Hello World'
In both cases, the output is:
  Hello World.  

That's all about python environment. In next post you will be getting general information about Syntax and Numerical Operators of python..

Enjoy learning! Conquer the concept with concept conqurer.

Comments

Post a Comment

Popular posts from this blog

Computer Applications

Python