Write a python program to open a website using python

Write a python program to open a website using python

Program
import webbrowser
def myfun():
    url = "https://www.sateeshm.com/"
    open_web = webbrowser.open(url)
    print(open_web)
                 
if __name__=="__main__":
    myfun()


Output:


Program
You can also specify if you want to open a new tab in a browser or a new browser window. See the code below:
import webbrowser
def myfun():
    url = "https://www.sateeshm.com/"
    # This opens a new tab in your browser
    webbrowser.open_new_tab(url)

    # This opens a new browser window
    webbrowser.open_new(url)
                 
if __name__=="__main__":
    myfun()


Output:



More Questions


46 . Write a python program to open a website using python
47 . Write a python program to print most frequent letter in a string
48 . Write a python program to check memory sizes of list ,set ,tuple
49 . How do you confirm if an object is iterable using code?
50 . Write a python program to sort list with sorted & lambda
51 . Write a python program to access news using python
52 . Write a python program to print lowercase names
53 . Write a python program to Find Index Using Enumerate
54 . Write a python program to checking if a string is empty or not ?
55 . Write a python program to merge nested lists ?
56 . Write a python program to Checking if a File Exists or Not ?



For latest job updates join Telegram Channel: https://t.me/sateeshm