Re: python commmand line params from c++
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: python commmand line params from c++

From: <ej>
Date: Thu Jun 30 2005 - 21:49:30 CEST

Ummm, just a guess from looking at the output (not familiar with C++
interface)...
the error seems to complain about what's in someScript.py, not the call to
it.
What's in someScript.py?

"Wesley Henwood" <wesleyhenwood@hotmail.com> wrote in message
news:1120143124.925422.290980@g44g2000cwa.googlegroups.com...
> What is the proper way to pass command line parameters to a python
> script called from C++? I'm tryng this:
>
> path = "c:\\someDir\\someScript.py param1 param2 param3";
> PyRun_SimpleFile(PyFile_AsFile( PyFile_FromString( path, "r")),
> "someScript.py");
>
> I'm getting a "format error someScript.py, line 1" when the code is
> executed.
>
> Note: The strange appearannce of the 3 python function calls nested is
> not a bug, but required to prevent a run-time error.
>
Received on Thu Sep 29 16:40:27 2005