- Learning Cython Programming(Second Edition)
- Philip Herron
- 286字
- 2021-07-16 09:45:25
Chapter 1. Cython Won't Bite
Cython is much more than a programming language. Its origin can be traced to SAGE, the mathematics software package, where it is used to increase the performance of mathematical computations such as those involving matrices. More generally, I tend to consider Cython as an alternative to SWIG to generate really good Python bindings to native code.
Language bindings have been around for years, and SWIG was one of the first and best tools to generate bindings for multitudes of languages. Cython generates bindings for Python code only, and this single purpose approach means it generates the best Python bindings you can get outside of doing it all manually, which should be attempted only if you're a Python core developer.
For me, taking control of legacy software by generating language bindings is a great way to reuse any software package. Consider a legacy application written in C/C++. Adding advanced modern features such as a web server for a dashboard or message bus is not a trivial thing to do. More importantly, Python comes with thousands of packages that have been developed, tested, and used by people for a long time that can do exactly that. Wouldn't it be great to take advantage of all of this code? With Cython, we can do exactly this, and I will demonstrate approaches with plenty of example codes along the way.
This first chapter will be dedicated to the core concepts on using Cython, including compilation, and should provide a solid reference and introduction for all the Cython core concepts.
In this first chapter, we will cover:
- Installing Cython
- Getting started - Hello World
- Using distutils with Cython
- Calling C functions from Python
- Type conversion
- Google Apps Script for Beginners
- SoapUI Cookbook
- 潮流:UI設計必修課
- Mastering OpenCV Android Application Programming
- Mastering phpMyAdmin 3.4 for Effective MySQL Management
- PostgreSQL技術內幕:事務處理深度探索
- Apache Karaf Cookbook
- Getting Started with Python Data Analysis
- HTML5入門經典
- 名師講壇:Spring實戰開發(Redis+SpringDataJPA+SpringMVC+SpringSecurity)
- Java系統化項目開發教程
- Visual FoxPro程序設計習題集及實驗指導(第四版)
- 用案例學Java Web整合開發
- Mastering C++ Multithreading
- C專家編程