pybites-tools icon indicating copy to clipboard operation
pybites-tools copied to clipboard

Have convert_time return the result instead of printing it

Open bbelderbos opened this issue 3 years ago • 1 comments

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 avatar Jan 17 '23 13:01 bbelderbos

I ended up using this:

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

        output.append((zone, formatted_time))

    return output

bbelderbos avatar Jan 17 '23 17:01 bbelderbos