Can my python script return a value to the c program executing it?

V

vduber6er

I have a C program that calls my python script by

exec_pycode(code);

code = "import CheckFasta\nCheckFasta.CheckFasta (\"sampledata.txt\",
%d)\n", PyNum);

CheckFasta.py is my python script with a def CheckFasta in it that
returns a string.

Is there a way for my C code to get the return value from CheckFasta?

Example:
If CheckFasta returns "hello world"

can I somehow do something like

returnstring = exec_pycode(code);

where returnstring will contain "hello world" after the line above?

Thanks
 
V

vduber6er

That link seemed to do the trick with a little bit of edits. Thanks a
lot Philippe!

Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top