Calling CloudCompare from Python
Posted: Thu Mar 01, 2018 12:36 pm
I want to run CloudCompare in command-line mode from the Python program. CloudCompare installed at C:\CloudCompare. In Python I construct command command e.g.:
and execute it with subprocess, like
But it does not work, instead a window pops-up with message
I tried another approach: created batch file with required command and execute it using
Still no luck, but error is different:
Am I doing something wrong? Any ideas how to make it work?
Code: Select all
C:\CloudCompare\CloudCompare.exe -SILENT -NO_TIMESTAMP -O lasfile.las -CROPD2D z 42 ....
Code: Select all
with subprocess.Popen(command,
shell=True,
stdout=subprocess.PIPE,
stdin=subprocess.DEVNULL,
stderr=subprocess.STDOUT,
universal_newlines=True) as proc:
# do something
If I cd into C:\CloudCompare, open command line and execute the same command it works. Also same command works without errors when executed from the batch file.This application failed to start because it could not find or load the Qt platform plugin "windows" in "".
Available platform plugins are: direct2d, minimal, offscreen, windows, windows.
Reinstalling the application may fix this problem.
I tried another approach: created batch file with required command and execute it using
Code: Select all
with subprocess.Popen("cmd.exe /c /path/to/batchfile.bat",
shell=True,
stdout=subprocess.PIPE,
stdin=subprocess.DEVNULL,
stderr=subprocess.STDOUT,
universal_newlines=True) as proc:
# do something
And again same batch file worked fine when executed directly or from command-line.Syntax error in file name,directory name or drive letter
Am I doing something wrong? Any ideas how to make it work?