Skip to content

Commit 28ea56a

Browse files
Add files via upload
1 parent 6138a2f commit 28ea56a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pipwizard.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import importlib
2+
import subprocess
3+
4+
def install_lib (pkg):
5+
try:
6+
importlib.import_module(pkg)
7+
print(f"{pkg} is already installed")
8+
except ImportError:
9+
subprocess.check_call(["pip", "install", pkg])
10+
print(f"{pkg} had been installed.")
11+
12+
install_lib("pyperclip")

0 commit comments

Comments
 (0)