Skip to content

Commit 5b43ad8

Browse files
authored
Add Hello World in Cython (#5138)
1 parent 81ff96d commit 5b43ad8

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

archive/c/cython/hello_world.pyx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from libc.stdio cimport printf
2+
3+
4+
cdef main():
5+
printf(b"%s\n", b"Hello, World!")
6+
7+
8+
if __name__ == "__main__":
9+
main()

archive/c/cython/testinfo.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
folder:
2+
extension: ".pyx"
3+
naming: "underscore"
4+
5+
container:
6+
image: "rzuckerm/cython"
7+
tag: "3.1.6-1"
8+
build: |
9+
sh -c "cython -3 --embed {{ source.name }}{{ source.extension }} -o {{ source.name }}.c && \
10+
gcc -o {{ source.name }} $(python3-config --cflags) {{ source.name }}.c $(python3-config --ldflags) -lpython3.12 -fPIC"
11+
cmd: "./{{ source.name }}"

0 commit comments

Comments
 (0)