1. Python / Говнокод #6887

    −88

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    try:
            dday = time.strftime("%d", time.localtime(os.path.getmtime(path + d))).lstrip('0')
            dmonth = time.strftime("%m", time.localtime(os.path.getmtime(path + d))).lstrip('0')
            dhour = time.strftime("%H", time.localtime(os.path.getmtime(path + d))).lstrip('0')
            dmin = time.strftime("%M", time.localtime(os.path.getmtime(path + d))).lstrip('0')
            screenpath = os.listdir(spath)
            for screen in screenpath:
                sday = time.strftime("%d", time.localtime(os.path.getmtime(spath + screen))).lstrip('0')
                smonth = time.strftime("%m", time.localtime(os.path.getmtime(spath + screen))).lstrip('0')
                shour = time.strftime("%H", time.localtime(os.path.getmtime(spath + screen))).lstrip('0')
                smin = time.strftime("%M", time.localtime(os.path.getmtime(spath + screen))).lstrip('0')
                if dday == sday:
                    if dmonth == smonth:
                        if dhour == shour:
                            if dmin == smin:
                                scr = spath + screen
                                if scr:
                                    return str(scr)
                                else:
                                    return None
        except:
            return "None"

    Проверка даты создания двух файлов

    Запостил: pztrn, 08 Июня 2011

    Комментарии (7) RSS

    Добавить комментарий