Skip to content

SyntaxError for print statement #971

Description

@jeremykeen

In which file did you encounter the issue?

python-docs-samples/iot/api-client/mqtt_example/cloudiot_mqtt_example.py

Did you change the file? If so, how?

-    print 'on_connect', error_str(rc)
+    print('on_connect', error_str(rc))
 
 
 def on_disconnect(unused_client, unused_userdata, rc):
     """Paho callback for when a device disconnects."""
-    print 'on_disconnect', error_str(rc)
+    print('on_disconnect', error_str(rc))
 
 
 def on_publish(unused_client, unused_userdata, unused_mid):
     """Paho callback when a message is sent to the broker."""
-    print 'on_publish'
+    print('on_publish')

Describe the issue

python cloudiot_mqtt_example.py     --project_id=<project>    --registry_id=<registry>     --device_id=<device>     --private_key_file=rsa_private.pem     --algorithm=RS256
  File "cloudiot_mqtt_example.py", line 95
    print 'on_connect', error_str(rc)
                     ^
SyntaxError: invalid syntax

Activity

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

Metadata

Metadata

Assignees

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