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 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 Fix Unresolved Import Issues In Eclipse PyDev Project

When I use eclipse to open an existing PyDev project, I find an error message like Unresolved import: smtplib. This error means the python3 built-in library smtplib can not be found and imported in python source code now. This error is because the python interpreter is not configured correctly, now I will tell you how

How To Fix Unresolved Import Issues In Eclipse PyDev Project 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 »

How To Fix Could Not Install Packages Due To An Environmenterror: [winerror 5] Access Is Denied Error When Install Python Module In Windows

When I use the pip command to install a python module ( pip install requests )  or upgrade pip ( python -m pip install –upgrade pip ) in windows, I meet the below error message. Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: ‘C:\\Program Files (x86)\\Python37-32\\Lib\\site-packages\\pip\\__init__.py’ Consider using the `–user`

How To Fix Could Not Install Packages Due To An Environmenterror: [winerror 5] Access Is Denied Error When Install Python Module In Windows Read More »