Status Report sending using python I used this script to sending status report to my team lead. It will read the status from the file Readme.md. Here i already wrote my status. if this script execute on target_time or greater than it will execute the mailer function otherwise ask for confirmation

# importing messagebox for confirmation diaglog box
import tkMessageBox
import smtplib

from time import gmtime, strftime


def mail_send():
    target_time = 02
    # By using strftime we only current time in hours, it returns string like
    # "12"
    current_Time = strftime("%H")
    print current_Time

    # convert str to number
    cTime = int(current_Time)

    def sub_mailer():

        print "Mailer loading ...."
        s = smtplib.SMTP('smtp.gmail.com', 587)
        s.starttls()
        s.login('myuser@gmail.com', 'anypass')
        f = open('Readme.md', 'r')
        filedata = f.read()
        subject = "Today Update"
        msg = 'Subject:{}\n\n{}'.format(subject, filedata)
        s.sendmail('myuser@gmail.com', 'teamlead@Gmail.com',
                   msg)
        s.quit()
        f.close()

    # get time using time module
    if target_time &lt;= cTime:
        sub_mailer()
    else:
        status = tkMessageBox.askquestion(
            "Shift hours is not completed. Shall i  send a mail", icon="warning")
        if status == "yes":
            sub_mailer()
        else:
            print "Mail sending process was canceled by user"
First of all, Welcome to CodeReview!

Let's analyse the code to see what could be improved here.


current_Time = strftime("%H")
print current_Time
# convert str to number
cTime = int(current_Time)



A few things could be improved here:


Too many calls! current_Time = int(strftime("%H")) would have sufficed
the comment # convert str to number adds no real value to the code readability



s = smtplib.SMTP('smtp.gmail.com', 587)




Use better names, s does not make it clear what it does.
Avoid "magic" numbers-- it would have been better to have these as named constants



f = open('Readme.md', 'r')




Use context managers (with open ... as ...), see the docs




Some random thoughts


Use guards-- that way your script can be imported by other modules. Might not need it here, but I think it is good practice to always use them.
Consider upgrading your python-2.7 to python-3 and port all your code, since the Python 2 End Of Life is just 2 years away!