@@ -90,14 +90,15 @@ train = ICEPortal()
90
90
train.init() # Explicit call to init method to initialize API connection
91
91
92
92
print (
93
- " Travelling at" , train.speed, " m/s" ,
93
+ f " Travelling at { train.speed} m/s" ,
94
94
f " ( { kmh(ms = train.speed):.2f } km/h) " ,
95
- " with a delay of" , train.delay, " seconds"
95
+ f " with a delay of { train.delay.total_seconds() :.0f } seconds"
96
96
)
97
97
98
98
print (
99
- " Next stop:" , train.current_station.name,
100
- " at" , train.current_station.arrival.actual.strftime(" %H:%M" )
99
+ f " Next stop: { train.current_station.name} " ,
100
+ f " at { train.current_station.arrival.actual.strftime(' %H:%M' )} " ,
101
+ f " on platform { train.current_station.platform.actual} "
101
102
)
102
103
103
104
with ICEPortal() as train: # init automatically called
@@ -113,7 +114,7 @@ You can read more information about available attributes in the [trains document
113
114
> As you may have noticed by now, the package always returns datetime or timedelta objects for time based values
114
115
> and other values like distances, velocity, etc. in SI units,
115
116
> so you have to convert to other units if you want to use values different from the SI units.
116
- > For convenience the `` onboardapis.units `` module has functions to convert between units.
117
+ > For convenience the `` onboardapis.units `` module provides functions to convert between units.
117
118
118
119
---
119
120
0 commit comments