VSCode
Markdown Preview Guide
We can write Markdown text, save the file name with .md, and then we preview the Markdown file in VSCode.
To switch between views, press Ctrl+Shift+V in the editor. Or, right-click on the editor Tab and select Open Preview.
You can view the preview side-by-side (Ctrl+K V) with the file you are editing and see changes reflected in real-time as you edit. Or, use the Command Palette (Ctrl+Shift+P) to run the Markdown: Open Preview to the Side command.
In the terminal of VSCode:
After having created an environment in Anaconda, created a local file in VSCode, and selected the environment for our project in VSCode (instructions in previous posts), we can now install Python libraries such as pandas and Jupyter notebook IDE for us to write our code in.
Installing a Python Library (e.g. pandas) in VSCode:
- Go to terminal and type: pip install pandas
- Enter to run code
- We can pip install other python libraries too, not just pandas.
Installing Jupyter Notebook in VSCode:
- Go to terminal and type: pip install jupyter
- Enter to run code
Create Jupyter Notebook in VSCode:
- Create new file by clicking the file icon on left. Name it in the format: filename.ipynb
To open Jupyter Notebook using VSCode:
- Go to terminal and type: python -m jupyter notebook
To stop running Jupyter Notebook using VSCode:
Ctrl+C
Using VSCode for GitHub
For projects:
When we are done editing our project in VSCode, we may wish to create a new branch and switch branch from main/master to that new branch.
After creating a new branch, we can go to GitHub and create a new pull request, obtain comments from whoever, before merging the changes to the main branch.
After merging to main branch, remember to switch branch to main in VSCode and git pull origin main to prevent conflicts of commit versions.
In the terminal of VSCode:
To create a new branch and switch to that new branch using VSCode:
git checkout -b new_branch_name
To switch branch back to main:
git checkout main