Skip to content

Instantly share code, notes, and snippets.

@NullArray
Last active July 15, 2020 13:30
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 NullArray/9f4a6b0b2817d8be7aec88cad9ef80a6 to your computer and use it in GitHub Desktop.
Save NullArray/9f4a6b0b2817d8be7aec88cad9ef80a6 to your computer and use it in GitHub Desktop.
Install a `pip3 freze` backup package text file without interruption.
#!/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