-3

I am trying to access a module I have written in Python from C? Is this at all possible?

I have tried:

Module = PyImport_ImportModule("<modulename>");

But it doesn't seem to work

1
  • 1
    Hi Chris, and welcome to Stack Overflow. Could you add more information to you question, such as are you using a library? What are you trying to import? What are you expecting to happen? When you say "it doesn't seem to work", in what sense does it not work? With the current information, there's not nearly enough to provide a reasonable answer. If you can edit in more information, people might have more of a chance of getting you the answers you need. Commented May 18, 2020 at 0:48

1 Answer 1

1

please try to add more information of what are you trying to do. Anyway, I know it is possible. It isn't easy though.. Have you tried looking for any tutorials? I think this was already asked:

Call a Python function from within a C program

https://www.codeproject.com/Articles/11805/Embedding-Python-in-C-C-Part-I

https://www.linuxjournal.com/article/8497

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.