python - IndexError: List Index out of range -


can figuring out what's wrong code? gives me error when run it:

traceback (most recent call last):   file "ap_settings.py", line 19, in <module>     ap_number = settings[test_settings_index][0] indexerror: list index out of range 

this file ap_settings.py:

# define variables # settings [ (ap_number, save_results, skip) ]  test_settings_index = 3  settings = [             (0, 0, 0),             ]  # defining fuzzing mac address device sta_mac = "00:20:a6:61:2d:09"  # defining injection interface iface   = "ath0"  ##### below variables should not tweaked user  ap_number = settings[test_settings_index][0] save_results = settings[test_settings_index][1] skip = settings[test_settings_index][2]  # defining fuzzing specific variables ap = [         ('kikoo', '00:11:22:33:44:55', 11, 'wpa-psk'),         ][ap_number]  ssid = ap[0] ap_mac = ap[1] channel = chr(ap[2]) ap_config = ap[3]  # defining number of retries when authenticating/associating ap crash_retries = 10 delay = 1 state_wait_time = 2 delay_reboot = 10 log_level = 3 crash_threshold = 3 truncate = true  # defining log file fname = [none, 'audits/ap-%s-%s.session' % (ap_mac, ap_config)][save_results] 

at top of file have this:

test_settings_index = 3 settings = [             (0, 0, 0),             ] 

then little further down have this:

ap_number = settings[test_settings_index][0] save_results = settings[test_settings_index][1] skip = settings[test_settings_index][2] 

you trying access index position 3 of settings because test_settings_index set to, settings has 1 item in it, should looking @ index 0:

ap_number = settings[0][0] save_results = settings[0][1] skip = settings[0][2] 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -