2

I am trying to run Python from VS Code. I have already activated python through the terminal. However, in the terminal selector in the lower right of the screen, I cannot find Python terminal option there: enter image description here

I wish to ask how could I make Python terminal visible here so that the next time I wish to switch terminal to Python, I do not have to load a .py file but could just selecting Python terminal directly. Thank you.

0

4 Answers 4

2

Python terminals aren't really a thing. If you want to run a .py file, do $ python [filename].py or $ python3 [filename].py. If you want to just run commands, open a Python shell by doing $ python or $ python3

Sign up to request clarification or add additional context in comments.

1 Comment

fair, but I think the OP is asking if there is a way to simplify calling python automatically when using a new terminal? Similar to when using R (Radian) as an interactive terminal in vscode?
1

Open a new terminal and type "python -u". Hit the enter key. Bhoom! You're good to use Python shell in VS Code.

Python Shell in VS Code

Comments

1

Use ctrl+shift+p and type in "open user settings (json)" to open settings.json and search for "terminal.integrated.profiles.windows".

Add Python as a terminal entry (replace <user> with your user path):

   "terminal.integrated.profiles.windows": {
        "Git Bash": {
            "source": "Git Bash"
        },
        "Python3": {
            "path": "C:/Users/<user>/AppData/Local/Programs/Python/Python311/python.exe"
        }
    },

You will now be able to open a python shell from the terminal drop down:

image

Comments

0

There is no Python terminal. If you are asking about loading Python shell you just have to type python into your terminal to load the Python shell

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.