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...