I have a simple Python code written in VS code to print an array:
import numpy as np # Importing the NumPy library
# Creating a 1D array
array_1d = np.array([1, 2, 3, 4, 5])
print("1D Array:",array_1d)
The output appears in Python terminal window as follows:
Now I am trying to extract this variable "array_1d" directly in terminal window (IDE shell), but I get an array as such:
How do I get this variable in the IDE shell of VS code?
Note: This problem does not happen with default IDLE shell of Python. How do I see this in VS code.
2
Answers
Python Interpreter and Windows/Linux Shell both use command line environments, but they serve different purposes
The windows/linux shell:
The python interpreter:
source: python
I do not know what you are trying to achieve but look up Jupiter notebook you can use it also on vscode follow this link
Try hitting shift + return after highlighting the code to
Run Selection/Line in Python REPL
or alternatively use the right click menu: