Using C++ in Cython: simple tutorial

version: 3.0.0a10

Overview

  • Specify C++ language in a setup.py script or locally in a source file.
  • Create one or more .pxd files
  • cimport them in one or more extension modules (.pyx files).

Tutorial

Preview

  1. Write C++ API (.cpp/.h files)
  2. Declaring a C++ class interface (A.pxd file)
  3. Declare class with cdef cppclass (A.pxd file)
  4. Declare a var with the wrapped C++ class (B.pxd file)
  5. Create Cython wrapper class (B.pxd file): ** to make this accessible from external Python code **
  6. Compilation and Importing (setup.py)

Practice

example codes

ref.

http://docs.cython.org/en/latest/

2022

Stack

1 minute read

Introduction

Stack

less than 1 minute read

Introduction

Download-only-one-directory

less than 1 minute read

Git 명령어를 사용한 하위 디렉토리 다운로드 Clone 할 로컬 저장소 생성

Sort

3 minute read

Introduction

Tree

less than 1 minute read

Introduction

Mutex library on C++

less than 1 minute read

#include <iostream> #include <thread> #include <chrono> #include <mutex> #include <atomic> #include <string.h>

TODO

less than 1 minute read

how to costom github blog using jekyll

Welcome to Jekyll!

less than 1 minute read

You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different wa...

Back to top ↑