Skip to content

Instantly share code, notes, and snippets.

@elconde
Created May 4, 2017 15:14
Show Gist options
  • Select an option

  • Save elconde/de36a81a7bbbabeb331b9d4e399a4669 to your computer and use it in GitHub Desktop.

Select an option

Save elconde/de36a81a7bbbabeb331b9d4e399a4669 to your computer and use it in GitHub Desktop.
import re
def uses_python_26(path):
"""Does this path need 2.6?"""
match = re.search('20[0-9][0-9]', path)
assert match, 'Could not figure out Python version'
return int(match.group(0)) < 2016
print uses_python_26(r'C:\Program Files\FRONT\FRONT ARENA\PRIME\2014.4')
print uses_python_26(r'C:\Program Files\FRONT\FRONT ARENA\PRIME\2016.4')
print uses_python_26(r'C:\Program Files\FRONT\FRONT ARENA\PRIME\2017.1')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment