This is a simple Python extension module that provides a greet
function for personalized greetings.
You can use this module to print customized greetings in Python.
The purpose of this project is to demonstrate how to create a simple Python extension module using C and build it for Python integration. In this project, we have a C extension module named hello
that provides a greet
function for personalized greetings in Python. Additionally, we'll provide instructions on how to execute the script main.py
from the command line, passing a name as a command-line argument.
The provided C code in "hello.c" is an extension module for Python. This code allows you to define a new Python module named hello, which contains a function called greet. The greet function can be called from Python, accepts one argument (a name), and prints a personalized greeting.
Before using this module, ensure you have the following installed on your system:
- Python 3.x
- python3-dev
- GCC (GNU Compiler Collection)
-
Clone the repository to your local machine:
git clone [email protected]:esloch/poc-hello-c-py.git
cd hello-c-py
python3 setup.py build
python3 setup.py install
python3 main.py <name>
Replace with the name you want to greet.