program 1 : convert hejri year to calendar year
import os
def hejri_calen():
h_year = 0
c_year = 0
h_year = raw_input("write a hejri year")
c_year = (int(h_year) + 622) - (int(h_year)/33)
print(c_year)
# test de la fonction calen_hejri
if __name__ == "__main__":
hejri_calen()
os.system("pause")
program 2 convert calendar year to hejri year
import os
def calen_hejri():
h_year = 0
c_year = 0
c_year = raw_input("write a calendar year")
h_year = (int(c_year) - 622)/0.97
print(h_year)
#calen_hejri()
# test de la fonction calen_hejri
if __name__ == "__main__":
calen_hejri()
os.system("pause")
I’m doing an executable of the program2 using sublime text3 and cx_Freeze
it can works without needing to download python
https://drive.google.com/file/d/1NV4nj0_75fyvAOc1roRY11p8qfuSSyks/view?usp=sharing
noun of file is: calen-hejri
try it please
Note : when we have a problem to execute our program in sublime text we can use the module os to create a pause. it helps us to see the output of our code. And we can run our code with double click on it
import os # import of module os
our code
os.system("pause") #system pause
Here I created an integrate module to test the execution of the program
# test de la fonction calen_hejri
if __name__ == "__main__":
hejri_calen()