how do i import a python into visual studio code code example
Example 1: how download library python vscode
"""
example: install matplotlib + numpy
open commandprompt(Win + R -> cmd)
"""
py -3 --version
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 20, 100)
plt.plot(x, np.sin(x))
plt.show()
py -3 -m venv .venv
.venv\scripts\activate
python -m pip install matplotlib
when running the script (F5) it should work now
Example 2: visual studio code import library python
"python.linting.pylintArgs": [
"--init-hook",
"import sys; sys.path.append('/path/to/Functions')"
]
sys.path.append("/path/to/parent")
from Functions import functions
functions.copy()
functions.delete()
from Functions.functions import copy, delete
copy()
delete()