[Qgis-user] run python script in win command shell - from QGIS plugin

Richard Duivenvoorde rdmailings at duif.net
Mon Mar 30 07:53:51 PDT 2015


On 30-03-15 13:57, Torsten Lange wrote:
> 
> Hi,
> 
> I would like to start a python script from my QGIS plugin using the
> Windows command shell. But nothing happens... :-/
> 
> If run Python in a Windows command shell, this 3-liner of code actually
> works:
> 
> import subprocess
> a = "start python " + r"C:\path\to\myscript.py"
> subprocess.call(a, shell=True)
> 
> Any suggestions how to do it?

Hi Torsten,

for a plugin I once called a java process from within a plugin.

you can find code here

https://github.com/Comsof/Designer-QGIS-Plugin/blob/master/python/FiberPlanITDesigner/fiberplanitdesigner.py#L412

Hope this is useful

Regards,

Richard Duivenvoorde




More information about the Qgis-user mailing list