In this tutorial, we will introduce how to get disk or directory total space, used space and free space using python, which is very helpful if you want to save some files on you computer.
When we are copying, moving or saving files with python, one problem we must concern is: Does the file directory exist? In this tutorial, we will introduce you how to create directories recursively with python.
When you are using python str() function, you may find TypeError: ‘str’ object is not callable error. In this tutorial, we will introduce you how to fix this error.
In php, we can use urlencode() and urldecode() function to encode or decode a url or string. However, how about encoding and decoding url or string in python. In this tutorial, we will introduce you how to encode and decode a url or string in python.
When we are downloading files to local disk using python, we should detect the free space of disk. If there is no enough space, you should stop downloading. In this tutorial, we will write an function to calculate disk free space by python.
When we use python urllib.request.urlretrieve() to download files, there may be a very big problem: urllib.request.urlretrieve() can be blocked for a long time and does not return any response. In this tutorial, we will introduce you how to fix this problem.
We can use python signal to limit the maximum runtime of python function. However, you may find this singal error:AttributeError: module ‘signal’ has no attribute ‘SIGALRM’. In this tutorial, we will introduce you how to fix this error.
In most python application, if you plan to download some files, urllib.request.urlretrieve() will be your choice. The simplest reason is there is a callback function in it, we can show downloading progress bar in that callback function.
Python string alignment contains: left align, right align and center align, which are very useful when printing string. In this tutorial, we will introduce you how to align a python string.
Python regression expression re.escape(pattern) function can escape special characters in pattern, in this tutorial, we will introduce how to use this function correctly for python beginners.