Python Subprocess for Command line batch processing
Posted: Thu Feb 05, 2015 11:26 pm
I'm trying to use Python to run batch export of .pyl to las. Here is my code:
##
My understanding is that this should run and simply export the .ply with the same file name and directory as a .las. No additional file is created however.
As is, my print statements return "[]" but I've messed around to get a child (CloudCompare) error of -1073741515.
Part of the problem could be my lack of understanding with subprocess although I've used successfully with other programs in the past. I'll dive more into documentation tonight.
Does anyone have any insight into whether this code is correct with regards to Python, Command line, or CloudCompare?
Any tips are much appreciated.
Thanks
Rich
##
Code: Select all
import os, subprocess
CCPath = r"U:\Programs\CloudCompare_v2.6.0_bin_x64\CloudCompare.exe"
filePath = r"U:\Testing\fwmm5b_v11.ply"
openFile=subprocess.Popen([CCPath, "CloudCompare", "-C_EXPORT_FMT", "LAS", "-O", filePath], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
openFile.wait()
print openFile.stderr.readlines()
print openFile.stdout.readlines()
As is, my print statements return "[]" but I've messed around to get a child (CloudCompare) error of -1073741515.
Part of the problem could be my lack of understanding with subprocess although I've used successfully with other programs in the past. I'll dive more into documentation tonight.
Does anyone have any insight into whether this code is correct with regards to Python, Command line, or CloudCompare?
Any tips are much appreciated.
Thanks
Rich