Tuesday, 27 April 2021

about python

 Python is simple to use, but it is a real programming language, offering much more structure and support for large programs than shell scripts or batch files can offer. On the other hand, Python also offers much more error checking than C, and, being a very-high-level language, it has high-level data types built in, such as flexible arrays and dictionaries. Because of its more general data types Python is applicable to a much larger problem domain than Awk or even Perl, yet many things are at least as easy in Python as in those languages.


Python allows you to split your program into modules that can be reused in other Python programs. It comes with a large collection of standard modules that you can use as the basis of your programs — or as examples to start learning to program in Python. Some of these modules provide things like file I/O, system calls, sockets, and even interfaces to graphical user interface toolkits like Tk.


Python is an interpreted language, which can save you considerable time during program development because no compilation and linking is necessary. The interpreter can be used interactively, which makes it easy to experiment with features of the language, to write throw-away programs, or to test functions during bottom-up program development. It is also a handy desk calculator.


Python enables programs to be written compactly and readably. Programs written in Python are typically much shorter than equivalent C, C++, or Java programs, for several reasons:


the high-level data types allow you to express complex operations in a single statement;


statement grouping is done by indentation instead of beginning and ending brackets;


no variable or argument declarations are necessary.


Python is extensible: if you know how to program in C it is easy to add a new built-in function or module to the interpreter, either to perform critical operations at maximum speed, or to link Python programs to libraries that may only be available in binary form (such as a vendor-specific graphics library). Once you are really hooked, you can link the Python interpreter into an application written in C and use it as an extension or command language for that application.

Thursday, 22 April 2021

Python Features and Advantages

 Python Features and Advantages

1. Easy to Code

Python is a very high-level programming language, yet it is effortless to learn. Anyone can learn to code in Python in just a few hours or a few days. Mastering Python and all its advanced concepts, packages and modules might take some more time. However, learning the basic Python syntax is very easy, as compared to other popular languages like C, C++, and Java. 


Let us now look at the next feature of python.


2. Easy to Read

Python code looks like simple English words. There is no use of semicolons or brackets, and the indentations define the code block. You can tell what the code is supposed to do simply by looking at it. 


We will now look into the next feature of python.


3. Free and Open-Source

Python is developed under an OSI-approved open source license. Hence, it is completely free to use, even for commercial purposes. It doesn't cost anything to download Python or to include it in your application. It can also be freely modified and re-distributed. Python can be downloaded from the official Python website.


Let us find out the next feature of python.


4. Robust Standard Library

Python has an extensive standard library available for anyone to use. This means that programmers don’t have to write their code for every single thing unlike other programming languages. There are libraries for image manipulation, databases, unit-testing, expressions and a lot of other functionalities. In addition to the standard library, there is also a growing collection of thousands of components, which are all available in the Python Package Index.


We'll now learn about the next feature of python.


5. Interpreted

When a programming language is interpreted, it means that the source code is executed line by line, and not all at once. Programming languages such as C++ or Java are not interpreted, and hence need to be compiled first to run them. There is no need to compile Python because it is processed at runtime by the interpreter. 


Let us now look at the next feature of python.


6. Portable

Python is portable in the sense that the same code can be used on different machines. Suppose you write a Python code on a Mac. If you want to run it on Windows or Linux later, you don’t have to make any changes to it. As such, there is no need to write a program multiple times for several platforms.


7. Object-Oriented and Procedure-Oriented

A programming language is object-oriented if it focuses design around data and objects, rather than functions and logic. On the contrary, a programming language is procedure-oriented if it focuses more on functions (code that can be reused). One of the critical features of Python is that it supports both object-oriented and procedure-oriented programming. 


8. Extensible

A programming language is said to be extensible if it can be extended to other languages. Python code can also be written in other languages like C++, making it a highly extensible language.


9. Expressive

Python needs to use only a few lines of code to perform complex tasks. For example, to display Hello World, you simply need to type one line - print(“Hello World”). Other languages like Java or C would take up multiple lines to execute this.


10. Support for GUI

One of the key aspects of any programming language is support for GUI or Graphical User Interface. A user can easily interact with the software using a GUI. Python offers various toolkits, such as Tkinter, wxPython and JPython, which allows for GUI's easy and fast development.


11. Dynamically Typed

Many programming languages need to declare the type of the variable before runtime. With Python, the type of the variable can be decided during runtime. This makes Python a dynamically typed language.


12. High-level Language

Python is a high-level programming language because programmers don’t need to remember the system architecture, nor do they have to manage the memory. This makes it super programmer-friendly and is one of the key features of Python.


13. Simplify Complex Software Development

Python can be used to develop both desktop and web apps and complex scientific and numerical applications. Python's data analysis features help you create custom big data solutions without so much time and effort. You can also use the Python data visualization libraries and APIs to present data in a more appealing way. Several advanced software developers use Python to accomplish high-end AI and natural language processing tasks. 


14. Other Advanced Programming Features

Python contains several advanced programming features such as generators (used to create iterators with a different approach that most other languages) and list comprehensions (used to create new lists from other iterables). Python also has automatic memory management eliminating the need to manually allocate and free memory in the code.

Wednesday, 24 February 2021

Introdoction to Python & Installation

 Introduction to Python and installation:

Python is a widely used general-purpose, high level programming language.

It was first introduced in 1991 by Guido van Rossum , a Dutch computer programmer.

• The language places strong emphasis on code reliability and simplicity so that the programmers can develop applications rapidly developed by Python Software Foundation.

It was mainly developed for emphasis on code readability, and its syntax allows programmers to express concepts in fewer lines of code.

Python is a programming language that lets you work quickly and integrate systems more efficiently.

Beginning with Python programming:

1)      Finding an Interpreter: Before we start Python programming, we need to have an interpreter to interpret and run our programs. There are certain online interpreters like https://ide.geeksforgeeks.org/, http://ideone.com/ or http://codepad.org/ that can be used to start Python without installing an interpreter.

2)      Windows: There are many interpreters available freely to run Python scripts like IDLE (Integrated Development Environment) which is installed when you install the python software.

Why to use Python: The following are the primary factors to use python in day-to-day life

1. Python is object-oriented

Structure supports such concepts as polymorphism, operation overloading and multiple inheritance.

2. Indentation : Indentation is one of the greatest feature in python

3. It’s free :(open source): Downloading python and installing python is free and easy

4. It’s Powerful

Ø  Dynamic typing

Ø  Built-in types and tools

Ø  Library utilities

Ø  Third party utilities (e.g. Numeric, NumPy, sciPy)

Ø  Automatic memory management

5. It’s Portable

Ø  Python runs virtually every major platform used today

Ø  As long as you have a compatible python interpreter installed, python

programs will run in exactly the same manner, irrespective of platform.

6. It’s easy to use and learn

Ø  No intermediate compile

Ø  Python Programs are compiled automatically to an intermediate form called

Ø  byte code, which the interpreter then reads.

Ø  This gives python the development speed of an interpreter without the

performance loss inherent in purely interpreted languages.

Ø  Structure and syntax are pretty intuitive and easy to grasp.

7. Interpreted Language

Python is processed at runtime by python Interpreter

8. Interactive Programming Language

Users can interact with the python interpreter directly for writing the programs

9. Straight forward syntax

The formation of python syntax is simple and straight forward which also makes it

popular.

Python is a general purpose interpreted interactive object oriented and high level programming language.

Python is multi-paradigm programming language ,which allows user to code in several different programming styles.

Python supports cross platform development and is available through open source.

 Python is widely used for scripting in Game menu applications effectively.

Python can be easily integrated with C/C++ CORBA, ActiveX and Java.

CPython is a python integrated with C/C++ language.

Similarly JPython is a purely integrated language where Java and Python code can interchangeably use inline in the program.

Working with Python :Python Code Execution:

Python’s traditional runtime execution model: Source code you type is translated to byte

code, which is then run by the Python Virtual Machine (PVM).

 Your code is automatically compiled,

but then it is interpreted.

Source Byte code Runtime

Source code extension is .py

Byte code extension is .pyc (Compiled python code)

There are two modes for using the Python interpreter:

• Interactive Mode

• Script Mode

 m.py

 m.pyc

 Running Python in interactive mode:

Without passing python script file to the interpreter, directly execute code to Python prompt.

Once you’re inside the python interpreter, then you can start.

>>> print("hello world")

hello world

 

Python can be easily integrated with C/C++ CORBA, ActiveX and Java.

• CPython is a python integrated with C/C++ language.

• Similarly JPython is a purely integrated language where Java and Python code can interchangeably use inline in the program.

Advantages of Python

• Most programs in Python require considerably less number of lines of code to perform the same task compared to other languages like C .So less programming errors and reduces the development time needed also.

• Though Perl is a powerful language ,it is highly syntax oriented .Similarly C also.

Why to Learn Python

• There are large number of high-level programming languages like C ,C++,Java etc.But when compared to all these languages Python has simplest Syntax, availability of libraries and built-in modules.

• Python comes with an extensive collection of third party resources that extend the capabilities of the language.

Python can be used for large variety of tasks like Desktop applications ,Data base applications, network programming ,game programming and even mobile development also.

• Python is also a cross platform language which means that the code written for one operating system like Windows ,will work equally well with Linux or MacOS without any changes to the python code.

INSTALLING PYTHON ON YOUR PC

• To learn this language first ,you have to download the software which is the Python Interpreter.

• Presently the version in use is Python 3.x But you can also use Python 2.x ,like 2.7..etc .This depends on your system and your interest. To download the Python interpreter go to the site http://www.python.org/downloads and click on the suitable icon.

The website appears as shown below.

From the website you can download the suitable version based on

your OS (whether the OS is Windows ,  MacOS or Linux).

• And the Processor 32 bit or 64 bit.

For ex: if you are using 64-bit Windows system ,you are likely to download Windowsx86-64MSI Installer.

• So just click on the link and download and install the Python Interpreter.

This Python shell allows us to use Python in interactive mode.

• The shell waits for a command from the user ,executes it and returns the result.

Monday, 8 February 2021

CMS using Python

 What is a CMS?

A content management system - better known as a CMS - is a kind of software that’s designed for the creation and modification of digital content. Among its wide variety of features, it usually offers publishing options, version control, search engine optimization, access control, and different design templates. It streamlines the content creation and publishing processes by providing a simple user interface that supports your marketing strategy, without requiring any advanced technical knowledge from users. It is used to create user friendly environment.

Core functionality and managing assets factors should you pay attention to when choosing a technology to build a CMS?

A good CMS should provide multiple handy out-of-the-box functionalities; this will make working with content easier and more robust. It should also allow for easy asset management.

User interaction:

The CMS should be intuitive and user friendly; it should provide self-explanatory ways to manage content and even add new subpages.

SEO:

A good CMS should be prepared for SEO. The page structure, meta tags, and other auto-generated content have to be SEO-friendly.

Integration with other systems:

The CMS should be a place gathering in one spot different external services and providers necessary for your business to function, such as payment gateways or social media integrations.

Popularity:

It’s super important to choose a technology which is backed by a large community, offers lots of integrations and extensions along with easy-to-find manuals.

Experts:

You need to have access to a broad market of IT specialists who will help you create your ideal team and be able to fill in any rotation gaps.

Performance:

The selected technology should start performing right out of the box, and be easy to install and deploy without bearing additional expenses on external support.

Cloud storage:

You might need a wide range of cloud solutions for installing and storing the entire system.

Security:

It’s safer to select a full-fledged technology - one that has already been tested in many different areas and is supported by a community that deals with any new bugs.

All of these factors appear to be outstanding in Python development.

Why is Python a good language of choice for creating a CMS?

1. Maturity:

Python has two big players in the world of CMSs: Wagtail and Django CMS. Both are well-tested and mature, quality solutions, with a large community of customers, editors and - above all - developers who are constantly working on new features and releasing updates and bug fixes. This is important because it makes the software even more functional and reliable.

2. Ease of use and speed :

Python frameworks are easy to adapt and convert into a tailor-made CMS, while at the same time act like building blocks for programming. This is extremely helpful when it comes to fast delivery with a limited team, as you can have a lot of functions, like contact forms, WYSIWYG editor or page hierarchy without coding, since they are already implemented.

3. Prebuilt admin dashboard:

Both Wagtail and Django CMS are built on top of the Django framework which comes with a prebuilt admin dashboard. This is a huge advantage in terms of the speed of developing a CMS that has a built-in space for admins to manage content, users, and so on. You can get a sneak peek by clicking on the links: DjangoCMS/Wagtail.

4. Advanced and ready-to-use features:

The biggest advantages of Python frameworks include: simplicity of deployment, the availability of cloud solutions (like AWS, GCP or Heroku) and a lot of single-click tools that make it possible to establish proper CI/CD pipelines for high degrees of automation in the process of delivering new code. These and many other things guarantee that your product will be well-tested and resistant to time.

What is crucial from business perspective?

All of these points are not only significant for devs, but also crucial from a business perspective.

When you use a mature and relatively secure framework backed by so many experts, you don’t have to spend a lot of time and money on any additional support.

You also have more specialized developers to choose from. Looking for someone to fill a vacancy is not so problematic.

The ease of use and many built-in features already available in the framework make development go much faster. It’s also more efficient and less costly.

The further development of your CMS also becomes simpler, so you can think about unwinding its full potential, making it as made-to-measure as possible.

Remember: if you don’t adjust the technology required for building a CMS properly, this may result in a lengthier development and very poor support in the case of a critical situation. There’s also a big chance that you will be dramatically limited by its functions, so scaling may be a nightmare. You might spend a lot of money on solving problems that wouldn’t have occurred if you had just selected a better option.

This is why creating a Python-based CMS may be the safest alternative.

about python

 Python is simple to use, but it is a real programming language, offering much more structure and support for large programs than shell scri...