2022-04-04
测试Blog
测试下图床服务
如何发布图片
- 本地的图片上传blog的时候难道要手动发布?我看到发布的时候好像只能原文发布,不能把地址转换过后的文章发布出去.
测试下图床服务
MWeb 是一个 Markdown 写作的、记笔记的软件,而且功能很强大。具体介绍看官网吧!博主一直用这个写博客、记笔记,很方便哦。
在 MWeb 软件写完文章,你可以直接使用本软件的集成的一键发布功能,轻轻松松实现文章的发布。
MWeb 是专业的 Markdown 写作、记笔记、静态博客生成软件,目前已支持 Mac,iPad 和 iPhone。MWeb 有以下特色:
如果要更详细了解 MWeb,建议你一定要去看一下官网的帮助文档,网址为:https://zh.mweb.im/help.html。我们建议在使用文档库之前,一定要阅读一下 MWeb 文档库详细介绍 这篇文章,以便更好的使用文档库。
如果你喜欢 MWeb,想让它变得更好,你可以:
from __future__ import print_function
import httplib2
import os
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
try:
import argparse
flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args()
except ImportError:
flags = None
# If modifying these scopes, delete your previously saved credentials
# at ~/.credentials/sheets.googleapis.com-python-quickstart.json
SCOPES = 'https://www.googleapis.com/auth/spreadsheets.readonly'
CLIENT_SECRET_FILE = 'client_secret.json'
APPLICATION_NAME = 'Google Sheets API Python Quickstart'
def get_credentials():
"""Gets valid user credentials from storage.
If nothing has been stored, or if the stored credentials are invalid,
the OAuth2 flow is completed to obtain the new credentials.
Returns:
Credentials, the obtained credential.
"""
home_dir = os.path.expanduser('~')
credential_dir = os.path.join(home_dir, '.credentials')
if not os.path.exists(credential_dir):
os.makedirs(credential_dir)
credential_path = os.path.join(credential_dir,
'sheets.googleapis.com-python-quickstart.json')
print("client_secret path = ",credential_path)
store = Storage(credential_path)
credentials = store.get()
if not credentials or credentials.invalid:
flow = client.flow_from_clientsecrets(CLIENT_SECRET_FILE, SCOPES)
flow.user_agent = APPLICATION_NAME
if flags:
credentials = tools.run_flow(flow, store, flags)
else: # Needed only for compatibility with Python 2.6
credentials = tools.run(flow, store)
print('Storing credentials to ' + credential_path)
return credentials
def main():
"""Shows basic usage of the Sheets API.
Creates a Sheets API service object and prints the names and majors of
students in a sample spreadsheet:
https://docs.google.com/spreadsheets/d/1sEkLLL5kCKWkQQAoQW2Pxy0uh7jXmRTFIrTSr0NmNK4/edit
"""
credentials = get_credentials()
http = credentials.authorize(httplib2.Http())
discoveryUrl = ('https://sheets.googleapis.com/$discovery/rest?'
'version=v4')
service = discovery.build('sheets', 'v4', http=http,
discoveryServiceUrl=discoveryUrl)
spreadsheetId = '1sEkLLL5kCKWkQQAoQW2Pxy0uh7jXmRTFIrTSr0NmNK4'
rangeName = 'test!A:A'
result = service.spreadsheets().values().get(
spreadsheetId=spreadsheetId, range=rangeName).execute()
values = result.get('values', [])
if not values:
print('No data found.')
else:
print('B Cloumns:')
for row in values:
# Print columns A and E, which correspond to indices 0 and 4.
if row[0]:
print('%s' % (row[0]))
if __name__ == '__main__':
main()
内聚的分类:
耦合的分类: