Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 1.07 KB

01 Introduction.md

File metadata and controls

33 lines (26 loc) · 1.07 KB

First thing you want when learning new library - shortest way to see it in action.

  1. Install pyirsdk

  2. Optional. Install ipython (interactive python interpretator with autocomplete functionality)

  3. Optional. Open C:\Users\...\Documents\iRacing\app.ini and change:

    [Graphics]
    ...
    fullScreen=0
    
  4. Go to iRacing website, and start test session with any car and with "Centripetal Circuit" (this track loads faster than others)

  5. Start Python with py command (or ipython if installed in step 2.) and type:

    >>> import irsdk
    >>> ir = irsdk.IRSDK()
    >>> ir.startup()
    <<< True
    >>> ir['Speed']
    <<< 0.0

When reading session data, you always must check it for existence first:

>>> if ir['WeekendInfo']:
>>>     print(ir['WeekendInfo']['WeekendOptions']['StartingGrid'])
<<< '2x2 inline pole on left'

Most available variables (like ir['Speed']) with descriptions you can find here.