I know this is an old thread, but why not add this info to it:
With no argument this would still fail, as with no arguments sys.argv[1] is still out of range. Better a try except block:
<SPAN class="keyword token">try</SPAN><SPAN class="punctuation token">:</SPAN> event_name <SPAN class="operator token">=</SPAN> sys<SPAN class="punctuation token">.</SPAN>argv<SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="keyword token">except</SPAN><SPAN class="punctuation token">:</SPAN> event_name <SPAN class="operator token">=</SPAN> raw_input<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"enter an event name: "</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
if not sys.argv[1]: event_name = raw_input('Enter an event name')
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.