ITERM2 Python API: So führen Sie einen Befehl und Erfassungsergebnis ausPython

Python-Programme
Anonymous
 ITERM2 Python API: So führen Sie einen Befehl und Erfassungsergebnis aus

Post by Anonymous »

Es ist ziemlich einfach, einen Befehl mit der API zu senden: < /p>

Code: Select all

#!/usr/bin/env python3

import tkinter as tk
import iterm2
# To install, update, or remove packages from PyPI, use Scripts > Manage > Manage Dependencies...

async def main(connection):
# Your code goes here. Here's a bit of example code that adds a tab to the current window:
app = await iterm2.async_get_app(connection)
session = app.current_window.current_tab.current_session
if session is not None:
await session.async_send_text('date\n')
< /code>
Aber wie erfasst ich das Ergebnis dieses Befehls? Ich habe überprüft: < /p>
[list]
[*]ScreenStreamer
[*]

Code: Select all

async_get_contents
[/list]
(siehe API DOC)
Aber für mich funktioniert nichts wirklich. Irgendwelche Gedanken?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post