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

change print foo to print(foo) --> python 3 works #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

TimoFriedri
Copy link

Simple change for the print lines in python 3

Copy link

@cclauss cclauss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add from __future__ import print_function to the top of the import statements to get identical output in Python 3.

print time.time() - now
print ret.shape, ret.dtype
print(time.time() - now)
print(ret.shape, ret.dtype)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not quite right. When you are printing multiple values separated by a comma then you must from __future__ import print_function at the top of the import statements to get identical output in Python 2.

$ python2 -c "print 'a', 'b' ; print('a', 'b')"

a b
('a', 'b')

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

Successfully merging this pull request may close these issues.

2 participants