Want to set up a python script that opens multiple seamless browsers at a time, a rookie.

set the number of browsers you want to enter, and open the relevant website

< hr >
import os
import time
opentime = input(":")
i = int(opentime)
def openLLQtime(i):
    
    if i <= 0:
        print("")
    else:
        while i > 0:
            os.system(r""C:\Users\PHJ\AppData\Roaming\360se6\Application\360se.exe --incognito" www.baidu.com")
            i = i - 1
            print(i)
            time.sleep(3)
    return

----------
import os
import time
opentime = input(":")
i = int(opentime)

while i > 0:
    os.system(r""C:\Users\PHJ\AppData\Roaming\360se6\Application\360se.exe --incognito" www.baidu.com")
    i = i - 1
    print(i)
    time.sleep(1)
< hr >

the indentation and syntax have been re-modified above, but there is still no browser opening.
if you test with the following code, you can open a browser automatically only when the currently open browser is deleted.

A novice on the road, please give me some advice

and why

os.system (r"C:UsersPHJAppDataRoaming360se6Application360se.exe-- incognito") * the number will not work, only one

will be opened.
Mar.20,2021

There is no PP in

python syntax-- this usage
is changed to I = iMui 1 try

in addition, the function variable name is not passed in, and opentime needs to be
def openLLQtime (opentime):

in the function parentheses.

not pass I, pass opentime

are there any calling functions in your py file that are similar to openLLQtime (opentime)


from selenium import webdriver
def open_browser():
    browser = webdriver.Chrome()
    browser.get('https://www.baidu.com/')
    browser.close()
times=5
for i in range(times):
    open_browser()

you can use selenium to solve this problem.
but look at your problem is to need os module to achieve, answer some partial questions, I do not know if it is the solution you need.

Menu