geekhack
geekhack Community => Off Topic => Topic started by: xtrafrood on Wed, 30 January 2019, 23:37:29
-
~30 lines of Python compiled into +3k lines of C.. So uh, any other GH users 'play' with Cython? Cython seems like an awesome box of the Pandora variety.
-
I've wanted to try writing some C extensions for Python but never had a use case really. What do you do?
-
I wonder, how does Cython work together with C extensions for Python? Would they have to be modified extensively?
-
IDK, I fed a small tkinter python script to Cython and it rendered a .c file for me to compile with gcc or mingw-w64.
Although my Cython usage is limited to this one instance, I can say my first binary output was a success.
When I execute the new tkinter script turned binary it renders a window with three buttons. From what I can tell there is no behavior difference. Which I think is interesting.
-
IDK, I fed a small tkinter python script to Cython and it rendered a .c file for me to compile with gcc or mingw-w64.
Although my Cython usage is limited to this one instance, I can say my first binary output was a success.
When I execute the new tkinter script turned binary it renders a window with three buttons. From what I can tell there is no behavior difference. Which I think is interesting.
Paste the C code somewhere!
-
IDK, I fed a small tkinter python script to Cython and it rendered a .c file for me to compile with gcc or mingw-w64.
Although my Cython usage is limited to this one instance, I can say my first binary output was a success.
When I execute the new tkinter script turned binary it renders a window with three buttons. From what I can tell there is no behavior difference. Which I think is interesting.
Paste the C code somewhere!
Okelydokely :). I included the original (bad) python script too.
exit_menu.py (http://pastebin.com/nV6XwWWz) ... exit_menu.c (http://pastebin.com/ewDHvdt1)
-
That is a big and scary C program :eek: I am thinking even a simple hello world would also be similar.
-
That is a big and scary C program :eek: I am thinking even a simple hello world would also be similar.
Although I'd imagine collaboration with such a C program would be.. uh.. less than stellar, IIRC GUI creation requires a few more lines than the average Hello World program.