selenium-selenium-webdriver - python adds the current directory to the environment variable
習慣沉默
習慣沉默 2017-06-22 11:52:22
0
1
1083

python gets the script execution directory and adds it to the environment variable,

Because there is a driver chromedriver.exe in the current directory,

You need to use after the python

script
dir_path = sys.path[0]

The current script execution directory already exists. How to add it to the environment variable later?

Is it executed using cmd of python?

python It’s my first time using it. I hope python can give me some guidance

習慣沉默
習慣沉默

reply all(1)
typecho

There are two methods,
The first is to use the sys.path.append() method to add the current directory to the directory list searched by the module, such as sys.path.append(dir_path)
The second is to The path of the current directory is added to the system’s PYTHONPATH environment variable.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template