Table of Contents
List of Illustrations
- Chapter 1
- Chapter 2
- Chapter 3
- Chapter 4
- Chapter 5
- Chapter 6
- Chapter 7
- Chapter 8
- Chapter 9
- Chapter 10
- Chapter 11
- Chapter 12
- APPENDIX
Guide
Pages
Visual Studio Code for Python Programmers
April Speight
Copyright 2021 by John Wiley & Sons, Inc. All rights reserved.
Published by John Wiley & Sons, Inc., Hoboken, New Jersey.
Published simultaneously in Canada.
ISBN: 978-1-119-77336-8
ISBN: 978-1-119-77338-2 (ebk)
ISBN: 978-1-119-77337-5 (ebk)
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 750-4470, or on the web at www.copyright.com
. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permission
.
Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose. No warranty may be created or extended by sales representatives or written sales materials. The advice and strategies contained herein may not be suitable for your situation. You should consult with a professional where appropriate. Neither the publisher nor author shall be liable for any loss of profit or any other commercial damages, including but not limited to special, incidental, consequential, or other damages.
For general information on our other products and services or for technical support, please contact our Customer Care Department within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic formats. For more information about Wiley products, visit our web site at www.wiley.com
.
Library of Congress Control Number: 2021937124
Trademarks: WILEY and the Wiley logo are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. Visual Studio is a registered trademark of Microsoft Corporation. Python is a registered trademark of Python Software Foundation. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book.
Cover image: JuSun / Getty Images
Cover design: Wiley
For Python developers in need of a home for their code.
And Ericyou were right. But with that aside, you're the most supportive partner an author could ever ask for in this thing we call life. We're two halves of a whole. My success is your success, and your success is my success.
About the Author
April Speight is a developer who specializes in Python and conversational design for chatbots and AI assistants. Her passion for learning and teaching Python led to her first published title, Bite-Size Python: An Introduction to Python Programming. She currently works on content creation and developer community engagement for Spatial Computing and Mixed Reality at Microsoft.
About the Technical Editor
Kraig Brockschmidt has worked on technical developer content for more than 30 years, publishing books, articles, sample code, and documentation for multiple programming languages and development platforms. He currently works on developer documentation at Microsoft, specializing in using Python on Microsoft's cloud computing platform, Azure. He also authored the original set of documentation for the Python extension for Visual Studio Code.
Acknowledgments
Many thanks to those who have spent time creating, contributing, and improving what I consider to be the optimal solution for a code editor. I would be completely remiss if I didn't personally thank Kraig Brockschmidt, my technical editor on this book; thanks again for your time and commitment.
Also, thanks goes to Rob for being an open ear throughout this entire process. Although I didn't understand what coding was in undergrad, the fact that you did it so often intrigued me. Because of you, I've discovered a new skillset that has evolved into where I am professionally in my career.
Introduction
What started as an announcement at Microsoft Build 2015 has evolved into the Most Popular Development Environment, as ranked in the 2019 Stack Overflow Developer Survey. Visual Studio Code is a free, open-source, cross-platform code editor developed by Microsoft as part of the Visual Studio family. In comparison to its Visual Studio counterpart, Visual Studio Code is a streamlined code editor for a quick code-build-debug cycle. This feature-rich editor includes support for code completion, refactoring, formatting, managing source code, collaboration, debugging, unit testing, and more.
This book introduces Visual Studio Code through the lens of a Python developer. Editor features are introduced and explored with examples applicable to Python development. The goal of this book is to help acclimate you to Visual Studio Code features and to help you develop an efficient development workflow.
Stay up-to-date with new Visual Studio Code and Python features by visiting the Microsoft Developer Blog at devblogs.microsoft.com/python
.
Who Will Benefit Most from This Book
Those who are in search of a comprehensive introduction to Visual Studio Code for Python development will benefit most from reading this book. It was written for developers with a working knowledge of Python. Although this book does not provide instruction for learning Python development, it includes general programming concepts, such as managing source control, unit testing, and debugging to name a few, which are explored as they relate to Visual Studio Code features. Python tools and libraries that fall outside of the Python Standard Library are also explored and provided with a foundational understanding to complete the exercises throughout this book.
Looking Ahead in This Book
Here's the book at a glance:
- : Getting Started introduces the Visual Studio Code interface and the Extension Marketplace. Instructions on how to customize the editor are provided, alongside keyboard shortcuts for quickly executing commands. The keyboard shortcuts are also provided, following the convention of iOS/Windows and Linux (e.g., Cmd+C/Ctrl+C is the shortcut to Copy).
Next page