From d62ffa36e4bd49fee99f918ed5b5ffa689188121 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 14 Sep 2012 12:32:56 -0400 Subject: [PATCH] posts:gstreamer:beep: use argparse default values for frequency. --- posts/GStreamer/beep.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/posts/GStreamer/beep.py b/posts/GStreamer/beep.py index 55ecf63..50bb305 100755 --- a/posts/GStreamer/beep.py +++ b/posts/GStreamer/beep.py @@ -31,14 +31,11 @@ if __name__ == '__main__': parser = argparse.ArgumentParser(description='Play a pure tone') parser.add_argument( - '-f', '--frequency', type=float, help='tone frequency in Hz') + '-f', '--frequency', type=float, default=440, + help='tone frequency in Hz') args = parser.parse_args() - frequency = 440 - if args.frequency: - frequency = args.frequency - - start=Beep(frequency=frequency) + start=Beep(frequency=args.frequency) while True: time.sleep(10) -- 2.26.2