Python on Windows

In this article I am not only giving the reasons to use Python, but an Easy Explanation for Absolutely Anyone. I will cover Python introduction, installation and how to create application on windows.

Python is “An open source, object-oriented, scripting language”

High-level language

Python is a High-level language referred as “closer to humans.” In other words, their programming style and context is easier to learn and implement than low-level languages.

Fig 1.0

Simple

It is simple like English. Easiness allows you to focus more on solution instead of syntax.

PythonOther
print(“Hello World!”)using System;
namespace HelloWorldApp {
class kj {static void Main(string[] args) { Console.WriteLine("Hello World!"); Console.ReadKey(); } }
}

Speed

Above image describes measurement and comparison with other programming languages. One of the comparisons is Speed, which is directly related to Abstraction. Abstraction is a relationship between the language with computer hardware. Less the abstraction means less layers of code to reach hardware. Low level languages are nearer to matching code perhaps they are faster.

Dynamic Typecasting.

Code of other programming language is written to compare.

PythonOther
name = “Python” #Doesn’t need any datatype.
age = 40
class static_example
{
public static void main (String[] args)
{
int a = 20; // Variable declaration
float b;
b = (float) a; //Type Casting System.out.println(b);
}
}

Elegant one liner block.

Code of other programming language is written to compare.

Python
# THE DATA
n = 10
THE ONE-LINER
fib = lambda x: x if x<=1 else fib(x-1) + fib(x-2)
THE RESULT
for i in range(n):
print(fib(i))
Other
Create function fn_generate_fibonacciseries(@number int)
returns @returntable table (rownum int,fibonum int)
as
begin
;with fibonacciseries as (
select 1 as rownum, cast(0 as float) as start, cast(1 as float) as [next]
union all
select rownum+1, [next], start+[next]
from fibonacciseries
where rownum<=@number)
Insert into @returntable(rownum,fibonum)
select rownum,convert(numeric(38,0),cast(start AS float))
from fibonacciseries
return
end
go
select * from dbo.fn_generate_fibonacciseries(10)

Python’s object-oriented Constructs

Contains: – Functions, Functions, Modules, List, Tuple and Packages.

Uncomplicated and Flexible datatypes

Which consist of Numbers, List, Tuple, Strings, Set, Dictionary, Conversion between data types

Cross Platform portability

Being High level languages, it can be run on multiple platforms and architecture unlike low level assembly languages. Hence High-level language are more portable. Python program written on a Macintosh computer will run on a Linux system and vice versa. Python programs can run on a Windows computer, if the Windows machine has the Python interpreter installed.

Extensiblility

Extensible with most of the programming languages. This means that it does let you interface Python with libraries written in other languages.

Large Eco-System and diverse community.

Python offers ease of learning, large ecosystem (web development / automation etc.), an awesome community and of course multiple computing libraries.

Python comes in different flavors

Flavors of Python means different frameworks that are meant to be used with specific technology or language.

Some of the flavours are Jython, Cpython, Iron Python Another implementation of python for .net framework, Pypy, for big data, we use Anaconda Python.

GUI Programming

You can use it to develop a GUI (Graphical User Interface). One way to do this is through Tkinter.

Python Web framework

Such as Django, Web2py, Flask etc are collection of packages or modules that allow developers to write Web applications or services.

Python libraries

Such as Matplotlib, Pandas, Numpy, SQLAlchemy, PyGame, PyTest, PyDoop is a reusable chunk of code that you may want to include in your programs/ projects.

How to Install Python on Windows.

Fig 2.0 Visual Studio Installer
Fig 3.0 Include Workloads
Fig 4.0 Anaconda and Python is installed

If you face any problem installing Anaconda please download from here https://docs.conda.io/en/latest/miniconda.html/
https://www.anaconda.com/distribution/

Fig 5.0 Installation Verification

My First Python Application

Fig 6.0 New Python Project
Fig 7.0 Hello knowledge-junction

Matplotlib

Fig 7.0 Matplotlib

Pyodbc

Fig 8.0 Install Pyodbc

Incase you face error during installation.

Fig 9.0 Anaconda Prompt
Fig 10.0 pip install pyodbc
Fig 11.0 Database Select

Happy Coding.
Thanks for reading
Keep reading , share your thoughts, experiences. Feel free to contact us to discuss more. If you have any suggestion / feedback / doubt, you are most welcome.
Stay tuned on Knowledge-Junction, will come up with more such articles / newsMatPlotLib

Advertisements

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.