Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Embedding Python code in a C++ program

Правка en1, от slycelote, 2016-04-01 06:35:11

I'm sure most of you know that all mainstream C++ compilers support inline assembly language. But did you know that you can actually embed Python in a similar way?

Here, for instance, I implemented gcd function in Python simply because it's easier and shorter. The rest of the code is in C++: 17084249. (By the way, kudos to Codeforces for correct highlighting of both Python and C++ parts!)

I'm not sure if it can be useful at all, but I thought that it's fun to share. Keep in mind it doesn't work in all compilers though!

Теги python, c++

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский slycelote 2016-04-01 06:35:11 581 Initial revision (published)