Python Forum
IndexError: list index out of range
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IndexError: list index out of range
#10
I'll try to explain my problem and how I'm trying to solve it with this code:

Basically, running this code I'm able to collect some info of aircrafts flying right now from an airline called AZU
from FlightRadar24.api import FlightRadar24API
fr_api = FlightRadar24API()

fr_api.get_flights(airline = 'AZU')
And the output looks like this:
[<(A332) PR-AIW - Altitude: 25300 - Ground Speed: 429 - Heading: 328>,
 <(A20N) PR-YSC - Altitude: 27850 - Ground Speed: 436 - Heading: 216>,
 <(A20N) PR-YRV - Altitude: 12900 - Ground Speed: 370 - Heading: 251>,
 <(C208) PR-WOT - Altitude: 1900 - Ground Speed: 164 - Heading: 84>,
 <(E295) PS-AEH - Altitude: 28725 - Ground Speed: 432 - Heading: 44>,
 <(A20N) PR-YSF - Altitude: 6725 - Ground Speed: 282 - Heading: 32>,
 <(A20N) PR-YSG - Altitude: 20575 - Ground Speed: 424 - Heading: 209>,
 <(E195) PR-AXY - Altitude: 27000 - Ground Speed: 453 - Heading: 72>,
 <(E195) PR-AXB - Altitude: 17650 - Ground Speed: 345 - Heading: 210>]
But I would like to run this code for more than one airline, like 'AZU', 'GLO', 'AAL', 'UAL', and so on...
And export this data to a TXT file, adding more two columns ([Date][Time]).

Moreover, I would like to run this code every minute, and keep upadating my TXT file.
How can I do that?
Reply


Messages In This Thread
IndexError: list index out of range - by brunolelli - Mar-25-2021, 04:43 AM
RE: IndexError: list index out of range - by buran - Mar-25-2021, 02:13 PM
RE: IndexError: list index out of range - by buran - Mar-25-2021, 02:26 PM
RE: IndexError: list index out of range - by brunolelli - Mar-25-2021, 02:44 PM
RE: IndexError: list index out of range - by buran - Mar-25-2021, 04:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  IndexError: index 10 is out of bounds for axis 0 with size 10 Mehboob 11 2,103 Sep-14-2023, 06:54 AM
Last Post: Mehboob
Thumbs Down I hate "List index out of range" Melen 20 3,319 May-14-2023, 06:43 AM
Last Post: deanhystad
Exclamation IndexError: Replacement index 2 out of range for positional args tuple - help? MrKnd94 2 6,358 Oct-14-2022, 09:57 PM
Last Post: MrKnd94
  IndexError: list index out of range dolac 4 1,913 Jul-25-2022, 03:42 PM
Last Post: deanhystad
  I'm getting a String index out of range error debian77 7 2,348 Jun-26-2022, 09:50 AM
Last Post: deanhystad
  IndexError: list index out of range Anldra12 2 1,442 May-03-2022, 01:39 PM
Last Post: Anldra12
  TypeError: list indices must be integers or slices, not range Anldra12 2 2,580 Apr-22-2022, 10:56 AM
Last Post: Anldra12
  matplotlib x axis range goes over the set range Pedroski55 5 3,209 Nov-21-2021, 08:40 AM
Last Post: paul18fr
  IndexError: list index out of range rf_kartal 6 2,844 Sep-07-2021, 02:36 PM
Last Post: Larz60+
  Python Error List Index Out of Range abhi1vaishnav 3 2,309 Sep-03-2021, 08:40 PM
Last Post: abhi1vaishnav

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020