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

Make code work on modern Python systems #3

Closed
wants to merge 2 commits into from
Closed

Make code work on modern Python systems #3

wants to merge 2 commits into from

Conversation

c-w
Copy link

@c-w c-w commented May 29, 2018

This pull request updates the code to make it work on all modern Python systems such as Python 2.7 or Python 3.5. This required two main changes:

Note that the updated code no longer supports Python 2.5 or Python 2.6 since the xml.etree library did not support XPath queries with attribute lookups (such as country[@code]) in those versions.

c-w added 2 commits May 28, 2018 19:46
PyXML is an old library that's hard to install in modern Python
distributions. This commit modifies the XML parsing to instead leverage
the standard library xml.etree module [1]. The module has been around
since Python 2.5 which means that the updated code should run on the
vast majority of modern systems.

[1] https://docs.python.org/2/library/xml.etree.elementtree.html
The changes required for making the tool work in both Python 2 and
Python 3 are fairly minimal and fully backwards compatible:

- Use `input` instead of `raw_input`.
- Use `int` instead of `string.atoi`.
- Convert print statements to function calls.
@c-w
Copy link
Author

c-w commented Jun 7, 2018

Closing in favor of #4

@c-w c-w closed this Jun 7, 2018
@c-w c-w deleted the modernize branch June 7, 2018 23:53
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.

Deprecated XML-Module
1 participant