• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Frequency Tester in Python 2.7.3

Best Commu NA
Loyal Member
Joined
Sep 12, 2007
Messages
507
Reaction score
38
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.
 
Newbie Spellweaver
Joined
Feb 24, 2007
Messages
38
Reaction score
0
Thanks for sharing, loled at the app :p, by the way there's an exception ValueError when trying to go to "credits"
 
Back
Top