2024-03-25から1日間の記事一覧
Pythonを使用してはてなブログに記事を投稿する方法について説明します。はてなブログのAPIを利用することで、Pythonスクリプトからブログの記事を作成・更新することができます。以下の手順に従って設定してください。 はてなブログのAPIキーを取得する: は…
def process_text(text): # Check if the text contains CRLF (Windows line endings) if "\r\n" in text: # Split the text using CRLF lines = text.split("\r\n") else: # Assume UNIX line endings (LF) and split the text using LF lines = text.split…