Hiding console window

Lucas Raab pythongnome at hotmail.com
Thu Mar 18 16:44:06 EST 2004


"Lucas Raab" <pythongnome at hotmail.com> wrote in message
news:Xkh6c.8082$GQ3.5678 at newsread3.news.atl.earthlink.net...
> I'm looking to play a joke on a friend and I'm wondering if there's a way
to
> not show or hide the DOS console. My friend doesn't have python so I have
to
> compile it to an EXE.
>
> TIA
>
>

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.

TIA





More information about the Python-list mailing list