Re: C API: getting sys.argv

2006-05-16 Thread Georg Brandl
[EMAIL PROTECTED] wrote: > John Machin wrote: >> > PyObject *_argv = PyImport_ImportModule("sys.argv"); >> >> What does the name of the function tell you? You can't do that in one >> hit. Start with >> PyObject *_sys = PyImport_ImportModule("sys"); >> then you need to get the module's argv attribut

Re: C API: getting sys.argv

2006-05-15 Thread [EMAIL PROTECTED]
John Machin wrote: > > PyObject *_argv = PyImport_ImportModule("sys.argv"); > > What does the name of the function tell you? You can't do that in one > hit. Start with > PyObject *_sys = PyImport_ImportModule("sys"); > then you need to get the module's argv attribute. I just figured this out, doh

Re: C API: getting sys.argv

2006-05-15 Thread John Machin
> PyObject *_argv = PyImport_ImportModule("sys.argv"); What does the name of the function tell you? You can't do that in one hit. Start with PyObject *_sys = PyImport_ImportModule("sys"); then you need to get the module's argv attribute. However a better design might be have your extension module