Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Hide DOS console for .pyc file (http://www.velocityreviews.com/forums/t733036-hide-dos-console-for-pyc-file.html)

Muddy Coder 09-11-2010 03:28 AM

Hide DOS console for .pyc file
 
Hi Folks,

For a quick testing purpose, I deliver .pyc files to my customer. I
don't want the black DOS console appearing behind my GUI, but I have
no idea how to do it. Somebody can help? Thanks!


Cosmo

Lawrence D'Oliveiro 09-11-2010 07:22 AM

Re: Hide DOS console for .pyc file
 
In message
<3a2d194c-9b34-4b84-8680-28bdfb53b975@y3g2000vbm.googlegroups.com>, Muddy
Coder wrote:

> For a quick testing purpose, I deliver .pyc files to my customer. I
> don't want the black DOS console appearing behind my GUI, but I have
> no idea how to do it. Somebody can help? Thanks!


Don’t run it on Windows.

Steven D'Aprano 09-11-2010 07:58 AM

Re: Hide DOS console for .pyc file
 
On Fri, 10 Sep 2010 20:28:52 -0700, Muddy Coder wrote:

> Hi Folks,
>
> For a quick testing purpose, I deliver .pyc files to my customer. I
> don't want the black DOS console appearing behind my GUI, but I have no
> idea how to do it. Somebody can help? Thanks!


Google is your friend.

Googling for "Python dos window" brings up this as the third hit:

http://www.velocityreviews.com/forum...run-python-in-
windows-w-o-popping-a-dos-box.html



--
Steven

Dave Angel 09-11-2010 09:37 AM

Re: Hide DOS console for .pyc file
 
On 2:59 PM, Muddy Coder wrote:
> Hi Folks,
>
> For a quick testing purpose, I deliver .pyc files to my customer. I
> don't want the black DOS console appearing behind my GUI, but I have
> no idea how to do it. Somebody can help? Thanks!
>
>
> Cosmo
>

In Windows, the executable file statically determines whether a console
is created. There are two executables shipped with Python, python.exe
and pythonw.exe. You want to use the latter.

The real question is how to cause Windows to run that rather than
python.exe. Answer depends on how your use is launching his program.

If he's starting from a shortcut, change the name of the executable on
the shortcut. If he's starting by double-clicking on the script name,
change the extension of the script from .py to .pyw

You mention that you're shipping only .pyc files. If that's the case,
add one more, a .pyw that imports your main script. Of course, that may
mean changing that script a little so it works as a module.

DaveA


Peter Otten 09-11-2010 09:44 AM

Re: Hide DOS console for .pyc file
 
Lawrence D'Oliveiro wrote:

> In message
> <3a2d194c-9b34-4b84-8680-28bdfb53b975@y3g2000vbm.googlegroups.com>, Muddy
> Coder wrote:
>
>> For a quick testing purpose, I deliver .pyc files to my customer. I
>> don't want the black DOS console appearing behind my GUI, but I have
>> no idea how to do it. Somebody can help? Thanks!

>
> Don’t run it on Windows.


If you switch the OS for every minor problem you'll run out of operating
systems pretty soon...


Terry Reedy 09-11-2010 05:19 PM

Re: Hide DOS console for .pyc file
 
On 9/11/2010 6:32 AM, Lawrence D'Oliveiro wrote:
> In message<i6fivp$76v$00$1@news.t-online.com>, Peter Otten wrote:
>
>> Lawrence D'Oliveiro wrote:
>>
>>> In message
>>> <3a2d194c-9b34-4b84-8680-28bdfb53b975@y3g2000vbm.googlegroups.com>, Muddy
>>> Coder wrote:
>>>
>>>> For a quick testing purpose, I deliver .pyc files to my customer. I
>>>> don't want the black DOS console appearing behind my GUI, but I have
>>>> no idea how to do it. Somebody can help? Thanks!


Have them run with pythonw.exe instead of python.exe. That is how IDLE
does it.

--
Terry Jan Reedy


Jonathan Hartley 09-13-2010 10:13 AM

Re: Hide DOS console for .pyc file
 
On Sep 11, 11:32*am, Lawrence D'Oliveiro <l...@geek-
central.gen.new_zealand> wrote:
> In message <i6fivp$76v$0...@news.t-online.com>, Peter Otten wrote:
>
> > Lawrence D'Oliveiro wrote:

>
> >> In message
> >> <3a2d194c-9b34-4b84-8680-28bdfb53b...@y3g2000vbm.googlegroups.com>, Muddy
> >> Coder wrote:

>
> >>> For a quick testing purpose, I deliver .pyc files to my customer. I
> >>> don't want the black DOS console appearing behind my GUI, but I have
> >>> no idea how to do it. Somebody can help? Thanks!

>
> >> Dont run it on Windows.

>
> > If you switch the OS for every minor problem you'll run out of operating
> > systems pretty soon...

>
> Not if you choose a suitably flexible and portable one to begin with.




It isn't the OP choosing, it's his client. Now, I dislike aspects of
Windows as much as anybody, but even I can see that dictating which OS
your client is allowed to use if they want to run your program is
sometimes not a viable option.



All times are GMT. The time now is 04:08 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.