This is my code:
Code: Select all
import os
import sys
if __name__ == '__main__':
if len(sys.argv) > 2:
print("Please enter the correct folder path parameter")
print("Wrong number of parameters")
sys.exit()
else:
if os.path.isdir(sys.argv[1]):
print("Analysis in progress...")
print(sys.argv[1])
for file in os.listdir(sys.argv[1]):
if file.endswith(".las"):
filepath = os.path.join(sys.argv[1], file)
if os.path.isfile(filepath):
filepath = os.path.join(sys.argv[1], file)
command = "cloudcompare.CloudCompare -O {0} -C_EXPORT_FMT PLY -SAVE_CLOUDS".format(filepath)
os.system(command)
else:
continue
else:
print("Wrong number of parameters")
sys.exit()