Files
UVtools/Scripts/UVtools.Python/print_layers.py
T
Tiago Conceição 6065d8f808 Python docs
2022-04-07 00:16:07 +01:00

22 lines
472 B
Python

#!/usr/bin/env python
"""print_layers.py: Print all layers from a file."""
__author__ = "Someone"
__copyright__ = "Copyright 2022, Planet Earth"
from UVToolsBootstrap import *
file = input('Input the file path: ')
slicerFile = None
try:
slicerFile = FileFormat.Open(file)
except Exception as e:
print(e)
exit(-1)
if slicerFile is None:
print(f'Unable to find {file} or it\'s invalid file')
exit(-1)
for layer in slicerFile:
print(layer)