קוד: |
# Import the hdate library from hdate import * # Create a new Hdate object h = Hdate() # Get today's year and julian number for_year = h.get_gyear() julian = h.get_julian() # Loop until end of year and print the holidays while h.get_gyear() == for_year: # If holiday print the date if h.get_holyday_type() != 0: print h.get_format_date (0) # Increase date by one day julian += 1 h.set_jd(julian) |
קוד: |
libhdate-1.6.02/examples/bindings$ python hdate_python.py 18 Nisan 5776, 3 in the Omer, Hol hamoed Pesach 19 Nisan 5776, 4 in the Omer, Hol hamoed Pesach 20 Nisan 5776, 5 in the Omer, Hol hamoed Pesach 21 Nisan 5776, 6 in the Omer, Pesach VII 27 Nisan 5776, 12 in the Omer, Yom HaShoah 3 Iyyar 5776, 18 in the Omer, Yom HaZikaron 4 Iyyar 5776, 19 in the Omer, Yom HaAtzma'ut 18 Iyyar 5776, 33 in the Omer, Lag B'Omer 28 Iyyar 5776, 43 in the Omer, Yom Yerushalayim 5 Sivan 5776, 49 in the Omer, Erev Shavuot 6 Sivan 5776, Shavuot 18 Tammuz 5776, Tzom Tammuz 29 Tammuz 5776, Zeev Zhabotinsky day 10 Av 5776, Tish'a B'Av 15 Av 5776, Tu B'Av 1 Tishrei 5777, Rosh Hashana I 2 Tishrei 5777, Rosh Hashana II 3 Tishrei 5777, Tzom Gedaliah 9 Tishrei 5777, Erev Yom Kippur 10 Tishrei 5777, Yom Kippur 15 Tishrei 5777, Sukkot 16 Tishrei 5777, Hol hamoed Sukkot 17 Tishrei 5777, Hol hamoed Sukkot 18 Tishrei 5777, Hol hamoed Sukkot 19 Tishrei 5777, Hol hamoed Sukkot 20 Tishrei 5777, Hol hamoed Sukkot 21 Tishrei 5777, Hoshana raba 22 Tishrei 5777, Shmini Atzeret 12 Cheshvan 5777, Yitzhak Rabin memorial day 25 Kislev 5777, Chanukah 26 Kislev 5777, Chanukah 27 Kislev 5777, Chanukah 28 Kislev 5777, Chanukah 29 Kislev 5777, Chanukah 1 Tevet 5777, Chanukah 2 Tevet 5777, Chanukah |