PyBites-Open-Source / pybites-tools

A repo to commit common Python utility scripts and snippets
MIT License
18 stars 8 forks source link

Have convert_time return the result instead of printing it #43

Open bbelderbos opened 1 year ago

bbelderbos commented 1 year ago

https://github.com/PyBites-Open-Source/pybites-tools/blob/main/pybites_tools/worldclock.py

I think we should have convert_time return the result so we can use it in another module, then move the print to the if name == main block. I am hitting this issue where I want to use the function in another script (from pybites_tools.worldclock import convert_time)

bbelderbos commented 1 year ago

I ended up using this:

    output = []
    for zone in timezones:
        ...
        ...

        output.append((zone, formatted_time))

    return output