Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cmd terminal
#1
So I have the simple program
that I made in Python tkinter

It opens up a cmd window and executes sfc /scannow

What I'm trying to figure out is if I click on the X at the top right corner
I get a ^C how do I prevent this, how do I close the window the proper way


I tried to put it in a try block with a keyboard interruption and that didn't seem to work
I tried several different ways to use kill but I am unclear on how it's supposed to work



def sfc_scannow():
    # sfc / scannow
    if not pyuac.isUserAdmin():
        statusbar.set('Access is denied, you are not an admin')
        root.after(5000, lambda: statusbar.set(''))
        # print('okM')  # for testing
    else:
        sfc_scannow_data()
        


def sfc_scannow_data():
    subprocess.Popen("start /wait sfc /scannow", shell=True)
Reply


Messages In This Thread
cmd terminal - by Raysz - Apr-11-2024, 07:28 PM
RE: cmd terminal - by deanhystad - Apr-11-2024, 08:42 PM
RE: cmd terminal - by Raysz - Apr-12-2024, 04:43 AM
RE: cmd terminal - by deanhystad - Apr-12-2024, 11:56 AM
RE: cmd terminal - by Raysz - Apr-12-2024, 04:11 PM
RE: cmd terminal - by Rice23 - Apr-22-2024, 04:30 AM
RE: cmd terminal - by Gribouillis - Apr-22-2024, 06:54 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020