Python Forum
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VS Code editor questions
#1
I have attempted to learn VS code studio in the past, but as soon as I had something that I needed to get done quickly, I reverted back to PyCharm.

I just re-installed VS Code editor, and vow not to revert back to PyCharm unless I become totally lost and frustrated.
Sooooo, I am looking for advice on which extensions I should load that you have found useful and/or necessary, and which ones to avoid.

I have the first load of the editor sitting in front of me with a long list of extensions, and not sure what I should (should not) install.
Reply
#2
python and Code Runner is the 2 most important to get all running.
My quick review a while back.
Some info in this post.
Reply
#3
Thanks snippsat,

I installed all of these and also ESLint (not sure I need it yet)
Looked at all of your posts.

It's difficult to change old habits, But i intend on doing so. The virtual environment interface on PyCharm is what led to this. The latest release has some very annoying issues with interpreter assignment for virtual environment projects. For example if you have two projects with the same name on two different drives (not a good idea, but it happens), it assumes that the interpreter should be the same for both. This wouldn't be so annoying if you were allowed to change to whatever you wish, but it won't allow changing without some non-intuitive hacks.

I am determined to change, and know that after a few days it will become natural.
Reply
#4
Can give a example with virtual environment and VS Code.
Many time i just start from cmder,then just code . to open this folder in VS Code.
code . i use often just to start VS code in current folder from command line.
# make 
G:\
λ python -m venv my_env

# cd in
G:\
λ cd my_env

# Activate
G:\my_env
λ G:\my_env\Scripts\Activate
(my_env) G:\my_env

# Start VS Code in this folder
(my_env) G:\my_env
λ code .
[Image: KcRNbf.jpg]
Reply
#5
I must have missed something on installation.
  • I changed directory to an existing virtual environment (created with older version of PyCharm)
  • Activated the environment (scripts\Activate.bat)
  • Typed: code . and got
    Output:
    (venv) λ code . 'code' is not recognized as an internal or external command, operable program or batch file.
Reply
#6
You will need to add Microsoft VS Code\bin folder where code.cmd are to environment variables Path.
Reply
#7
I tried several IDEs and hated VS Code the least. I thought PyCharm was trying to take over my machine (Windows 10, Python 3.6). I am a minimalist and the only thing I have installed in VS Code is Python. I don't use virtual environments.

I find VS Code to be slow to load, so I do most of my development using Notepad++ (even though VS Code intellisense is very good), and run Python and/or Pylint from .bat files which redirect stdout and stderr to a file, and then display the file contents when done.

I did change some VS Code configuration settings (there are more than 100 default settings): https://code.visualstudio.com/docs/getstarted/settings
Windows: File > Preferences > Settings
The following are VS Code Configuration settings and NOT Python code:
{"python.linting.enabled": false,
"python.linting.pylintEnable": false,
"git.ignoreMissingGitWarning": true,
"terminal.integrated.shell.windows": "C:\\WINDOWS\\Sysnative\\cmd.exe",
"window.zoomLevel": 0,
}
The first two lines disable pylint as I got annoying messages that were contrary to my personal configuration (pylintrc) file and pylint took extra time in VS Code.
The 'git' line disabled warning messages because I do not use 'git'.
The 'cmd.exe' line was becauses I used cmd.exe (Powershell is the Windows default)
The 'zoomLevel' message is a default value I left in (unknown reason).

I hope this helps.

Lewis
To paraphrase: 'Throw out your dead' code. https://www.youtube.com/watch?v=grbSQ6O6kbs Forward to 1:00
Reply
#8
(Jun-03-2018, 03:57 PM)ljmetzger Wrote: The first two lines disable pylint as I got annoying messages that were contrary to my personal configuration (pylintrc) file and pylint took extra time in VS Code.
Can also to this from command palette(Ctrl+Shift+p) then just type lint(python Enable linting),there will be and on and off choice.
I have it default off,then turn it on if want a check.
(Jun-03-2018, 03:57 PM)ljmetzger Wrote: The 'cmd.exe' line was becauses I used cmd.exe (Powershell is the Windows default)
We use cmder which i think is a lot better than Powershell.
ljmetzger Wrote:The 'zoomLevel' message is a default value I left in (unknown reason).
0 is default command palette type zoom,there is reset/in/out also show key which is Ctrl + Ctrl -.
Reply
#9
Next question: How to install package in virtual environment
Reply
#10
Cancel ... figured it out!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  VS-Code - Maximizing Horizontal Space For Editor adt 8 3,970 Oct-07-2019, 08:28 AM
Last Post: adt
  Looking for editor with drag & drop interface vs entering in individual lines of code yeto 1 1,920 Jul-17-2019, 05:24 PM
Last Post: Yoriz
  VS Code Editor snippsat 2 6,352 Aug-22-2017, 09:08 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020