Power Automate DesktopでコマンドラインからPythonスクリプトを実行してみた

Power Automate DesktopにはPythonスクリプトの実行というアクションがありますが、Helpを見る限りPython2で書く必要がありそうです。Python2はサポートが切れているので、Python3で書いてDOSコマンドの実行からPythonスクリプトを実行してみました。

エディタで

import subprocess
subprocess.Popen([r'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe','https://news.yahoo.co.jp/topics'

と書いて、yahoo_topi.pyに保存。
それをPower Automate DesktopのDOSコマンドの実行から呼び出します。

作業フォルダにスクリプトファイルの保存先を指定して、python yahoo_topi.pyとコマンドを入力すると、実行できました。

f:id:kei_kmj:20210802225500p:plain