Home Help Center

pythonw, loadSlice and popup windows

Edward BishopEdward Bishop Member EdwardOrganization: SonyProject: Automated Test ✭✭
I have been trying to make my python applications more Windows friendly, in particular I am trying to eliminate annoying cmd windows. Creating wrappers with the .pyw extension allows me to create desktop shortcuts that, when clicked, start the application without an associated cmd shell window. However, when I do that I find that I get a flurry of cmd shells while the application loads. I traced that flurry to the loadSlice() command. Here is some code to illustrate:
#foo.py
import time
import Ice

for i in range(5):
    Ice.loadSlice('foo.ice')
    time.sleep(1)
// foo.ice
module Foo 
{
    interface Bar
    {        
        void keepAlive();
    };
};

If you run it with pythonw foo.py on Windows XP, or equivalently if you rename foo.py to foo.pyw and click on it, you will see a brief cmd shell pop up every time loadSlice() is called. Can anyone suggest a workaround?

Thanks!

Comments

  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    I confirmed that this is occurring -- the issue is the launching of the C preprocessor when dynamically loading the slice files. The easiest workaround is to pre-translate the slice files with slice2py. This avoids the whole issue :)

    With the upcoming Ice 3.3 release this will no longer occur.
  • Edward BishopEdward Bishop Member EdwardOrganization: SonyProject: Automated Test ✭✭
    Hi Matthew,
    Thanks for your quick reply. It's not an urgent issue, so I'll just wait for 3.3.
    Regards,
Sign In or Register to comment.