code-generation

zip(list1, list2) in Jinja2?

zip(list1, list2) in Jinja2? Question: I’m doing code generation in Jinja2 and I frequently want to iterate through two lists together (i.e. variables names and types), is there a simple way to do this or do I need to just pass a pre-zipped list? I was unable to find such a function in the docs …

Total answers: 4

Convert Python program to C/C++ code?

Convert Python program to C/C++ code? Question: is it possible to convert a Python program to C/C++? I need to implement a couple of algorithms, and I’m not sure if the performance gap is big enough to justify all the pain I’d go through when doing it in C/C++ (which I’m not good at). I …

Total answers: 8

Best Python templating library to facilitate code generation

Best Python templating library to facilitate code generation Question: Instead of me spending the next day (or year) reading about them all, are there any suggestions for templating engines that I should look into in more detail? Asked By: taudep || Source Answers: Best suggestion: try them all. It won’t take long. My favourite: Jinja2 …

Total answers: 7