I am trying to make a program that will automatically close a web tab or the Web browser. :/
1 Answer
Depends on what you want but you can try to kill the process(assuming your running windows, here's a sample)
import os
os.system("taskkill /F /IM chrome.exe")
I have read that you maybe able to use browser.py or subproceses to do this also.
3 Comments
Lostsoul
Thats strange, can you try to kill it in task manager? is it chrome.exe or maybe its something else? Also play with the options /F and /IM. Basically launch the windows commandline and run taskkill /? and look at the options, you may have to tweak this a bit.
Lostsoul
Awesome, glad to hear! Welcome to site and feel free to ask any questions you are stumped with and don't forget to help others who are stumped with problems as well. Its a really great community.
webbrowserdocs.python.org/library/webbrowser.html, but if you have implemented it, just use Popen from subprocess.