示例#1
0
def main():
    t = time.localtime()
    if len(sys.argv) > 1:
        if sys.argv[1] == "test":
            test()
        else:
            try:
                print(saytime(*(sys.argv[1].split(":"))).words())
            except TypeError:
                print("Invalid time ({})".format(sys.argv[1]))
    else:
        print(
            "Sada je priblizno "
            + saytime_t(t).words()
            + ", na "
            + serb.day()
            + str(t.tm_mday)
            + "og "
            + serb.mth()
            + time.strftime(" %Y. godine.")
        )
示例#2
0
#!/usr/bin/env python3
# datetime.py by Bill Weinman <http://bw.org/contact/>
# Copyright (c) 2010 The BearHeart Group, LLC
# CGI/SSI version for bw.org
#

import time, saytime, serb

t = time.localtime()
#returns time struct object

print("Content-type: text/html\n")
print(
    "Sada je priblizno " +
    saytime.saytime_t(t).words() +
    ", na " +
    serb.day() +
    str(t.tm_mday) + "og " +
    serb.mth() +
    time.strftime(' %Y. godine.')
)