Tag: python

Python – Exceptions and Error Handlings

If you write a complex python code , it is very important to handle errors and exceptions. While handling files, connecting to database systems and so on , you can be the best programmer in the world and still get errors that is not up to you. When you write a code for infrastructure, you […]

Read more

Python – Writing Functions – Complete Guide

Writing Python code is fun and easy. You can use Procedural programming, Functional programming , Object oriented programming or any combination.  Functions are basic unit in any method you choose. Functions are objects, defined with the ‘def’ statement followed by argument list. The function body is defined using indentation like other python statements

Arguments […]

Read more

Python – Understanding Generators

Many functions in Python use or generate in-memory lists for iteration.  This is fine for relatively small list, but for large lists it becomes a problem. Lazy Lists A lazy list is when the next item is supplied when needed, and not before.  If we stop processing before reaching the end of the list then those […]

Read more

Python – Basics of Cryptography and API

Python is a great programming language for data analysis, web development, networking and more. While working with data , storing in files, sending to a remote machine and so on, we sometimes need to encrypt the data to prevent unauthorised access. With python cryptographic packages we can encrypt and decrypt data using various methods , […]

Read more

Deploying a New Python Package to Pypi

Python is a great programming language. The main reason python is so popular is the growing number of packages available to anyone. You can find those packages in many websites and in package managers. The official package manager for python is pypi , there are 2 versions – one for testing and one for production Lets […]

Read more

Interesting Python Standard Library Modules

Python developers use pypi to find packages. You need to search, filter some packages, read reviews from other developers, read the documentation and explore examples if exists. Anyone can build and deploy a package to pypi so you really don’t know if the package you found is working ok. Python standard library is full of […]

Read more

8 Python Modules For Files Handling

Python has input/output features which are very easy to use. Files are accessed through file objects and you can open, read, write and close files using a very simple and easy to use functions from the standard library. To manage files and deal with special file formats (xml, json..) python provides special packages that make the […]

Read more

Python – Regular Expressions Practical Guide

Regular Expressions are commonly used in Linux command line tools like sed, awk, grep etc. Most programming languages support them in either built – in or through an external library. The main problem of using them is that they difficult to understand, but they are well worth the effort to learn. Using a regular expression […]

Read more

Python Multitasking – MultiThreading and MultiProcessing

Modern operating systems allow a user to run several applications simultaneously, so that some tasks can be run in the background while the user continues with other work in the foreground. The user can also run multiple copies of the same program at the same time. To create a task we can use process or […]

Read more

Python Machine Learning Example – Linear Regression

In my previous post, I went over the basic concepts in machine learning and I used a very small amount of data. I got great feedbacks but also notes to make more complex example with bigger dataset. In this post I will use a bigger dataset and use pandas , seaborn and scikit-learn to illustrate […]

Read more