Skip to content

Commit 2ebec62

Browse files
committed
Moved input checking code to check_input() function.
1 parent daab44a commit 2ebec62

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

IMAGES & PHOTO SCRIPTS/Image-Inverter/inverter.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
from PIL import ImageOps
55
import sys, os
66

7-
def main():
8-
# if the script is called with no input
7+
def check_input():
8+
""" Checks if the script is called with no input parameters. """
99
if len(sys.argv) == 1:
10-
print("Please provide files to operate on!")
10+
print("Please provide image files to operate on!")
1111
sys.exit(1)
1212

13+
def main():
14+
check_input()
15+
1316
i = 0
1417
for file in sys.argv:
1518
# ignore the first parameter -> the script call

0 commit comments

Comments
 (0)