Python Forum
I'm looking for some help with winsound
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I'm looking for some help with winsound
#1
Ok, so my code works. Running it in idle works fine and it plays the sound however when I try to run the program in the regular python console I hear the little windows error noise. Here is my code
def main():
        print("Hello")
        Omniscence = input("how is it going")
        print(Omniscence + ",Ok")
        print("let me ask you a question...")
        Answer = input("would you rather fight 100 chicken sized horses or 10 horse sized chicken")
        Name = input("hey, so what's your name anyway")
        print("so" + Name )
        Color = input("what's your favorite color ")
        if Color == "red":
            print("Red, really... I don't really like that one")
        if Color == "blue":
            print("Oh, okay not my favorite but its okay.")
        if Color == "pink":
            print("What!!!!, I hate pink")
            import winsound
            winsound.PlaySound('Game Laugh Sound.wav', winsound.SND_FILENAME)
        else:
            print("Game Over")
            print("Shutting")
            print("Down")
            print("Really")
            print("you failed")
            print(" ")
            print(" ")
            print(" ")
            print(" ")
while True:
    main()
    if input("Repeat the program? (Y/N)").strip().upper() != 'Y':
        break
Would appreciate the help. Thx Big Grin

Btw this is a script I made to freak out my friend.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python 3.7, Windows 10, pyinstaller, winsound, no sound in executable kmarien 3 3,640 Nov-30-2020, 04:10 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020