Last active
July 15, 2020 13:30
-
-
Save NullArray/9f4a6b0b2817d8be7aec88cad9ef80a6 to your computer and use it in GitHub Desktop.
Install a `pip3 freze` backup package text file without interruption.
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
#!/usr/bin/env python3 | |
#____ ____ __ | |
#\ \ / /____ _____/ |_ ___________ | |
# \ Y // __ \_/ ___\ __\/ _ \_ __ \ | |
# \ /\ ___/\ \___| | ( <_> ) | \/ | |
# \___/ \___ >\___ >__| \____/|__| | |
# \/ \/ | |
#--Licensed under GNU GPL 3 | |
#----Authored by Vector/NullArray | |
############################################## | |
import os | |
def main(location): | |
strarray = [] | |
if not os.path.isfile(location): | |
print("Could not find file") | |
else: | |
with open(location, 'r') as infile: | |
for str in infile: | |
strarray.append(str) | |
for line in strarray: | |
x = "pip3 install " + line | |
try: | |
os.system(x) | |
except: | |
pass | |
finally: | |
continue | |
if __name__ == "__main__": | |
os.system('clear') | |
print("Install a 'pip3 freeze' backup package list without interruptions.") | |
print("Simply enter the location to your text file below.") | |
location = input("\nPath: ") | |
main(location) | |
print("\nDone!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment