Step
towards Python: +++++
Python +++++
- Python?
- Limitation of Python
- Pros and Cons of Python
- Features & Characteristics of Python
- Advantage and Disadvantage of Python
- Proof of concepts (POC) of Python
- Use cases, Implementations of Python
- Applications in Python
- Architecture, Structure of Python
- Workflow of Python
- Components of Python
- Common words, description, terminology, and glossary in Python
- Command-line tools of Python
- Symbols, Keywords and Identifiers in Python
- Python Content
- Data Type
- Abstract Data Type in Python
- Data Structure in Python
- Types of Data Structure in Python
- Algorithm in Python
- Properties of an Algorithm in Python
- Control Structure in Python
- OOPS features in Python
- How to achieve OOPS features in python
- Debugging in Python
- Error, Issue and Solutions in Python
- Python Blogs
Python?
Python was developed by Guido van Rossum in 1991.
Python is an interpreted, high-level, general-purpose programming language. Python is dynamically typed and garbage-collected. It supports multiple programming paradigms, including procedural, object-oriented, and functional programming. Python is often described as a "batteries included" language due to its comprehensive standard library.
Interpreted- interpret between source code and writing code line by line High-level language-High-level programming languages means writing computer instruction in a way that is easily understandable and close to human languages, like C, FORTRAN, and Pascal.
1.
Scope of Python: The scope of python in real life
day by day increases rapidly world-wide.
It can be used in a lot of
places:
·
Web Applications. [ Django, Flask, Tornado ]
·
Desktop Applications. [PyGTK, Cocoa ]
·
Hardware Programming [ Raspberry Pi ]
·
Data
Science, Machine Learning, and Deep Learning. Python is kind of a champion in
this field! [ learn, TensorFlow,
theano, Spark ]
·
Automation of daily and industrial tasks.
·
Network
Programming such as SDN [ Ryu, OpenFlow (POX) ]
·
Cloud
and DevOps [ OpenStack APIs, Fabric]
·
For any new piece of software coming out
today, there’s a Python API, this is because Python is getting a lot of
traction for very good reasons!
·
However, Python takes a beat at few places:
·
Web frontend development. Only thing which
runs on a browser is JavaScript and today’s world browser is the GUI for most
applications.
·
Mobile app development. Here you can use
either Java and Swift for Android and iOS respectively or Javascript for Hybrid
apps. Now, JavaScript can be used to create Native Apps as well as using React
Native.
·
To conclude, if you are thinking of learning
Python, go for it. Try doing small projects in each domain. If and when you
want to augment your Python skills with another programming language, I
sincerely suggest that you learn JavaScript as well.
2
.Limitation of Python:
Some limitation which are
listed below.
·
Important Shortcomings
of Python Programming Language.
·
Performance and Speed.
·
Incompatibility of Two
Versions.
·
Application
Portability.
·
Requires Additional
Testing.
·
Lacks Web Development
Capabilities.
·
Weak in Mobile
Computing.
·
Depends on Third-Party
Frameworks and Libraries.
3
.Pros and Cons of Python: Few Pros and Cons are listed below with
real-time implementation on python.
Python Pros:
·
Python is easy to learn for even a novice
developer. Its code is easy to read and you can do a lot of things just by
looking at it. Also, you can execute a lot of complex functionalities with
ease, thanks to the standard library.
·
Supports multiple systems and platforms.
·
Object-Oriented Programming-driven.
·
With the introduction of Raspberry Pi, a card
sized microcomputer, Python has expanded its reach to unprecedented heights.
Developers can now build cameras, radios, and games with ease. So, learning
Python could open new avenues for you to create some out-of-the-box gadgets.
·
Python has a plethora of frameworks that make
web programming very flexible.
·
Gives rise to quick development by using less
code. Even a small team can handle Python effectively.
·
Allows to scale even the most complex
applications with ease.
·
A large number of resources are available for
Python.
Python Cons:
·
Python is slow
·
Python is not a very good language for mobile
development.
·
Python is not a good choice for memory
intensive tasks.
·
It's near impossible to build a high-graphic
3D game using Python.
·
Has limitations with database access.
·
Python is not good for
multi-processor/multi-core work.
4
.Features and Characteristics of Python:
Python is a dynamic, high
level, free open source, and interpreted programming language. It supports
object-oriented programming as well as procedural oriented programming. In
Python, we don't need to declare the type of variable because it is a dynamically
typed language.
5
.Advantage and Disadvantage of Python:
Advantage:
·
Easy to code and read
·
Free and Open-Source
·
High- Level Language
·
Large Standard Library
·
Dynamically Typed
·
Portable
·
Extensible
·
Embeddable
·
Object-Oriented
Disadvantage:
·
Speed Limitations
·
Weak in Mobile Computing and Browsers
·
Design Restrictions
·
Underdeveloped Database Access Layers
6. Proof
of concepts (POC) of Python:
Proof of concept (POC) is a
realization of a certain method or idea in order to demonstrate its
feasibility, or a demonstration in principle with the aim of verifying that
some concept or theory has practical potential. A proof of concept is usually
small and may or may not be complete.
Step 1: Prove the Need. It
only makes sense to put time and money into building a product if people really
need it.
Step 2: Map Pain Points to
Solutions and Get Feedback.
Step 3: Prototype Your
Solution and Test.
Step 4: Create a Minimum
Viable Product.
Step 5: Design a Roadmap.
7.
Use cases& Implementations of Python:
·
Scientific computing: NumPy, SciPy, Matplotlib
·
Data cleaning, conversion: Pandas
·
Image processing: scikit-image, PIL, OpenCV
·
Machine learning: scikit-learn, Tensorflow
·
Symbolic computing: SymPy
·
Web application development: Django, Flask,
Bottle
·
Network programming: Tornado, Twisted
·
Desktop GUI application development:
wxPython, PySide, PyQt, PyGTK
·
Mobile application development: Kivy
·
Database access: SQLAlchemy
8. Applications
in Python:
·
Web Applications. We can use Python to
develop web applications.
·
Desktop GUI Applications.
·
Software Development.
·
Scientific and Numeric.
·
Business Applications.
·
Console Based Application.
·
Audio or Video-based Applications.
·
3D CAD Applications.
9. Architecture, Structure of Python:
python compiles sources into
computer-architecture independent binary files. If there is a syntax error
python reports and stops reading that source. Otherwise, or if you started with
a precompiled module, python evaluates the bytecodes using "the python
interpreter".
10.
Workflow, Dataflow of Python:
11.
Components of Python:
The components of python
are:
1. Print: Output strings,
integers, or any other data type.
2. The assignment statement:
Assigns a value to a variable.
3. Input: Allow the user to
input numbers or Booleans.
4. Raw input: Allow the user
to input strings.
5. Import: Import a module
into Python
12. Common words, description, terminology
and glossary in Python:
·
Feature
Description
· Indentation
Indentation refers to the spaces at the beginning of a code line
· Comments
Comments are code lines that will not be executed
· Multi-Line Comments
How to insert comments on multiple lines
· Creating Variables
Variables are containers for storing data values
· Variable Names
How to name your variables
· Assign Values to Multiple Variables
How to assign values to multiple variables
· Output Variables
Use the print statement to output variables
· String Concatenation
How to combine strings
· Global Variables
Global variables are variables that belong to the global scope
· Built-In Data Types
Python has a set of built-in data types
· Getting Data Type
How to get the data type of an object
· Setting Data Type
How to set the data type of an object
· Numbers
There are three numeric types in Python
· Int
The integer number type
· Float
The floating number type
· Complex
The complex number type
· Type Conversion
How to convert from one number type to another
· Random Number
Description
· Indentation
Indentation refers to the spaces at the beginning of a code line
· Comments
Comments are code lines that will not be executed
· Multi-Line Comments
How to insert comments on multiple lines
· Creating Variables
Variables are containers for storing data values
· Variable Names
How to name your variables
· Assign Values to Multiple Variables
How to assign values to multiple variables
· Output Variables
Use the print statement to output variables
· String Concatenation
How to combine strings
· Global Variables
Global variables are variables that belong to the global scope
· Built-In Data Types
Python has a set of built-in data types
· Getting Data Type
How to get the data type of an object
· Setting Data Type
How to set the data type of an object
· Numbers
There are three numeric types in Python
· Int
The integer number type
· Float
The floating number type
· Complex
The complex number type
· Type Conversion
How to convert from one number type to another
· Random Number
How to create a random
number
· · Specify a Variable Type
How
to specify a certain data type for a variable
· String Literals
How to create string literals
· Assigning a String to a Variable
How to assign a string value to a variable
· Multiline Strings
How to create a multi-line string
· Strings are Arrays
Strings in Python are arrays of bytes representing Unicode characters
· Slicing a String
How to slice a string
· Negative Indexing on a String
How to use negative indexing when accessing a string
· String Length
How to get the length of a string
· Check-In String
How to check if a string contains a specified phrase
· Format String
How to combine two strings
· Escape Characters
How to use escape characters
· Boolean Values
True or False
· Evaluate Booleans
Evaluate a value or statement and return either True or False
· Return Boolean Value
Functions that returns a Boolean value
· Operators
Use operator to perform operations in Python
· Arithmetic Operators
Arithmetic operator is used to performing common mathematical operations
· Assignment Operators
Assignment operators are used to assign values to variables
· Comparison Operators
Comparison operators are used to comparing two values
· Logical Operators
Logical operators are used to combining conditional statements
· Identity Operators
Identity operators are used to seeing if two objects are in fact the same object
· Membership Operators
Membership operators are used to testing is a sequence is present in an object
· Bitwise Operators
Bitwise operators are used to comparing (binary) numbers
· Lists
A list is an ordered, and changeable, collection
· Access List Items
How to access items in a list
· Change List Item
How to change the value of a list item
· Loop Through List Items
How to loop through the items in a list
· Check if List Item Exists
How to check if a specified item is present in a list
· List Length
How to determine the length of a list
· Add List Items
How to add items to a list
· Remove List Items
How to remove list items
· Copy a List
How to copy a list
· Join Two Lists
How to join two lists
· Tuple
A tuple is an ordered, and unchangeable, collection
· Access Tuple Items
How to access items in a tuple
· Change Tuple Item
How to change the value of a tuple item
· Loop List Items
How to loop through the items in a tuple
· Check if Tuple Item Exists
How to check if a specified item is present in a tuple
· Tuple Length
How to determine the length of a tuple
· Tuple With One Item
How to create a tuple with only one item
· Remove Tuple Items
How to remove tuple items
· Join Two Tuples
How to join two tuples
· Set
A set is an unordered, and unchangeable, collection
· Access Set Items
How to access items in a set
· Add Set Items
How to add items to a set
· Loop Set Items
DETTE KAPITTELET MANGLER
· Check if Set Item Exists
DETTE KAPITTELET MANGLER
· Set Length
How to determine the length of a set
· Remove Set Items
How to remove set items
· Join Two Sets
How to join two sets
· Dictionary
The Dictionary is an unordered, and changeable, collection
· String Literals
How to create string literals
· Assigning a String to a Variable
How to assign a string value to a variable
· Multiline Strings
How to create a multi-line string
· Strings are Arrays
Strings in Python are arrays of bytes representing Unicode characters
· Slicing a String
How to slice a string
· Negative Indexing on a String
How to use negative indexing when accessing a string
· String Length
How to get the length of a string
· Check-In String
How to check if a string contains a specified phrase
· Format String
How to combine two strings
· Escape Characters
How to use escape characters
· Boolean Values
True or False
· Evaluate Booleans
Evaluate a value or statement and return either True or False
· Return Boolean Value
Functions that returns a Boolean value
· Operators
Use operator to perform operations in Python
· Arithmetic Operators
Arithmetic operator is used to performing common mathematical operations
· Assignment Operators
Assignment operators are used to assign values to variables
· Comparison Operators
Comparison operators are used to comparing two values
· Logical Operators
Logical operators are used to combining conditional statements
· Identity Operators
Identity operators are used to seeing if two objects are in fact the same object
· Membership Operators
Membership operators are used to testing is a sequence is present in an object
· Bitwise Operators
Bitwise operators are used to comparing (binary) numbers
· Lists
A list is an ordered, and changeable, collection
· Access List Items
How to access items in a list
· Change List Item
How to change the value of a list item
· Loop Through List Items
How to loop through the items in a list
· Check if List Item Exists
How to check if a specified item is present in a list
· List Length
How to determine the length of a list
· Add List Items
How to add items to a list
· Remove List Items
How to remove list items
· Copy a List
How to copy a list
· Join Two Lists
How to join two lists
· Tuple
A tuple is an ordered, and unchangeable, collection
· Access Tuple Items
How to access items in a tuple
· Change Tuple Item
How to change the value of a tuple item
· Loop List Items
How to loop through the items in a tuple
· Check if Tuple Item Exists
How to check if a specified item is present in a tuple
· Tuple Length
How to determine the length of a tuple
· Tuple With One Item
How to create a tuple with only one item
· Remove Tuple Items
How to remove tuple items
· Join Two Tuples
How to join two tuples
· Set
A set is an unordered, and unchangeable, collection
· Access Set Items
How to access items in a set
· Add Set Items
How to add items to a set
· Loop Set Items
DETTE KAPITTELET MANGLER
· Check if Set Item Exists
DETTE KAPITTELET MANGLER
· Set Length
How to determine the length of a set
· Remove Set Items
How to remove set items
· Join Two Sets
How to join two sets
· Dictionary
The Dictionary is an unordered, and changeable, collection
·
Access Dictionary Items
How to access items in a dictionary
· Change Dictionary Item
How to change the value of a dictionary item
· Loop Dictionary Items
How to loop through the items in a tuple
· Check if Dictionary Item Exists
How to check if a specified item is present in a dictionary
· Dictionary Length
How to determine the length of a dictionary
· Add Dictionary Item
How to add an item to a dictionary
· Remove Dictionary Items
How to remove dictionary items
· Copy Dictionary
How to copy a dictionary
· Nested Dictionaries
A dictionary within a dictionary
· If Statement
How to write an if statement
· If Indentation
If statements in Python relies on indentation (whitespace at the beginning of a line)
· Elif
elif is the same as "else if" in other programming languages
· Else
How to write an if...else statement
· Shorthand If
How to write an if statement in one line
· Shorthand If Else
How to write an if...else statement in one line
· If AND
Use the and keyword to combine if statements
· If OR
Use the or keyword to combine if statements
· Nested If
How to write an if statement inside an if statement
· The pass Keyword in If
Use the pass keyword inside empty if statements
· While
How to write a while loop
· While Break
How to break a while loop
· While Continue
How to stop the current iteration and continue with the next
· While Else
How to use an else statement in a while loop
· For
How to write a for loop
· Loop Through a String
How to loop through a string
· For Break
How to break a for loop
· For Continue
How to stop the current iteration and continue with the next
· Looping Through a range
How to loop through a range of values
· For Else
· How to use an else statement in a for loop
Nested Loops
· How to write a loop inside a loop
For pass
· Use the pass keyword inside empty for loops
Function
· How to create a function in Python
Call a Function
· How to call a function in Python
Function Arguments
· How to use arguments in a function
*args
To deal with an unknown number of arguments in a function, use the * symbol before the parameter name
· Keyword Arguments
How to use keyword arguments in a function
· *kwargs
To deal with an unknown number of keyword arguments in a function, use the * symbol before the parameter name
· Default Parameter Value
How to use a default parameter value
· Passing a List as an Argument
How to pass a list as an argument
· Function Return Value
How to return a value from a function
· The pass Statement i Functions
Use the pass statement in empty functions
· Function Recursion
Functions that can call itself is called recursive functions
· Lambda Function
How to create anonymous functions in Python
· Why Use Lambda Functions
Learn when to use a lambda function or not
· Array
Lists can be used as Arrays
· What is an Array
Arrays are variables that can hold more than one value
· Access Arrays
How to access array items
· Array Length
How to get the length of an array
· Looping Array Elements
How to loop through array elements
· Add Array Element
How to add elements from an array
· Remove Array Element
How to remove elements from an array
· Array Methods
Python has a set of Array/Lists methods
· Class
A class is like an object constructor
· Create a ass
How to create a class
· The Class __init__() Function
The __init__() function is executed when the class is initiated
· Object Methods
Methods in objects are functions that belong to the object
· self
The self parameter refers to the current instance of the class
· Modify Object Properties
How to modify properties of an object
· Delete Object Properties
How to modify properties of an object
· Delete Object
How to delete an object
· Class pass Statement
Use the pass statement is empty classes
· Create Parent Class
How to create a parent class
· Create Child Class
How to create a child class
· Create the __init__() Function
How to create the __init__() function
· super Function
The super() function make the child class inherit the parent class
· Add Class Properties
How to add a property to a class
· Add Class Methods
How to add a method to a class
· Iterators
An an iterators is an object that contains a countable number of values
How to access items in a dictionary
· Change Dictionary Item
How to change the value of a dictionary item
· Loop Dictionary Items
How to loop through the items in a tuple
· Check if Dictionary Item Exists
How to check if a specified item is present in a dictionary
· Dictionary Length
How to determine the length of a dictionary
· Add Dictionary Item
How to add an item to a dictionary
· Remove Dictionary Items
How to remove dictionary items
· Copy Dictionary
How to copy a dictionary
· Nested Dictionaries
A dictionary within a dictionary
· If Statement
How to write an if statement
· If Indentation
If statements in Python relies on indentation (whitespace at the beginning of a line)
· Elif
elif is the same as "else if" in other programming languages
· Else
How to write an if...else statement
· Shorthand If
How to write an if statement in one line
· Shorthand If Else
How to write an if...else statement in one line
· If AND
Use the and keyword to combine if statements
· If OR
Use the or keyword to combine if statements
· Nested If
How to write an if statement inside an if statement
· The pass Keyword in If
Use the pass keyword inside empty if statements
· While
How to write a while loop
· While Break
How to break a while loop
· While Continue
How to stop the current iteration and continue with the next
· While Else
How to use an else statement in a while loop
· For
How to write a for loop
· Loop Through a String
How to loop through a string
· For Break
How to break a for loop
· For Continue
How to stop the current iteration and continue with the next
· Looping Through a range
How to loop through a range of values
· For Else
· How to use an else statement in a for loop
Nested Loops
· How to write a loop inside a loop
For pass
· Use the pass keyword inside empty for loops
Function
· How to create a function in Python
Call a Function
· How to call a function in Python
Function Arguments
· How to use arguments in a function
*args
To deal with an unknown number of arguments in a function, use the * symbol before the parameter name
· Keyword Arguments
How to use keyword arguments in a function
· *kwargs
To deal with an unknown number of keyword arguments in a function, use the * symbol before the parameter name
· Default Parameter Value
How to use a default parameter value
· Passing a List as an Argument
How to pass a list as an argument
· Function Return Value
How to return a value from a function
· The pass Statement i Functions
Use the pass statement in empty functions
· Function Recursion
Functions that can call itself is called recursive functions
· Lambda Function
How to create anonymous functions in Python
· Why Use Lambda Functions
Learn when to use a lambda function or not
· Array
Lists can be used as Arrays
· What is an Array
Arrays are variables that can hold more than one value
· Access Arrays
How to access array items
· Array Length
How to get the length of an array
· Looping Array Elements
How to loop through array elements
· Add Array Element
How to add elements from an array
· Remove Array Element
How to remove elements from an array
· Array Methods
Python has a set of Array/Lists methods
· Class
A class is like an object constructor
· Create a ass
How to create a class
· The Class __init__() Function
The __init__() function is executed when the class is initiated
· Object Methods
Methods in objects are functions that belong to the object
· self
The self parameter refers to the current instance of the class
· Modify Object Properties
How to modify properties of an object
· Delete Object Properties
How to modify properties of an object
· Delete Object
How to delete an object
· Class pass Statement
Use the pass statement is empty classes
· Create Parent Class
How to create a parent class
· Create Child Class
How to create a child class
· Create the __init__() Function
How to create the __init__() function
· super Function
The super() function make the child class inherit the parent class
· Add Class Properties
How to add a property to a class
· Add Class Methods
How to add a method to a class
· Iterators
An an iterators is an object that contains a countable number of values
·
Iterator vs Iterable
What is the difference between an iterator and an iterable
· Loop Through an Iterator
How to loop through the elements of an iterator
· Create an Iterator
How to create an iterator
· StopIteration
How to stop an iterator
· Global Scope
When does a variable belong to the global scope?
· Global Keyword
The the global makes the variable global
· Create a Module
How to create a module
· Variables in Modules
How to use variables in a module
· Renaming a Module
How to rename a module
· Built-in Modules
How to import built-in modules
· Using the dir() Function
List all variable names and function names in a module
· Import From Module
How to import only parts from a module
· Datetime Module
How to work with dates in Python
· Date Output
How to output a date
· Create a Date Object
How to create a date object
· The strftime Method
How to format a date object into a readable string
· Date Format Codes
The DateTime module has a set of legal format codes
· JSON
How to work with JSON in Python
· Parse JSON
How to parse JSON code in Python
· Convert into JSON
How to convert a Python object into JSON
· Format JSON
How to format JSON output with indentations and line breaks
· Sort JSON
How to sort JSON
· RegEx Module
How to import the regex module
· RegEx Functions
The re module has a set of functions
· Metacharacters in RegEx
Metacharacters are characters with a special meaning
· RegEx Special Sequences
A a ckslash followed by a character has a special meaning
· RegEx Sets
A set is a set of characters inside a pair of square brackets with a special meaning
· RegEx Match Object
The Match Object is an object containing information about the search and the result
· Install PIP
How to install PIP
· PIP Packages
How to download and install a package with PIP
· PIP Remove Package
How to remove a package with PIP
· Error Handling
How to handle errors in Python
· Handle Many Exceptions
How to handle more than one exception
· Try Else
How to use the else keyword in a try statement
· Try FinallyHow to use the finally keyword try statement
· Raise
How to raise an exception in Python
What is the difference between an iterator and an iterable
· Loop Through an Iterator
How to loop through the elements of an iterator
· Create an Iterator
How to create an iterator
· StopIteration
How to stop an iterator
· Global Scope
When does a variable belong to the global scope?
· Global Keyword
The the global makes the variable global
· Create a Module
How to create a module
· Variables in Modules
How to use variables in a module
· Renaming a Module
How to rename a module
· Built-in Modules
How to import built-in modules
· Using the dir() Function
List all variable names and function names in a module
· Import From Module
How to import only parts from a module
· Datetime Module
How to work with dates in Python
· Date Output
How to output a date
· Create a Date Object
How to create a date object
· The strftime Method
How to format a date object into a readable string
· Date Format Codes
The DateTime module has a set of legal format codes
· JSON
How to work with JSON in Python
· Parse JSON
How to parse JSON code in Python
· Convert into JSON
How to convert a Python object into JSON
· Format JSON
How to format JSON output with indentations and line breaks
· Sort JSON
How to sort JSON
· RegEx Module
How to import the regex module
· RegEx Functions
The re module has a set of functions
· Metacharacters in RegEx
Metacharacters are characters with a special meaning
· RegEx Special Sequences
A a ckslash followed by a character has a special meaning
· RegEx Sets
A set is a set of characters inside a pair of square brackets with a special meaning
· RegEx Match Object
The Match Object is an object containing information about the search and the result
· Install PIP
How to install PIP
· PIP Packages
How to download and install a package with PIP
· PIP Remove Package
How to remove a package with PIP
· Error Handling
How to handle errors in Python
· Handle Many Exceptions
How to handle more than one exception
· Try Else
How to use the else keyword in a try statement
· Try FinallyHow to use the finally keyword try statement
· Raise
How to raise an exception in Python
13. Command-line tools of Python:
The
command-line interface (also known as CLI) is a means to interact with a
command-line script. There are tons of Python libraries and modules to help
build a command line app from parsing arguments and options to flagging to full
blown CLI “frameworks” which do things like colorized output, progress bars,
sending emails and so on.
A
command-line interface (CLI) usually starts with the name of the executable.
You just enter it’s name in the console and you access the main entry point of
the script, an example is pip.
There
are parameters you need to pass to the script depending on they are developed
and they can either be:
Arguments:
This is a required parameter that’s passed to the script. If you don’t provide
it, the CLI will run into an error. For instance, Django is the argument in
this command: pip install django.
Options: As
the name implies, it is an optional parameter which usually comes in a name
and a value pair such as pip install Django --cache-dir ./my-cache-dir. The
--cache-dir is an option param and the value ./my-cache-dir should be used as
the cache directory.
Flags:
This is a ecial option parameter that tells the script to enable or disable a
certain behavior. The most common one is probably --help.
Different
python packages for building command-line interface.
Argparse
argparse
is the default python module for creating command lines programs. It provides
all the features you need to build a simple CLI.
Click
With
Click, you can build CLI easily compared to Argparse. Click solves the same
problem argparse solves, but uses a slightly different approach to do so. It
uses the concept of decorators. This needs commands to be functions that can be
wrapped using decorators.
Docopt
Docopt
is a lightweight python package for creating command line interface easily by
parsing POSIC-style or Markdown usage instructions. Docopt uses conventions
that have been used for years in formatting help messages and man page for
describing a command-line interface. Interface description in docopt is such
a help message but formalized.
PyInquirer
PyInquirer
is a module for interactive command-line user interfaces.
PyFiglet
Piglet
is a python module for converting strings into ASCII Text with arts fonts.
Piglet is a full port of FIGlet (FIGlet - hosted by PLiG) into pure python.
Clint
Clint
is incorporated with everything you need in creating a CLI. It supports colors,
awesome nest-able indentation context manager supports custom email-style
quotes have an awesome Column printer with optional auto-expanding columns and
so on.
There are many more.
You can check and choose the best CLI library which is suitable for your
project.
1.
Symbols,
Keywords and Identifiers in Python:
Symbols: There are so many symbols given
by python, you can see in python documentation.
Keywords are the reserved strings that
the language uses in conjunction with object names and symbols to build
statements.
Few keywords are listed below:
False,class,finally,is,return,None,continue,for,lambda,try,True,def,from,
nonlocal,while,and,del,global,not,with,as,elif,or,yield,assert,else,import,pass
etc
An identifier is a unique name given to
a particular variable, function,or label of class in the program.
Key
Differences between Keyword and Identifier:
Keywords
are used to recognize the type/kind of entity and identifier is used to
uniquely name that entity. For example, if we write ‘int number’, where ‘int’
is a keyword and ‘number’ is an identifier, i.e., this statement clearly
defines that we define an entity ‘number’ which is of type int (integer).
Keywords
are distinct they are not further classified. Whereas, if identifiers are
involved in an external link process, i.e. if it includes function names and
the al variable that are shared between files, then it is called ‘external
names’, while they are not used in external link process and include the name
of a cal variable, then it is called ‘internal names’.
please share it and comment
ReplyDelete