Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #77852
| From | Dave Angel <davea@davea.name> |
|---|---|
| Subject | Re:find the error |
| Date | 2014-09-13 19:26 -0400 |
| Organization | news.gmane.org |
| References | <70d7bef7-6393-41e1-b4e0-a5d3a6630063@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.14001.1410650691.18130.python-list@python.org> (permalink) |
daoudimca@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
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
find the error daoudimca@gmail.com - 2014-09-12 22:47 -0700
Re: find the error Chris Angelico <rosuav@gmail.com> - 2014-09-13 15:53 +1000
Re: find the error Andrea D'Amore <anddamNOALPASTICCIODICARNE+gruppi@brapi.net> - 2014-09-13 08:43 +0200
Re: find the error Denis McMahon <denismfmcmahon@gmail.com> - 2014-09-13 17:28 +0000
Re:find the error Dave Angel <davea@davea.name> - 2014-09-13 19:26 -0400
csiph-web