[pyassimp] Check cmd line args in sample.py

pull/49/head
Séverin Lemaignan 2013-06-03 10:37:48 +02:00
parent 024bd4c470
commit 43dd6fb3bc
1 changed files with 8 additions and 1 deletions

View File

@ -77,5 +77,12 @@ def main(filename=None):
# Finally release the model
pyassimp.release(scene)
def usage():
print("Usage: sample.py <3d model>")
if __name__ == "__main__":
main(sys.argv[1] if len(sys.argv)>1 else None)
if len(sys.argv) != 2:
usage()
else:
main(sys.argv[1])