Drive into python (一)

1. Python 中的 from module import * 像 Java 中的 import module.*  |||  Python 中的 import module 像 Java 中的 import module

2. 在 Python 中,类的基类只是简单地列在类名后面的小括号里。不像在 Java 中有一个特殊的 extends 关键字。

3. Python 支持多重继承。在类名后面的小括号中,你可以列出许多你想要的类名,以逗号分隔。

转载于:https://www.cnblogs.com/MyEyes/archive/2011/11/06/2237846.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
您好!关于 OneDrivePython 开发,您可以使用 Microsoft Graph API 来实现。Microsoft Graph API 是微软提供的一组 RESTful API,可以访问 Office 365 中的各种资源,包括 OneDrive、Outlook、SharePoint 等。您可以使用 Python 的 requests 库来发送 HTTP 请求,从而调用 Microsoft Graph API。 具体来说,您需要先注册一个 Azure 应用程序,并获取应用程序的客户端 ID 和客户端机密。然后,您可以使用这些凭据来获取访问令牌,并使用访问令牌来调用 Microsoft Graph API。 以下是一个使用 Python 和 Microsoft Graph API 上传文件到 OneDrive 的示例代码: ```python import requests import json # Azure 应用程序凭据 client_id = 'your_client_id' client_secret = 'your_client_secret' # 获取访问令牌 token_url = 'https://login.microsoftonline.com/common/oauth2/v2.0/token' token_data = { 'grant_type': 'client_credentials', 'client_id': client_id, 'client_secret': client_secret, 'scope': 'https://graph.microsoft.com/.default' } token_response = requests.post(token_url, data=token_data) access_token = json.loads(token_response.text)['access_token'] # 上传文件到 OneDrive upload_url = 'https://graph.microsoft.com/v1.0/me/drive/root:/test.txt:/content' headers = { 'Authorization': 'Bearer ' + access_token, 'Content-Type': 'text/plain' } file_content = 'Hello, OneDrive!' upload_response = requests.put(upload_url, headers=headers, data=file_content) print(upload_response.status_code) ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值