Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError for print statement #971

Closed
jeremykeen opened this issue Jun 2, 2017 · 4 comments
Closed

SyntaxError for print statement #971

jeremykeen opened this issue Jun 2, 2017 · 4 comments
Assignees

Comments

@jeremykeen
Copy link

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
@gguuss
Copy link
Contributor

gguuss commented Jun 2, 2017

This should get fixed in the CLI PR.

@eicca
Copy link

eicca commented Jun 14, 2017

@gguuss I think that the mentioned PR doesn't touch cloudiot_mqtt_example.py. The print statements still have invalid syntax.

@gguuss
Copy link
Contributor

gguuss commented Jun 15, 2017

Sorry about that, hopefully fixed in this PR

@jeremykeen
Copy link
Author

resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants