Auto save on debug/run

Menu > File > Preferences > Task: Save Before Run In theory this should be all we need, but when set to ‘always’ it doesn’t work for running Python code. Hopefully this will get fixed sometime… Instead we have to do this for now: Files: Auto Save = onFocusChange Files: Auto Save Workplace Files Only […]

Read More

Using perf_counter

The perf_counter() function returns the float value of time in seconds. It uses a performance counter, i.e. a clock with the highest available resolution to measure a short duration. It includes time elapsed during sleep and is system-wide. The reference point of the returned value is undefined, so you must measure at the start and […]

Read More

Virtual environment in VS Code for Windows

Creating a virtual environment is good practice anyway for Python development in general, as it helps to manage dependencies and avoid conflicts. Create virtual environment Use the Command Palette (CTRL+SHIFT+P) to open a new terminal session with “Terminal: Create New Terminal”. Then create a new virtual environment by running the following commands in the terminal: […]

Read More