daoudi...@gmail.com Wrote in message: > Dear friends when i used > import urllib, re, sys > > symbol = sys.argv[1] >>> this function is show -->> symbol = sys.argv[1] > IndexError: list index out of range > > kindly find the solution of this >
sys.argv is filled in from the command line arguments. Perhaps your script should protect itself by majing sure len (sys.argv) is what's required, in this case at least 2. That way the user gets a friendlier message when he omits the arguments. By the way, you should simply copy/paste the entire stack trace. When you paraphrase, you're likely to have a typo, or omit something useful. -- DaveA -- https://mail.python.org/mailman/listinfo/python-list