From 442802af993a3411750664ed02ca1ee489899aea Mon Sep 17 00:00:00 2001 From: Claudio Jolowicz Date: Sat, 22 Aug 2020 13:45:21 +0200 Subject: [PATCH] Rename `main` to `run` By convention, the entry point for the console script is a function called `main`. This function encompasses all the code currently in the `if __name__ == "__main__":` block. But there is already a function called `main`, for the main loop. So we rename this function to `run`, choosing a short name with similar meaning. --- bpytop.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bpytop.py b/bpytop.py index 0056a8d..129037a 100755 --- a/bpytop.py +++ b/bpytop.py @@ -4470,7 +4470,7 @@ if __name__ == "__main__": #? Main loop -------------------------------------------------------------------------------------> - def main(): + def run(): while not False: Term.refresh() Timer.stamp() @@ -4483,7 +4483,7 @@ if __name__ == "__main__": #? Start main loop try: - main() + run() except Exception as e: errlog.exception(f'{e}') clean_quit(1)