Created
December 2, 2022 20:03
-
-
Save sevbo2003/caeb4534e386d6e1b3312d51c20b90c0 to your computer and use it in GitHub Desktop.
The simple script to remove all version from `requirements.txt`
This file contains hidden or 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
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