Skip to content

Instantly share code, notes, and snippets.

@ale-rt
Created February 18, 2021 08:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ale-rt/76a9d44fcc411ca9ddef60315b37c39b to your computer and use it in GitHub Desktop.
Save ale-rt/76a9d44fcc411ca9ddef60315b37c39b to your computer and use it in GitHub Desktop.
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