0

I am currently working on a program that will back up my Skype and iTunes data. It works fine with my iTunes data, however, when I try to backup files from Skype I get loads of errors. These are caused from the program still being open.

I thought it would be a fun little project to try and find out how to force quit a program (and then re-open).

I have successfully learned how to OPEN Skype (with a simple statement,

import os
os.startfile(path) #this opens programs. I need to close. 

So I think to get my program to work, all I would need to do is close skype, run the backup process, then re-open it.

When I tried searching my question, I was only finding answers to close PYTHON scripts. I need to close something that is running in Windows.

1

1 Answer 1

1

I have found the answer.

import os
os.system("taskkill /im skype.exe") #/im means "ImageName"

taskkill is a command-line reference. "Ends one or more tasks or processes. Processes can be killed by process ID or image name" http://technet.microsoft.com/en-us/library/bb491009.aspx

Thank you @furas for leading me to the page with the answer. I'm surprised I missed it, I tried searching for a while.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.