I'm using the Geany IDE and I've wrote a python code that makes a GUI. Im new to python and i'm better with C. I've done research on the web and its too complicated because theres so much jargon involved. Behind each button I want C to be the backbone of it (So c to execute when clicked). So, how can i make a c file and link it to my code?
I too had a question like this and I found a website that described how to do it step by step but I can’t seem to find it. If you think about it, all these ‘import’ files are just code thats been made separately and thats why you import them. So, in order to import your ‘C File’ do the following.

Create the file you want to put in c (e.g bloop.c)
Then open the terminal and assuming you saved your file to the desktop, type ‘cd Desktop’. If you put it somewhere else other than the desktop, then type cd (insert the directory).
Now, type in gcc -shared -Wl,-soname,adder -o adder.so -fPIC bloop.c into the terminal.
After that, go into you python code and right at the very top of your code, type ‘import ctypes’ or ‘from ctypes import *’ to import the ctypes library.
Below that type adder = CDLL(‘./adder.so’).
if you want to add a instance for the class you need to type (letter or word)=adder.main(). For example, ctest = adder.main()
Now lets say you have a method you want to use from your c program you can type your charater or word (dot) method you created in c. For example ‘ctest.beans()’ (assuming you have a method in your code called beans).
How to have cfiles in python code