diff options
author | Yegor Yefremov <yegorslists@googlemail.com> | 2021-02-24 10:10:00 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-02-24 14:59:48 +0100 |
commit | cc07d21410d707a3e3cf16c3fa187562dcdea58b (patch) | |
tree | 25935d853b43b8777487240525d3a938b1219123 /examples/network-scan-python | |
parent | 6250603496eb27fa9001e7df882ad736c8ab9b01 (diff) |
examples: network-scan: get rid of global variables
Move the code into the main() routine.
Diffstat (limited to 'examples/network-scan-python')
-rwxr-xr-x | examples/network-scan-python/network-scan-python | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/network-scan-python/network-scan-python b/examples/network-scan-python/network-scan-python index 12ee02f7..21dd89f4 100755 --- a/examples/network-scan-python/network-scan-python +++ b/examples/network-scan-python/network-scan-python @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- # # This program is free software; you can redistribute it and/or modify it under @@ -26,7 +26,8 @@ gi.require_version('ModemManager', '1.0') from gi.repository import Gio, GLib, GObject, ModemManager -if __name__ == "__main__": +def main(): + """Main routine.""" # Process input arguments if len(sys.argv) != 1: @@ -67,3 +68,7 @@ if __name__ == "__main__": network.get_availability()))) else: print('no networks found') + + +if __name__ == "__main__": + main() |