Python Tutorial

How To Run Python Script .py File In Jupyter Notebook .ipynb File And IPython

In this article, I will tell you how to invoke a python script file (.py) from the Jupyter notebook file (.ipynb) and ipython console. But first, you should create a python virtual environment in Anaconda and start Jupyter notebook server, you can read the article How To Start Jupyter Notebook In Anaconda Python Virtual Environment […]

How To Run Python Script .py File In Jupyter Notebook .ipynb File And IPython Read More »

How To List All Python Module Functions And Attributes By Module Name

After you import a python module object by name in python source code dynamically ( How To Load / Import Python Package, Module Dynamically ), you must want to get all the module object attributes or functions. Then you can invoke the related module function or attributes in source code. This article will show you

How To List All Python Module Functions And Attributes By Module Name Read More »

How To Use __import__() Function to Load / Import Python Package, Module Dynamically

Python, known for its dynamic nature, provides various mechanisms to dynamically load modules during runtime. One such method is the __import__() function. This powerful function enables developers to import modules dynamically, allowing for flexible and adaptable code structures. This article will show you how to use the __import__() function with examples.

How To Use __import__() Function to Load / Import Python Package, Module Dynamically Read More »

What Is Decorator In Python With Example

Decorators can add new functions or restrictions to the decorated objects without modifying the original source code. There are many kinds of decorators, including function decorators and class decorators. The name of decorator is different in many programming languages. It embodies the decoration pattern in the design pattern and emphasizes the open and closed principle.

What Is Decorator In Python With Example Read More »

How To Get / Set Http Headers, Cookies And Manage Sessions Use Python Requests Module

In the previous article How To Use Python Requests Module To Send Get Or Post Request Example, we have learned how to install and use the python requests module to send HTTP Get and Post request to a web server. It also tells you how to post form data or pass query string parameters use

How To Get / Set Http Headers, Cookies And Manage Sessions Use Python Requests Module Read More »

How To Fix Python Error Certificate Verify Failed: Unable To Get Local Issuer Certificate In Mac OS

When I run Python code in Mac OS, I meet a certificate verify failed error like this ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056). This error confused me a lot of time. And after googling the error, I finally found the solution to fix it, below are the steps.

How To Fix Python Error Certificate Verify Failed: Unable To Get Local Issuer Certificate In Mac OS Read More »

How To Use Python Requests Module To Send Get Or Post Request Example

Python requests module provide functions to write web request process code easy and simple. It can send both http get and post request to web server. When you send get request to web server, you can use python request module to pass parameters. When you send post request to web server, you can use python

How To Use Python Requests Module To Send Get Or Post Request Example Read More »