This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| async def run(): | |
| proc = await asyncio.create_subprocess_exec( | |
| '/bin/ls', '/etc', '/not-exists', | |
| stdout=asyncio.subprocess.PIPE, | |
| stderr=asyncio.subprocess.PIPE | |
| ) | |
| # Prepare set of asynchronous readline() tasks for `stdout` and `stderr` streams |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from slack_sdk import WebClient | |
| from slack_sdk.errors import SlackApiError | |
| # Initialize a Web API client with your bot token | |
| slack_bot_token = 'xoxb-your-bot-token' | |
| client = WebClient(token=slack_bot_token) | |
| # Define the message text | |
| message_text = 'Hello, this is a message with a PDF attachment' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os.path | |
| import aiohttp.web | |
| async def get_tar(request): | |
| ''' | |
| AIOHTTP server handler for GET request that wants to download files from a `directory` using TAR. | |
| ''' | |
| directory = <specify the directory> | |
| response = aiohttp.web.StreamResponse( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import asyncio | |
| import socket | |
| import sys | |
| _AI_ADDRCONFIG = socket.AI_ADDRCONFIG | |
| if hasattr(socket, "AI_MASK"): | |
| _AI_ADDRCONFIG &= socket.AI_MASK |
OlderNewer