- Print debug messages
2017年2月28日 星期二
Python notebook
Debug tips:
2015年7月23日 星期四
Python 的 .py 和 .pyc 檔有什麼不同 ?
Source: http://www.arthurtoday.com/2010/02/python-py-pyc.html
Python 的程式是寫在 .py 裡,也就是說, .py 檔是 Python 的原始程式碼檔案,而 Python 會在執行 .py 檔時,將 .py 的程式碼編譯成中間程式碼檔 ( byte-compiled ) 的 .pyc 檔以加快下次執行的速度。
所以,當你執行一支 .py 檔時,Python 會先看看有沒有這支 .py 檔的 .pyc 檔,如果有,而且 .py 檔的修改時間和 .pyc 檔一樣時,Python 就會讀 .pyc 檔,否則,Python 就會去讀原來的 .py 檔。
不過,執行 .py 檔並不一定會產生出 .pyc 檔,通常是被 import 的 module 的 .py 檔才會產生出 .pyc 檔的
2015年4月22日 星期三
Integrate OpenCV and Python
Install WinPython-64bit-2.7.9.4 which includes:
Python 2.7.9 (OpenCV 2.4 supports Pythin 2.x while OpenCV 3.0 supports Python 3.x)
NumPy 1.9.2
SciPy 0.15.1
Copy\build\python\2.7\x64\cv2.pyd to \\Lib\site-packages
Verify (using IDEL)
import cv2
print (cv2.__version__)
Python 2.7.9 (OpenCV 2.4 supports Pythin 2.x while OpenCV 3.0 supports Python 3.x)
NumPy 1.9.2
SciPy 0.15.1
Copy
Verify (using IDEL)
import cv2
print (cv2.__version__)
訂閱:
文章 (Atom)