Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Python Tools for Visual Studio

You're reading from   Python Tools for Visual Studio Leverage the power of the Visual Studio IDE to develop better and more efficient Python projects.

Arrow left icon
Product type Paperback
Published in Apr 2014
Publisher
ISBN-13 9781783288687
Length 122 pages
Edition Edition
Languages
Arrow right icon
Toc

Using REPL in Visual Studio


In this section, we will explore the usage of the standard read–eval–print loop (REPL) tool for Python inside Visual Studio. As mentioned in the introduction, PTVS has an enhanced version of REPL. Besides the standard Python commands in the REPL version of PTVS—the Interactive Python window—there are some added commands and functionalities that can help speed up the debugging process and also enable simple testing of your code.

The enhanced commands are shown by typing $help in REPL, as shown in the following screenshot:

We'll go into detail on the most used and interesting commands. The $cls command cleans up the command line, while the $reset command cleans up the engine in a way that you can restart with a clean REPL environment.

The most interesting functions are $load and $mod. The $load command permits you to execute the content of a given Python file inside REPL:

An example of the $load function in the REPL tool

These functions are useful as they provide an...

lock icon The rest of the chapter is locked
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Python Tools for Visual Studio
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon