Skip to content

Instantly share code, notes, and snippets.

@sevbo2003
Created December 2, 2022 20:03
Show Gist options
  • Save sevbo2003/caeb4534e386d6e1b3312d51c20b90c0 to your computer and use it in GitHub Desktop.
Save sevbo2003/caeb4534e386d6e1b3312d51c20b90c0 to your computer and use it in GitHub Desktop.
The simple script to remove all version from `requirements.txt`
with open("requirements.txt") as myFile:
pkgs = myFile.read()
pkgs = pkgs.splitlines()
with open("result.txt", "w") as result:
for pkg in pkgs:
pkg = pkg.split('==')[0]
result.write(pkg + "\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment