1

I've cross-compiled python and embedded it in my iOS app. I'm able to execute python script as a string (PyRun_SimpleString) and import module and execute function with arguments (PyImport_Import and PyObject_CallObject) like in python embedding doc.

But how can i execute python script file with arguments in command-line way:

file.py arg1 arg2

?

3
  • 1
    Would using PySys_SetArgv work? Commented Oct 4, 2014 at 18:34
  • it seems to be the right direction! How to run script using filename? Should i load module using PyImport_Import and do anything else after it? Commented Oct 4, 2014 at 18:40
  • 2
    Doing some digging I think this accepted Answer on SO might provide you a good starting point. Commented Oct 4, 2014 at 18:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.