Python Forum
python keeps opening script directory
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python keeps opening script directory
#5
make it shorter, and i think webbrowser always uses the default browser

import webbrowser
import os

websitelist = "Setup1\\web_value.txt"
 
def websites():
    websites = open(websitelist).read().splitlines()
    for website in websites:
        webbrowser.open(website.strip())
        
websites()
Reply


Messages In This Thread
python keeps opening script directory - by Tyrel - Jul-27-2021, 06:47 PM
RE: python keeps opening script directory - by Axel_Erfurt - Aug-06-2021, 09:38 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,375 Jun-29-2023, 11:57 AM
Last Post: gologica
  Running script with subprocess in another directory paul18fr 1 3,897 Jan-20-2023, 02:33 PM
Last Post: paul18fr
  Why is IDLE not opening on a MacOS Montery 12.6 and using Python 3.10.7? Merlin385 7 1,767 Oct-08-2022, 08:36 PM
Last Post: Merlin385
  Opening CMD from Python Oshadha 2 1,308 Jul-17-2022, 11:22 PM
Last Post: Skaperen
Question Opening small size browser with python selenium not work, need help greenpine 0 1,641 Feb-07-2022, 11:36 AM
Last Post: greenpine
  Python OpenCV window not opening in fullscreen mode Zman350x 0 3,327 Apr-29-2021, 07:54 PM
Last Post: Zman350x
  problem with sphinx and file directory in script kiyoshi7 0 2,309 Mar-11-2021, 03:52 PM
Last Post: kiyoshi7
  How to kill a bash script running as root from a python script? jc_lafleur 4 5,970 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur
  Make the script read from any directory falahfakhri 2 2,197 Jun-15-2020, 02:18 PM
Last Post: falahfakhri
  crontab on RHEL7 not calling python script wrapped in shell script benthomson 1 2,326 May-28-2020, 05:27 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020