Learning Cython Programming

0
(0)

Learning Cython Programming
 

  • Author:Philip Herron
  • Length: 110 pages
  • Edition: 1
  • Publisher: Packt Publishing
  • Publication Date: 2013-09-25
  • ISBN-10: 1783280794
  • ISBN-13: 9781783280797
  • Sales Rank: #5455873 (See Top 100 Books)
  • Download:Register/Login to Download
  • Buy Print:Buy from amazon


    Book Description

    Expand your existing legacy applications in C using Python

    Overview

    • Extend C applications with pure Python code
    • Expand low-level C open source projects with pure Python – Tmux
    • Get the most out of highly computational Python code using Cython
    • Integrate your C applications with Python Distutils and Automake/Autoconf

    In Detail

    Cython is a very powerful combination of Python and C. Using Cython, you can write Python code that calls back and forth from and to C or C++ code natively at any point. It is a language with extra syntax allowing for optional static type declarations. It is also a very popular language as it can be used for multicore programming.

    Learning Cython Programming will provide you with a detailed guide to extending your native applications in pure Python; imagine embedding a twisted web server into your native application with pure Python code. You will also learn how to get your new applications up and running by reusing Python’s extensive libraries such as Logging and Config Parser to name a few.

    With Learning Cython Programming, you will learn that writing your own Python module in C from scratch is not only hard, but is also unsafe. Cython will automatically handle all type-conversion issues as well as garbage collection on your code. You can also still write all your code in Python but have it compiled and called directly in C as if it was just another function or data.

    This book also demonstrates how you can take the open source project Tmux and extend it to add new commands directly in pure Python. With this book, you will learn everything you need to know to get up and running with Cython and how you can reuse examples in a practical way.

    What you will learn from this book

    • Reuse Python logging in C
    • Make an IRC bot out of your C application
    • Extend an application to have a web server for rest calls
    • Use Cython against your C++ code
    • Reuse Python ConfigParser in C
    • Create Python bindings to native libraries
    • Learn about threading and concurrency related to the GIL
    • Expand Terminal Multiplexer Tmux with Cython

    Approach

    A practical and a fast-paced guide that gives you all the information you need to start programming using Cython.

    Who this book is written for

    This book is for developers who love C/C++ for low latency and speed but who also require the ability to add more dynamic features to applications both fast and reliably. It will also show you how you can get new applications off the ground by reusing Python libraries to get started.

    Table of Contents

    Chapter 1: Cython Won’t Bite
    Chapter 2: Understanding Cython
    Chapter 3: Extending Applications
    Chapter 4: Debugging Cython
    Chapter 5: Advanced Cython
    Chapter 6: Further Reading

    中文:

    书名:Learning Cython Programming

    使用Python在C中扩展现有的遗留应用程序

    Overview

    • 使用纯Python代码扩展C应用程序
    • 使用纯Python-Tmux扩展低级C开源项目
    • 使用Cython最大限度地利用高计算量的Python代码
    • 将您的C应用程序与Python Distutils和Automake/Autoconf集成

    In Detail

    Cython是Python和C的一个非常强大的组合。使用Cython,您可以编写在任何时刻在本地来回调用C或C++代码的Python代码。它是一种具有额外语法的语言,允许可选的静态类型声明。它也是一种非常流行的语言,因为它可以用于多核编程。

    学习Cython编程将为您提供使用纯Python扩展本机应用程序的详细指南;想象一下,使用纯Python代码将扭曲的Web服务器嵌入到本机应用程序中。您还将学习如何通过重用Python的扩展库(如Logging和Config Parser等)来启动和运行新的应用程序。

    通过学习Cython编程,您将了解到,从头开始用C编写您自己的Python模块不仅很难,而且也不安全。Cython将自动处理所有类型转换问题以及代码上的垃圾回收。您也可以仍然用Python编写所有代码,但让它直接用C编译和调用,就像它只是另一个函数或数据一样。

    本书还演示了如何使用开源项目Tmux并对其进行扩展,以直接在纯Python中添加新命令。通过这本书,您将学习开始并运行Cython所需了解的所有知识,以及如何以实用的方式重用示例。

    What you will learn from this book

    • 在C++中重用Python日志记录
    • Make an IRC bot out of your C application
    • 扩展应用程序,使其具有用于REST调用的Web服务器
    • Use Cython against your C++ code
    • Reuse Python ConfigParser in C
    • 创建到本机库的Python绑定
    • 了解与GIL相关的线程和并发
    • 用Cython扩展终端多路复用器Tmux

    Approach

    这是一本实用而快速的指南,它为您提供了开始使用Cython编程所需的所有信息。

    Who this book is written for

    本书面向热爱低延迟和低速度的C/C++的开发人员,但他们也需要快速可靠地向应用程序添加更多动态特性的能力。它还将向您展示如何通过重用Python库来启动新的应用程序。

    目录表

    Chapter 1: Cython Won’t Bite
    Chapter 2: Understanding Cython
    Chapter 3: Extending Applications
    第4章:调试Cython
    第5章:高级Cython
    第6章:进一步阅读

  • 下载电子版:下载地址
  • 购买纸质版:亚马逊商城

    点击星号评分!

    平均分 0 / 5. 投票数: 0

    还没有投票!请为他投一票。

  • 推荐阅读

    评论 抢沙发

    评论前必须登录!

     

    登录

    找回密码

    注册