Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > How to hide console with Popen on Windows?

Reply
Thread Tools

How to hide console with Popen on Windows?

 
 
xliiv
Guest
Posts: n/a
 
      05-18-2012
Like the topic, more details in followed links..


http://stackoverflow.com/questions/1...pen-on-windows

http://code.activestate.com/recipes/...indow/?c=14452

Please help
Any hint i would appreciate
 
Reply With Quote
 
 
 
 
Kevin Walzer
Guest
Posts: n/a
 
      05-18-2012
On 5/18/12 4:22 AM, xliiv wrote:
> Like the topic, more details in followed links..
>
>
> http://stackoverflow.com/questions/1...pen-on-windows
>
> http://code.activestate.com/recipes/...indow/?c=14452
>
> Please help
> Any hint i would appreciate


There are some Windows-specific flags in the subprocess module that you
can set to control the display of a console window. I use something like
this:

self.pscmd=os.path.join(execdir, 'pstools-1.1/txt2ps.exe')
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
txtps = self.pscmd + ' -o ' + tempfile.gettempdir() +
'\\whois.ps' + ' ' + tmpfile
subprocess.check_output(txtps, startupinfo = startupinfo)

Hope this helps.
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
 
Reply With Quote
 
 
 
 
alex23
Guest
Posts: n/a
 
      05-21-2012
On May 18, 6:22*pm, xliiv <tymoteusz.jankow...@gmail.com> wrote:
> Like the topic, more details in followed links..
> http://stackoverflow.com/questions/1...-console-with-...


Try replacing all of your code with something simple, a 'pass' op will
do. Run the script again. Does the console still open? Then it's not
subprocess that you're struggling with.

If I put your code into a .py file and execute it under Windows via a
double-click, I get a console: the one in which the .py file is
executing. Unless you're able to make the file a .pyw file - which you
are apparently not as you're using OpenOffice - then executing the
code that uses Popen is what is displaying a console, not the call to
Popen itself.
 
Reply With Quote
 
xliiv
Guest
Posts: n/a
 
      05-21-2012
On Monday, May 21, 2012 6:38:34 AM UTC+2, alex23 wrote:
> On May 18, 6:22*pm, xliiv <tymoteusz.jankow...@gmail.com> wrote:
> > Like the topic, more details in followed links..
> > http://stackoverflow.com/questions/1...-console-with-....

>
> Try replacing all of your code with something simple, a 'pass' op will
> do. Run the script again. Does the console still open? Then it's not
> subprocess that you're struggling with.
>
> If I put your code into a .py file and execute it under Windows via a
> double-click, I get a console: the one in which the .py file is
> executing. Unless you're able to make the file a .pyw file - which you
> are apparently not as you're using OpenOffice - then executing the
> code that uses Popen is what is displaying a console, not the call to
> Popen itself.


Ok, thanks for explanation.
Now I know that my 'solution' is not a solution and problem still bugs me.
Any ideas how to deal with it?

 
Reply With Quote
 
alex23
Guest
Posts: n/a
 
      05-22-2012
On May 22, 3:00*am, xliiv <tymoteusz.jankow...@gmail.com> wrote:
> Now I know that my 'solution' is not a solution and problem still bugs me..
> Any ideas how to deal with it?


I haven't tried it but this thread talks about being able to use a
standard install of Python with OpenOffice:

http://user.services.openoffice.org/...ic.php?t=26877

 
Reply With Quote
 
xliiv
Guest
Posts: n/a
 
      05-22-2012
On Tuesday, May 22, 2012 2:45:11 AM UTC+2, alex23 wrote:
> On May 22, 3:00*am, xliiv <tymoteusz.jankow...@gmail.com> wrote:
> > Now I know that my 'solution' is not a solution and problem still bugs me.
> > Any ideas how to deal with it?

>
> I haven't tried it but this thread talks about being able to use a
> standard install of Python with OpenOffice:
>
> http://user.services.openoffice.org/...ic.php?t=26877


On Tuesday, May 22, 2012 2:45:11 AM UTC+2, alex23 wrote:
> On May 22, 3:00*am, xliiv <tymoteusz.jankow...@gmail.com> wrote:
> > Now I know that my 'solution' is not a solution and problem still bugs me.
> > Any ideas how to deal with it?

>
> I haven't tried it but this thread talks about being able to use a
> standard install of Python with OpenOffice:
>
> http://user.services.openoffice.org/...ic.php?t=26877




On Tuesday, May 22, 2012 2:45:11 AM UTC+2, alex23 wrote:
> On May 22, 3:00*am, xliiv <tymoteusz.jankow...@gmail.com> wrote:
> > Now I know that my 'solution' is not a solution and problem still bugs me.
> > Any ideas how to deal with it?

>
> I haven't tried it but this thread talks about being able to use a
> standard install of Python with OpenOffice:
>
> http://user.services.openoffice.org/...ic.php?t=26877




On Tuesday, May 22, 2012 2:45:11 AM UTC+2, alex23 wrote:
> On May 22, 3:00*am, xliiv <tymoteusz.jankow...@gmail.com> wrote:
> > Now I know that my 'solution' is not a solution and problem still bugs me.
> > Any ideas how to deal with it?

>
> I haven't tried it but this thread talks about being able to use a
> standard install of Python with OpenOffice:
>
> http://user.services.openoffice.org/...ic.php?t=26877


Thx for the link
It's useful especially that:
http://user.services.openoffice.org/...p?f=45&t=26149
for my walkaround of the problem.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
IO.popen without console Felipe Navas Ruby 0 01-24-2007 11:51 AM
Hide Console Window xfadeuk@googlemail.com C++ 2 10-04-2006 01:04 AM
File.popen/IO.popen hariwise@gmail.com Ruby 1 05-20-2006 08:20 AM
[HIDE LAN] Hide a part of hosts into the LAN at VPN users? Paolo Bresi Cisco 1 04-04-2005 02:41 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57