https://github.com/ArduPilot/ardupilot/tree/master/Tools/ros2
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
from aqt import gui_hooks, mw | |
from aqt.editor import Editor | |
from aqt.webview import WebContent | |
def on_webview_will_set_content(web_content: WebContent, context: object) -> None: | |
if isinstance(context, Editor): | |
web_content.js.append(f"/_addons/{__name__.split('.')[0]}/indent_with_tab.js") | |
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
User | |
pythonで有限状態マシーンを実装しようと思っています。コルーチン(Generator)を使って実装することは可能でしょうか? | |
ChatGPT | |
はい、Pythonで有限状態マシンを実装するためにコルーチン(Generator)を使用することは可能です。コルーチンは、状態と状態遷移を効果的に表現し、シンプルな構造で状態遷移を制御するのに役立ちます。以下に、コルーチンを使用して有限状態マシンを実装する基本的な例を示します。 | |
python | |
Copy code | |
def state_machine(): | |
state = "start" | |