Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python insert path

import sys
from os.path import abspath, dirname

sys.path.insert(0, dirname(dirname(abspath(__file__))))

path1 = dirname(abspath(__file__))  # current folder
path2 = dirname(path1)  # parent folder

print(path1)
print(path2)
Comment

add python to path

To add Python to the Windows Path, follow these steps:

1. Start the Run box and enter sysdm.cpl
2. In the System Properties window go to the Advanced tab and 
   click the Environment Variables button
3. In the System variable window, find the Path variable and 
   click Edit
4. Position your cursor at the end of the Variable value line 
   and add the path to the python.exe file, preceeded with 
   the semicolon character (;)
Comment

how to add path to python in windows

Simply add this path to your PYTHONPATH environment variable. 
To do this, go to Control Panel / System / Advanced / Environment variable, 
and in the "User variables" sections, check if you already have PYTHONPATH. 
If yes, select it and click "Edit", if not, click "New" to add it.

Paths in PYTHONPATH should be separated with ";".
Comment

add python to path windows 10

Either manually change it by doing the steps for the answer by skilliboi.

Or you can reinstall python and when you do that, make sure to tick the box that says:
Add python to PATH (or something like that)
Comment

PREVIOUS NEXT
Code Example
Python :: raspberry pi python 
Python :: python iterate over tuple of lists 
Python :: python Cerberus 
Python :: get index of item in list 
Python :: map in python 
Python :: msg91 python 
Python :: matplotlib force scientific notation and define exponent 
Python :: subprocess the system cannot find the file specifie 
Python :: sort np list of string 
Python :: python make dict 
Python :: numpy replace all values with another 
Python :: Return array of odd rows and even columns from array using numpy 
Python :: python pip past 
Python :: add button to python gui file 
Python :: flatten list in python 
Python :: scapy get packet source ip address python 
Python :: selenium session id python 
Python :: python get substring 
Python :: how to store something in python 
Python :: make django admin page text box smaller 
Python :: python list sum 
Python :: python := 
Python :: skcikit learn decision tree 
Python :: bag of word scikit learn 
Python :: mid-point circle drawing 
Python :: print index in for loop python 
Python :: how to use custom activity in discord.py 
Python :: check command 
Python :: convert numpy array to HSV cv 
Python :: get all commands discord.py 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =