emdding python gui in c code - OS independent

tinauser tinauser at libero.it
Mon Oct 11 19:06:25 CEST 2010


On Oct 11, 6:49 pm, Chris Rebert <c... at rebertia.com> wrote:
> On Mon, Oct 11, 2010 at 6:16 AM, tinauser <tinau... at libero.it> wrote:
> > hi there,
> > i need to embed python GUI in a c++ code. I've seen that,while on
> > windows running GUI is no problem, in mac i need to use pythonw
> > instead python.
> > the question is,how should i tell the program that if the OS is mac,
> > it should pythonw, otherwise python is fine?
>
> I think you have it backwards. MS Windows is where one typically needs
> to use pythonw to suppress a console window from opening when Python
> is run. *nixes (including Mac OS X) have no such problem and (I'm
> pretty sure) only have a pythonw executable for compatibility
> purposes. Just specify pythonw regardless of OS and you should be
> fine.
>
> Cheers,
> Chris
> --http://blog.rebertia.com

thanks:
how do i specify pythonw programmatically?
i tried Py_SetProgramName("pythonw");

it doesn't raise errors, but does not solve the problem on mac, i.e. i
get the error:

This program needs access to the screen.
Please run with 'pythonw', not 'python', and only when you are logged
in on the main display of your Mac.



More information about the Python-list mailing list