This time to bring you a Python variable assignment of the step-by-bit details, the Python variable assignment of attention to what, the following is the actual case, together to see.
>>> x = 12>>> y= 13>>> ID (x) >>> ID (y) >>> x = y>>> ID (x) >>> ID (y)
The first assignment of the x variable to the 12,y variable is 13, and we use the ID (variable) to see where x and Y are in memory, respectively. The above shows 1865402384 and 1865402416 respectively. Then we make x = y, and then we look at where they are in memory and find that both X and Y point to 1865402416. Thus, in Python, the way we assign values differs from the C language, and C directly changes the value in X's memory, and Python directly changes the direction of X, which reminds me of pointers.
Let's try it and continue to enter the following code here
>>> y = 12>>> id (y) 1865402384
Believe that you have read the case of this article you have mastered the method, more exciting please pay attention to the PHP Chinese network other related articles!
Recommended reading:
The Python interface uses the OpenCV method
Python configuration and the use of OPENCV