Convenient Web-browser controller - webbrowser

웹브라우져가 자동으로 실행되게 해주는 모듈이다.

>>> import webbrowser 

>>> webbrowser.open("http://www.google.co.kr")

콘솔에서 :

python -m webbrowser -t "http://www.python.org"

webbrowser.open(url, new=0, autoraise=True)

웹브라우져 실행하고 URL로 이동

webbrowser.open_new(url)

이미 웹브라우져가 실행된 상태이면 해당 주소로 이동. 실행되지 않은 상태이면 새 브라우져가 실행

간단한 예제

url = 'http://www.python.org/'

# Open URL in a new tab, if a browser window is already open.
webbrowser.open_new_tab(url + 'doc/')

# Open URL in new window, raising the window if possible.
webbrowser.open_new(url)

results matching ""

    No results matching ""