A Few Thoughts & Personal Quirks

First, an apology. I appreciate you likely don’t want to take 2 or more weeks to get your system set up. My initial and planned posting schedule is one post per week, every Monday. I don’t want to put so much content in a single post that I get confused or forget something potentially relevant. So, sorry for putting you on the slow train. That said, for the next few posts, I will be posting twice a week — Monday and Thursday.

Time to get things set up. I am going to assume you are using a Win 10 pc with a 64 bit processor. I will start by installing VS Code. If you are using a different editor/IDE I will leave that installation up to you. Then Miniconda, Git and Jupyter Notebooks. Though for you the latter might be optional.

In one of the following posts, I will set up a virtual environment for a test project. Then configure a VS Code project to use that environment. Simple enough but something we should be happy doing on a regular basis.

Drive Partitions

I have never been a big fan of “one large hard drive” on my PCs. I like to use partitions designated for specific uses. I find this makes backups (you do back up regularly?) a bit easier to manage. Whether I am doing a simple file backup to an external drive, or a full image backup of a given partition. So for my purposes I have a Dev partition (currently E:) into which I install most of my software (assuming it let’s me). I try to keep most of that sofware out of the main windows partition (C:). The Dev partition is on a SSD drive.

I also have a development partition, Dev2 (currently R:), specifically for project folders, e-books, personal scripts (e.g. backups) and the like. So, the programs are installed on E: and my code is all saved in project or book related folders on R:. This partition is on an HHD drive.

Well, the notebook folders all go into a main notebooks folder. That way when I start the Jupyter Notebook server, I can see all the available notebooks I have completed or am working on.

VS Code

Download the VS Code installer (https://code.visualstudio.com/download). Version 1.42 as I write this.

I am going with the ‘system installer’, just my preference. But, Microsoft recommends the ‘user installer’. There do appear to be some differences, but…

And, I am going to install VS Code in E:\appDev\vscode (I have already created that directory).

  • Double click the installer.
  • Read and accept the License Agreement.
  • Enter the installation location if you wish to use one different from the default. Or as I had already created the directory, I clicked “Browse…” and selected it. Then deleted the extra stuff the installer added, “\Microsoft VS Code”. Leaving “E:\appDev\vscode”. Click yes when it asks about installing in existing folder.
  • Click “Next >” when asked about the shortcut. I didn’t add a desktop icon, and only left the “Add to Path” item checked. Click “Next >” and then “Install”.
  • I left the “Launch Visual Studio Code” checked and clicked “Finish”,

VS Code Python Extension and Configuration

I am now going to install the Python language extension so that VS Code helps with auto-complete, linting, etc. Once VS Code window is open, click on the extensions icon (4 boxes bottom of icon list on left of screen). In the search box, enter ‘python’. Select the Microsoft Python extension at the top of the list. Click ‘Install’.

Now, Python uses indentation to identify blocks of code. Many other languages use brackets of one sort or another. But, the general default for Python is 4 space tabs. I think that just uses too much space. I prefer 2 spaces for my tabs. And, I don’t really want tabs left in the code files. So, I also want the tabs automatically converted to spaces. Your mileage may vary.

Select “File > Preferences > Settings”. Stay in the “Commonly Used” section. Scroll down to “Editor: Tab Size” and change the value to 2. Next scroll down to “Editor: Insert Spaces” and make sure it is checked. In the “Text Editor” section find “Editor: Detect Indentation” and make sure it is not checked. The changes are automatically saved as the items are edited/changed. Under “Open Editors”, close “Settings” by clicking on the “X”

That’s it for now. Though I may look at setting the above values on a language by language basis in future. So exit VS Code.

Start Menu Icon for VS Code

Finally, just so I can open VS Code easily, I click the Start button, scrolled to down to VS Code, opened the menu folder, right clicked on VS Code application and selected “Pin to Start”. Then I moved the icon to where I wanted it in the Start Menu.

You, know I think that’s enough for one post. Use the time until the next post to play with VS Code. Auto-completion might be one of the features you want to look into. See resources below.

Resources

Setup covered in one article, but they use python environments rather than conda. However, there are lots of pictures.

VS Code