Python global variable is defined outside a function. It will work on the whole function if there is no the same named variable. In this tutorial, we will introduce how to use python global variable correctly.
Formatting a python string is basic operation in python, especailly when you want to print a string, we have two ways to format a string. In this tutorial, we will introduce this two methods to format a string.
Python None is a special constant, which represents a null or absent value. In this tutorial, we will introduce some basic knowledge about on using it.
In python, converting a html file to pdf is very simple. We can use pdfkit library to do it. In this tutorial, we will write an example to show you how to convert.
When you start to use python pdfkit library to convert a html to pdf, you may find OSError: No wkhtmltopdf executable found. In this tutorial, we will introduce you how to fix this error.
When we use python OpenDirector object to open a url, it will not ignore 301 or 302 redirection defautly. In this tutorial, we will introduce how to ignore these redirection with steps. You can learn and do by following our steps.
To crawl web page content correctly, you must be sure the content charset type of content string. However, there are some types of charsets, such as utf-8, gbk, gb2312 et al. In this tutorial, we will introduce a way to detect the charset type of content string using python.
To save python string to a file in python safely, there are somthing you should notice:1.The encoding of this string. 2.Be sure the string has been savedIn this tutorial, we will introduce and write an example to show how to save python string to a file safely, you can use our this example in your applications safely.
If you plan to save some python string into a file and encounter this UnicodeEncodeError: ‘gbk’ codec can’t encode character, this tutorial will help you. In this tutorial, we will introduce how to fix this error, you can do that by following our steps.
One of important functionality is to estimate reading time by word amounts in wordpress, in this tutorial, we will introduce how to estimate it. You can learn and do step by step.