Question:
Just trying to handle someIndexError
while using sys
. Searched a lot on how to do it, and I’ve come to a final “solution”, but I don’t know why it’s not working.Actual code
sys.argv[1]
inside the try blockCould anyone help me out on this?
Answer:
The issue comes from thet
and u
definitions above the two try
blocks. Get rid of those and keep your try
blocks and you should be good.If you have better answer, please add a comment about this, thank you!