Re: Hiding console window

From: Josef Meile (jmeile_at_hotmail.com)
Date: 03/19/04


Date: Fri, 19 Mar 2004 09:44:25 +0100

If you generate the exe with py2exe, then you could do:

python setup.py py2exe -v -w

Where setup.py is the setup script where you specify the
python imports and your program modules. (see py2exe
documentation). The "-w" option was the option I was
talking before. I don't know if it produces the same
effect of the proposed solution by Otto. With this option,
you won't see a DOS console, however, I don't know if
it will hide the icon on the task bar. Try to call the script
on the "Startup" menu or with the "Scheduled Tasks" of
windows or perhaps you will have to do it from the
registry.

> In response to Peter's question, what I meant when I said hide was to hide
> the console while running the program. Essentially, it would run in the
> background. The application would run, but you wouldn't see any sign of
it.
> In response to Jorgen and Josef, unfortunately it didn't work. Here's the
> code for it. It may be a little messy, but I wasn't aiming for perfection:
>
> import pygame
> import time
>
> def sleep():
> #Sleep for 5 minutes
> time.sleep(300)
> def play():
> #Initialize pygame
> pygame.init()
> #Initialize mixer
> pygame.mixer.init()
> #Load and play sound1
> pygame.mixer.music.load('C:/sound1.mp3')
> pygame.mixer.music.play()
> sleep()
> #Load and play hazards of retreating
> pygame.mixer.music.load('C:/hazards_of_retreating.mp3')
> pygame.mixer.music.play()
> sleep()
> #Load and play bring it on
> pygame.mixer.music.load('C:/bring_it_on.mp3')
> pygame.mixer.music.play()
> sleep()
> #Load and play freaked by flood
> pygame.mixer.music.load('C:/freaked_by_flood.mp3')
> pygame.mixer.music.play()
> sleep()
> #Load and play grunty thirst
> pygame.mixer.music.load('C:/grunty_thirst.mp3')
> pygame.mixer.music.play()
> sleep()
> #Load and play joe has lost it
> pygame.mixer.music.load('C:/joe_has_lost_it.mp3')
> pygame.mixer.music.play()
> sleep()
> #Load and play the french grunt
> pygame.mixer.music.load('C:\the_french_grunt.mp3')
> pygame.mixer.music.play()
> sleep()
> #Load and play stacker e3 outtake2
> pygame.mixer.music.load('C:\stacker_e3_outtake2.mp3')
> pygame.mixer.music.play()
> sleep()
> #Load and play poor running anatomy
> pygame.mixer.music.load('C:\poor_running_anatomy.mp3')
> pygame.mixer.music.play()
> sleep()
> #Load and play bring it on
> pygame.mixer.music.load('C:\bring_it_on.mp3')
> pygame.mixer.music.play()
> #Quit playing and close pygame
> pygame.mixer.quit()
> pygame.quit()
>
> #Start the program
> play()
>
> You may raise your eyebrows at the filenames, but as I said its a joke I'm
> playing. The sound clips are based off the game Halo. Just fill in your
own
> files instead of mine.



Relevant Pages

  • Re: Hiding console window
    ... > I'm looking to play a joke on a friend and I'm wondering if there's a way ... > not show or hide the DOS console. ... #Sleep for 5 minutes ... #Load and play hazards of retreating ...
    (comp.lang.python)
  • Re: Favorite Schumann Sym Recordings
    ... The sax players I've asked generally ... They don't play them. ... >Just woke up from a wonderful sleep. ... >No, you are being untrue. ...
    (rec.music.classical.recordings)
  • Re: Favorite Schumann Sym Recordings
    ... There are many former NY freelancers now in the Marine Band ... The sax players I've asked generally ... They don't play them. ... Just woke up from a wonderful sleep. ...
    (rec.music.classical.recordings)
  • Re: Printing Problems with Remote Desktop
    ... now you lost me on the plug and play. ... when I get to the office and load the printer information. ... >> for my home computer into the work computer. ...
    (microsoft.public.windowsxp.newusers)
  • Re: dcps out there... sleep question
    ... Getting him to understand that here we have meal and snack times and the things that go along with that; sitting at a table, once you hop down to play you are done... ... Aid him in learning to sleep at this place? ... I agree with much of what has already said, and want to add that over the years I have had very few children who could not acclimate to our daily schedule, which includes a mandatory nap/quiet time for all of the cherubs, regardless of age. ... There is no talking, I have 'kids' classical or multicultural music playing quietly, and all told, once everyone is settled, nap lasts for approximately an hour and a half. ...
    (misc.kids)