Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> Python

Các đuôi file Python .pyc .pyd .pyo nghĩa là gì?


Các file .py, .pyc, .pyo, .pyd có ý nghĩa riêng khi thực thi chương trình Python. Chúng dùng cho:

  • .py: Mã nguồn input bạn viết.

  • .pyc: Bytecode đã biên dịch. Khi import module, Python tạo file *.pyc chứa bytecode để import lần sau nhanh hơn.

  • .pyo: File *.pyc tạo khi tối ưu hóa (-O) bật.

  • .pyd: File DLL Windows cho Python. https://docs.python.org/faq/windows.html#is-a-pyd-file-the-same-as-a-dll