Skip to content

Chapter 1. rxPySample.py doesnt work - i fixed it #7

Description

@zoldaten

As rx library has updated the code should be:
import rx

class temperatureObserver():

def on_next(self, x):
print("Temperature is: %s degrees centigrade" % x)
if (x > 6):
print("Warning: Temperate Is Exceeding Recommended Limit")
if (x == 9):
print("DataCenter is shutting down. Temperature is too high")
def on_error(self, e):
print("Error: %s" % e)

def on_completed(self):
print("All Temps Read")

xs = rx.from_iterable(range(10))
d = xs.subscribe(temperatureObserver())

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions