Why does PyRun_SimpleFile need a char*, not a const char*?

Gernot Hillier ghillie at suse.de
Mon Dec 2 02:53:49 EST 2002


Hi!

As I'm using embedded python in C++, I would really like to use

string a="bla.py"
script_f=fopen(a.c_str(),"r")
PyRun_SimpleFile(script_f, a.c_str());

But this only gives me "invalid conversion from `const char*' to `char*'" in 
PyRun_SimpleFile(). :-(

So - why does PyRun_SimpleFile() expect to get a "char*" and not a "const 
char*"?

Does it change this pointer? I hope not...

I think this qualifies as bug - what do you think?

-- 
Ciao,

Gernot



More information about the Python-list mailing list