我试图在python中实现一个功能,我想发送一个文件作为电子邮件提醒的附件一切正常.我收到了所需主题的电子邮件提醒,但唯一的问题是我在电子邮件提醒中两次获得相同的附件.
fileMsg = email.mime.base.MIMEBase('application','octet-stream')
fileMsg.set_payload(file('/home/bsingh/python_files/file_dict.txt').read())
#email.encoders.encode_base64(fileMsg)
fileMsg.add_header('Content-Disposition','attachment;filename=LogFile.txt')
emailMsg.attach(fileMsg)
# send email
server = smtplib.SMTP(smtp_server)
server.starttls()
server.login(username, password)
server.sendmail(from_add, to_addr,emailMsg.as_string())
server.quit()
Run Code Online (Sandbox Code Playgroud) 我有一个bitbucket存储库,具有以下结构:
Directory-A->
directory a
directory b
file a
file b
file c
Run Code Online (Sandbox Code Playgroud)
现在我想将文件"b"和文件"c"移动到"目录a"
当我在本地机器上执行此操作并通过git add提交时.我在目录a中获取文件b和文件c但它们仍然存在于其外部.
我有一个图像,我想将其转置30度。是否可以使用类似的东西
spinPicture003 = Picture003.transpose(Image.Rotate_30)
Run Code Online (Sandbox Code Playgroud) 我有2个类--say A和B作为1个class -child类的父级,A和B类都有方法myMethod.现在,如果我在子类中调用mymethod,那么它指的是什么?