1"""
2example: install matplotlib + numpy
3open commandprompt(Win + R -> cmd)
4"""
5#fist of all make sure u have python installed
6py -3 --version
7
8#make the python project
9#code:
10import matplotlib.pyplot as plt
11import numpy as np
12
13x = np.linspace(0, 20, 100) # Create a list of evenly-spaced numbers over the range
14plt.plot(x, np.sin(x)) # Plot the sine of each x point
15plt.show() # Display the plot
16
17#press F5
18#You are going to get this error:"ModuleNotFoundError: No module named 'matplotlib'"
19#this means matplotlib is not installed yet
20#then press Ctrl + shift + ù this will open a command prompt for the porject.
21#type the following command and confirm you want to create a new virtual envirroment:
22
23py -3 -m venv .venv
24.venv\scripts\activate
25
26#select the new envirroment by pressing (Ctrl + shifft + p)
27#type "select interpreter" and select the ('.venv') interpreter
28#the last step is to run the following command in the cmd
29python -m pip install matplotlib
30
31when running the script (F5) it should work now
1import matplotlib.pyplot as plt
2import numpy as np
3
4x = np.linspace(0, 20, 100) # Create a list of evenly-spaced numbers over the range
5plt.plot(x, np.sin(x)) # Plot the sine of each x point
6plt.show() # Display the plot
1"python.linting.pylintArgs": [
2 "--init-hook",
3 "import sys; sys.path.append('/path/to/Functions')"
4]
5
6# OR
7
8sys.path.append("/path/to/parent")
9
10# option 1
11from Functions import functions
12functions.copy()
13functions.delete()
14
15# option2
16from Functions.functions import copy, delete
17copy()
18delete()