How To Define And Execute Customized Function In Python

Functions are well organized, reusable pieces of code that implement a single function. Function can improve the modularity of application and reuse of code. You already know that python provides many built-in functions, such as print(). But you can also create your own functions, which are called user-defined functions.

How To Use Python Sys Module Examples

Python sys module is a standard built-in module which contains variables and methods related to Python interpreter. This article will introduce the sys module contained variables and methods to you with examples about how to use them. Before use them, you should first import sys module with command import sys.

How To Use Python OS Module Walk Method Example

The os.walk(top, topdown=True, onerror=None, followlinks=False) method is a very important and powerful method in python standard os module. It can help us to traverse the directory tree in a top-down or bottom-up recursive manner very conveniently and return a tuple (dir-path, dir-names, file-names) for each directory. Below is the returned tuple’s elements description. dir-path : …

How To Use Python OS Module Walk Method Example Read More »

How To Run Shell Command And Get Output In Python

In early python version, the os modules’s system or popen function is usually used to execute operating system commands. However, recently python gradually abandon these functions officially. It recommend to use the built-in subprocess module to execute operating system-related commands. This article will tell you how to use subprocess module and os module’s system, popen …

How To Run Shell Command And Get Output In Python Read More »

How To Use Jupyter Notebook Tutorial

Jupyter notebook is a web application program. It can be used to easily create and share program documents. It supports real-time code, mathematical equations, visualization and markdown. It’s purpose includes data cleaning and conversion, numerical simulation, statistical modeling, machine learning, etc. This article will tell you how to install and run it.