Skip to content

Commit d9709ad

Browse files
committed
Edited a comment and changed a varialbe name for more clarity."
1 parent 2ebec62 commit d9709ad

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@ def check_input():
1111
sys.exit(1)
1212

1313
def main():
14+
""" The main function """
1415
check_input()
1516

1617
i = 0
17-
for file in sys.argv:
18-
# ignore the first parameter -> the script call
18+
for file in sys.argv:
19+
# To ignore the first parameter -> the script call
1920
if i == 0:
2021
i = i + 1
2122
continue
2223

23-
image_path, extension = os.path.splitext(file)
24+
image_path_no_ext, extension = os.path.splitext(file)
2425

2526
with Image.open(file) as image:
26-
ImageOps.invert(image).save(image_path + "_inverted" + extension)
27+
ImageOps.invert(image).save(image_path_no_ext + "_inverted" + extension)
2728

2829
i = i + 1
2930

0 commit comments

Comments
 (0)