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

?

4ntoine
  • 19,816
  • 21
  • 96
  • 220
  • 1
    Would using `PySys_SetArgv` work? – Michael Petch Oct 04 '14 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? – 4ntoine Oct 04 '14 at 18:40
  • 2
    Doing some digging I think this [accepted Answer on SO](http://stackoverflow.com/questions/12142174/run-a-python-script-with-arguments) might provide you a good starting point. – Michael Petch Oct 04 '14 at 18:56

0 Answers0