Created
February 18, 2021 08:03
-
-
Save ale-rt/76a9d44fcc411ca9ddef60315b37c39b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lxml import html | |
import requests | |
template = "https://distrowatch.com/search.php?pkg=Python&relation=greaterequal&pkgver={}&distrorange=InLatest#pkgsearch" | |
def get_distros(min_python_version): | |
response = requests.get(template.format(min_python_version)) | |
distros = set() | |
for el in html.fromstring(response.text).findall(".//b/a"): | |
if el.tail: | |
pos = int(el.tail.strip(" ()")) | |
if pos <= 100: | |
distros.add(f"{pos:3} {el.text}") | |
return distros | |
distro37 = get_distros("3.7") | |
distro38 = get_distros("3.8") | |
print("\n".join(sorted(distro37 - distro38))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment