Added syntax print statements

This commit is contained in:
Andrew Murray 2018-01-06 21:51:45 +11:00
parent 3c73043509
commit b7aab522e1
2 changed files with 10 additions and 1 deletions

View File

@ -353,6 +353,11 @@ if sys.platform == 'darwin':
if __name__ == '__main__': if __name__ == '__main__':
if len(sys.argv) < 2:
print("Syntax: python IcnsImagePlugin.py [file]")
sys.exit()
imf = IcnsImageFile(open(sys.argv[1], 'rb')) imf = IcnsImageFile(open(sys.argv[1], 'rb'))
for size in imf.info['sizes']: for size in imf.info['sizes']:
imf.size = size imf.size = size

View File

@ -186,5 +186,9 @@ else:
register(XVViewer) register(XVViewer)
if __name__ == "__main__": if __name__ == "__main__":
# usage: python ImageShow.py imagefile [title]
if len(sys.argv) < 2:
print("Syntax: python ImageShow.py imagefile [title]")
sys.exit()
print(show(Image.open(sys.argv[1]), *sys.argv[2:])) print(show(Image.open(sys.argv[1]), *sys.argv[2:]))