i dont even know what PhantomJS is but if it's an executable this may help.
I pipe to ffmpeg from wxPython app by using subprocess.Popen and set shell and creationflags option. Then I see no console for ffmpeg.
import subprocess
from win32process import CREATE_NO_WINDOW
p = subprocess.Popen(
cmdstring,
stdin=subprocess.PIPE,
bufsize=-1,
shell=False,
creationflags = CREATE_NO_WINDOW
)
(edit)
Like you wrote, there are two issues here. One is about UAC which is probably difficult to get around completely as explained here https://stackoverflow.com/a/131092/566035. But because you are anyway packaging with py2exe, you could try this py2exe packaging option: https://stackoverflow.com/a/1445547/566035.
windows = [{
'script': "yourapp.py",
'uac_info': "requireAdministrator",
},]
This line goes to the setup.py file of py2exe to package your application.
With this approach, the user will be asked for UAC permission only once when starting your wxpython app. And UAC will say that your application is requesting the permission (not PhantomJS).
Another is the console window which can be suppressed by CREATE_NO_WINDOW as I described above. To be more complete, I added an example that I took from http://phantomjs.org/quick-start.html
phantomjs loadspeed.js http://www.google.com
To do this command from wxpython app, one can for example write a method of wx.Frame like:
def OnButton(self, event):
cmdstring = ('phantomjs.exe', 'loadspeed.js', 'http://www.google.com')
p = subprocess.Popen(
cmdstring,
stdout=subprocess.PIPE,
shell=False,
creationflags = CREATE_NO_WINDOW
)
print p.stdout.read() # to get the output from phantomjs.exe
phantomjs.exe and loadspeed.js need to be in the system path or in the same folder.
I did a test on my PC and it printed this as output.
Loading time 719 msec