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

Port for python3 #39

Merged
merged 3 commits into from
Jul 11, 2018
Merged

Port for python3 #39

merged 3 commits into from
Jul 11, 2018

Conversation

jeancsil
Copy link

Make the python code to be compatible with python version 3.

jeancsil added 3 commits July 11, 2018 13:55
Change the print '' statements to print('').
Change the xrange to range.
Change the python2.7 headers to python only.
Python3 maps returns an iterator not a list.
Changed the division from
l1 = max(0, l - d / 2)
to
l1 = max(0, l - d // 2) for rounded
as in python3 the division is not rounded anymore by default.

Return a list() instead of iterator.
Use items() instead of iteritems().
@bakwc
Copy link
Owner

bakwc commented Jul 11, 2018

Thanks!

@bakwc bakwc merged commit a496927 into bakwc:master Jul 11, 2018
@jeancsil
Copy link
Author

I thank you for the project! Very handy!

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