python 会议室预约系统,使用python检查Outlook中会议室的可用性

博主正在编写一个Python脚本来检查特定会议室的可用性,如果可用则进行预订。目前,预订功能已经实现,但无法直接获取房间的可用状态。预订会议室通过发送邮件到指定的预订邮箱,并根据收到的确认或拒绝邮件来判断。提供的代码片段展示了如何创建Outlook应用对象,设置会议详情并尝试获取收件人的忙碌状态,但输出的忙碌状态数据需要解析以确定特定时间的可用性。
摘要由CSDN通过智能技术生成

I am working on to write a python script to check if particular meeting room is available. If yes then meeting room will be booked, if not then python will find available time slot for that day.

For now, I have achieved to book meeting room but I am not able to check availability of rooms.

To book any meeting room, i have to send mail to that book meeting room configured mail id and corresponding acceptance/decline mail I receive as per the availability.

below is the snippet :

import win32com.client

import datetime

import pywintypes

oOutlook = win32com.client.Dispatch("Outlook.Application")

appt = oOutlook.CreateItem(1)

appt.Start = '2018-05-18 13:30'

appt.Subject = 'Follow Up Meeting'

appt.Duration = 30

appt.Location = ''

appt.MeetingStatus = 1

myRecipient = appt.Recipients.Add("

myRecipient.resolve

my_date = datetime.date(2018,5,18)

pywintypeDate = pywintypes.Time (my_date)

availabilityInfo = myRecipient.FreeBusy(pywintypeDate,30,True)

print(availabilityInfo)

# appt.Save()

# appt.Send()

# print("done")

output is :

000000000000000000000222222200222222022000000000000000000000000000000002222222222220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000002220002222200000000000000000000000000000000002220022022222000000000000000000000000000000000000000000002222000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000222222200000000000000000000000000000000002220000022000000000000000000000000000000000000002220000222222000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000002220022022200000000000000000000000000000000000022000022000000000000000000000000000000000000000000000002222000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000022022200000000000000000000000000000000002220002222000000000000000

so is it first byte (0) indicate time slot from 00:00 to 00:30 and soon for one complete month ?

Is it possible to get output only for one day ?

Do i have to parse the above output to check availability for my particular required time ?

解决方案

appt.Recipients.Add returns the Recipient object. Resolve it first (Recipient.Resolve), then call Recipient.FreeBusy.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值