0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

QGISからPythonスクリプトを実行する

0
Last updated at Posted at 2019-10-29

QGISからPythonスクリプトを実行できると
QGISプラグインから外部のPythonスクリプトを動かしたいときや
一時的にgdalなどのosgeo系ライブラリを使ったスクリプトを起動するときに便利です。
QGISのPythonコンソールは諸々のPATHが通ってますからね。

やり方

サブプロセスを使ってスクリプトを起動します。
Pythonコンソールでやってみましょう。

import subprocess
path = "d:/test.py"
subprocess.call("python %s" % path)

以上です。

0
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?