this code allows you to resize and view the file named "lena-gray.png" in the same folder.
from PIL import Image
jpgfile = Image.open("lena-gray.png")
high = input("Genişliğini giriniz : ")
wid = input("Yüksekliğini giriniz : ");
out = jpgfile.resize((int(high), int(wid)))
out.show()
But instead of entering these values step by step, I want to enter
$ python mywork.py lena-gray.png 50 100
So I want to run it without opening the file and see the result. Can this be done on Phyton? Can you help me?
----------------------------------------Edit----------------------------------
I updated my code like down.
import sys
from PIL import Image
firstarg = str(sys.argv[1])
secondarg = int(sys.argv[2])
thirdarg = int(sys.argv[3])
jpgfile = Image.open(firstarg)
yuks = secondarg
gen = thirdarg
out = jpgfile.resize((int(yuks), int(gen)))
out.show()
And my codes work!