Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
[PY] Web Browser?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Sway" data-source="post: 223943" data-attributes="member: 1889"><p>Thanks.</p><p> </p><p><strong>UPDATE:</strong></p><p><strong>** </strong>Added the option to open in a new tab or in a new window (current window if availabe).</p><p> </p><p><strong>Source:</strong></p><p><a href="http://pastebin.com/DtbVDpKN" target="_blank">http://pastebin.com/DtbVDpKN</a></p><p> </p><p><strong>Snippet:</strong></p><p>[CODE]def main():</p><p> print()</p><p> print("Do not add 'http://'")</p><p> website = input("Website: ")</p><p> choice = input("Do you wish to open it in a new tab [NT] or seperate window [W]? ")</p><p> </p><p> if choice.lower() == 'w': </p><p> print("Opening website in new window...")</p><p> time.sleep(2)</p><p> </p><p> webbrowser.open_new("http://%s" % website) </p><p> startOver()</p><p> elif choice.lower() == 'nt':</p><p> print("Opening website in new tab...")</p><p> time.sleep(2)</p><p> </p><p> webbrowser.open_new_tab("http://%s" % website) </p><p> startOver()</p><p> else:</p><p> print("I didn't get that..")</p><p> startOver()[/CODE]</p></blockquote><p></p>
[QUOTE="Sway, post: 223943, member: 1889"] Thanks. [B]UPDATE:[/B] [B]** [/B]Added the option to open in a new tab or in a new window (current window if availabe). [B]Source:[/B] [URL]http://pastebin.com/DtbVDpKN[/URL] [B]Snippet:[/B] [CODE]def main(): print() print("Do not add 'http://'") website = input("Website: ") choice = input("Do you wish to open it in a new tab [NT] or seperate window [W]? ") if choice.lower() == 'w': print("Opening website in new window...") time.sleep(2) webbrowser.open_new("http://%s" % website) startOver() elif choice.lower() == 'nt': print("Opening website in new tab...") time.sleep(2) webbrowser.open_new_tab("http://%s" % website) startOver() else: print("I didn't get that..") startOver()[/CODE] [B][/B] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
[PY] Web Browser?
Top