Jump to content

I would like to make a python program that automatically installs python packages, how do I get python to press enter inside of command prompt?

def pyautogui():
    subprocess.Popen("cmd")
    print('pip install pyautogui')
    keyboard.press('Enter')

#pyautogui
pyag = Button(root, text ="PyAutoGui", command=pyautogui)
pyag.grid()

This is the basic of what I got but for whatever reason the  keyboard module won't hit enter inside of command  prompt.

Link to post
Share on other sites

I'm using tkinter to make a menu and when I click on pyautogui, or any other python packages I put in their. it will install them by just clicking a button. So I need to make the user interface. So I'm still wondering how I get the interface to talk to command prompt.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×