TAILIEUCHUNG - Graphical user interfaces for Python programs Phần 6

Mặc dù các loại của các đối số được kiểm tra với các chuỗi định dạng, địa chỉ cung cấp không được kiểm tra. Do đó, lỗi ở đây có thể có một ảnh hưởng tai hại trên ứng dụng của bạn. | Because of the great variability of each architecture s C compilers I am not going to try to provide a cookbook to solve the various problems. However I am going to present some code fragments that have worked for Solaris. To get a module to compile with C you need to define the Python API as a C segment to the C compiler extern C include Then the init function must be given the same treatment extern C DL_EXPORT void initstatistics Py_InitModule statistics statistics_methods Format strings Format strings provide a mechanism to specify the conversion of Python types passed as arguments to the extension routines. The items in the string must match in number and type the addresses supplied in the PyArg_ParseTuple call. Although the type of the arguments is checked with the format string the supplied addresses are not checked. Consequently errors here can have a disastrous effect on your application. Since Python supports long integers of arbitrary length it is possible that the values cannot be stored in C long integers in all cases where the receiving field is too small to store the value the most significant bits are silently truncated. The characters and have special meaning in format strings. This indicates that the remaining arguments in the Python argument list are optional. The C variables corresponding to optional arguments must be initialized to their default value since PyArg_ParseTuple leaves the variables corresponding to absent arguments unchanged. The list of format units ends here the string after the colon is used as the function name in error messages. The list of format units ends here the string after the colon is used as the error message instead of the default error message. FORMAT STRINGS .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.