Frequency Tester in Python 2.7.3

Results 1 to 2 of 2
  1. #1
    Best Commu NA Cure is offline
    MemberRank
    Sep 2007 Join Date
    That way .. →Location
    1,247Posts

    Frequency Tester in Python 2.7.3

    I made one of these to play around with, I decided to put it up here. Its an extremely simple program, but will provide a few minutes of entertainment..

    So yea, if you really want it, here's the code.

    Code:
    import winsound
    
    
    def welcome():
        print("Wecome to Freq-Tester!")
        setop()
    
    
    def setop():
        what = int(input("\nWhat frequency would you like to hear: "))
        time = int(input("How long would you like it to last in seconds: "))
        if what <= 36 or what > 32767:
            print("Frequency must be between 37 and 32767")
            setop()
        if what == "credits" or time == "credits":
            print("Program made by Jordan Ludgate!")
            print("In Python 2.7.3!")
            setop()
        else:
            finaltime = time * 1000
            Freq = what
            Dur = finaltime
            winsound.Beep(Freq,Dur)
            setop()
    
    
    welcome()
    K cool, pc.


  2. #2
    Enthusiast maxibaby is offline
    MemberRank
    Feb 2007 Join Date
    41Posts

    Re: Frequency Tester in Python 2.7.3

    Thanks for sharing, loled at the app :P, by the way there's an exception ValueError when trying to go to "credits"



Advertisement