Python: Terminal things for VScode

Posted on: 21 Jun 2023

Command pallete for vscode: The Command Palette in Visual Studio Code allows you to search for and execute various commands, including opening files, running tasks, installing extensions, and more, making it a versatile tool for controlling and navigating through the IDE. You can quickly access the Command Palette in Visual Studio Code by pressing Ctrl + Shift + P.

Open the Integrated Terminal: To open the integrated terminal in VS Code, press Ctrl + ` (backtick) on your keyboard. Alternatively, you can go to the menu and select View > Terminal.

Running Python Scripts: You can run Python scripts by navigating to the directory where your script is located in the terminal and then using the python command followed by the script name: python script.py

Starting an Interactive Python Session (Don’t do it): To start an interactive Python session (Python REPL), simply type python in the terminal: python This allows you to run Python commands interactively. To exit: exit()

Installing Packages with pip: You can use pip to install Python packages directly from the terminal:

pip install package_name

Replace package_name with the name of the package you want to install.

Running Jupyter Notebook: If you have Jupyter Notebook installed in your environment, you can launch it from the terminal: jupyter notebook

Clearing the Terminal: You can clear the terminal screen with the cls command