[Python] How can I create a tuple of tuples with a date range? I am getting a generator output...

Discussão em 'Python' iniciado por Stack, Maio 21, 2025.

  1. Stack

    Stack Membro Participativo

    My code currently looks like:

    ALLOW_EMPTY = [('bats', 'group', change_format(date) for date in (date time(2016,2,23), date time(2016,6,10)))]


    When I print ALLOW_EMPTY above, I get:

    ('bats', 'group', <generator object <genexpr> at 0xblahblah).


    Any ideas how I could get something like:

    [('bats', 'group', 20160223), ('bats', 'group', 20160224), ...]


    The change_format function changes the date time to an integer.

    Continue reading...

Compartilhe esta Página