Mastering PyCharm
5/5
()
About this ebook
Related to Mastering PyCharm
Related ebooks
Python Tools for Visual Studio Rating: 0 out of 5 stars0 ratingsModular Programming with Python Rating: 0 out of 5 stars0 ratingsGetting Started with Python Data Analysis Rating: 0 out of 5 stars0 ratingsFlask Blueprints Rating: 0 out of 5 stars0 ratingsAdvanced Python Development: Using Powerful Language Features in Real-World Applications Rating: 0 out of 5 stars0 ratingsMastering Python Design Patterns Rating: 0 out of 5 stars0 ratingsPython for Secret Agents - Volume II Rating: 0 out of 5 stars0 ratingsEnterprise Automation with Python: Automate Excel, Web, Documents, Emails, and Various Workloads with Easy-to-code Python Scripts Rating: 0 out of 5 stars0 ratingsLearning Swift Rating: 5 out of 5 stars5/5Building Web Applications with Flask Rating: 0 out of 5 stars0 ratingsPython In - Depth: Use Python Programming Features, Techniques, and Modules to Solve Everyday Problems Rating: 0 out of 5 stars0 ratingsThe Ultimate Python Programming Guide For Beginner To Intermediate Rating: 5 out of 5 stars5/5Visual Studio Code for Python Programmers Rating: 0 out of 5 stars0 ratingsPython and SQLite Development Rating: 0 out of 5 stars0 ratingsNumPy: Beginner's Guide - Third Edition Rating: 4 out of 5 stars4/5Learning Flask Framework Rating: 4 out of 5 stars4/5Scientific Computing with Python 3 Rating: 0 out of 5 stars0 ratingsPython GUI Programming Cookbook - Second Edition Rating: 5 out of 5 stars5/5Python Business Intelligence Cookbook Rating: 0 out of 5 stars0 ratingsUseful Python Rating: 0 out of 5 stars0 ratingsNumPy Cookbook Rating: 5 out of 5 stars5/5Learning Python Application Development Rating: 0 out of 5 stars0 ratingsLearning Jupyter Rating: 5 out of 5 stars5/5Mastering Python Regular Expressions Rating: 5 out of 5 stars5/5matplotlib Plotting Cookbook Rating: 5 out of 5 stars5/5Artificial Intelligence Programming with Python: From Zero to Hero Rating: 0 out of 5 stars0 ratingsPython Web Scraping - Second Edition Rating: 5 out of 5 stars5/5
Programming For You
Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5C Programming For Beginners: The Simple Guide to Learning C Programming Language Fast! Rating: 5 out of 5 stars5/5Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Learn PowerShell in a Month of Lunches, Fourth Edition: Covers Windows, Linux, and macOS Rating: 5 out of 5 stars5/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Excel 101: A Beginner's & Intermediate's Guide for Mastering the Quintessence of Microsoft Excel (2010-2019 & 365) in no time! Rating: 0 out of 5 stars0 ratingsBeginning Programming with C++ For Dummies Rating: 4 out of 5 stars4/5Coding with JavaScript For Dummies Rating: 0 out of 5 stars0 ratingsNarrative Design for Indies: Getting Started Rating: 4 out of 5 stars4/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5SQL All-in-One For Dummies Rating: 3 out of 5 stars3/5C# 7.0 All-in-One For Dummies Rating: 0 out of 5 stars0 ratingsExcel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Python Data Structures and Algorithms Rating: 5 out of 5 stars5/5JavaScript All-in-One For Dummies Rating: 5 out of 5 stars5/5Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Python: Learn Python in 24 Hours Rating: 4 out of 5 stars4/5HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5C All-in-One Desk Reference For Dummies Rating: 5 out of 5 stars5/5Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5C Programming for Beginners: Your Guide to Easily Learn C Programming In 7 Days Rating: 4 out of 5 stars4/5
Reviews for Mastering PyCharm
1 rating0 reviews
Book preview
Mastering PyCharm - Islam Quazi Nafiul
Table of Contents
Mastering PyCharm
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Getting the Right Look
A short note on keyboard shortcuts
The basics
The first change – fonts
The layout
The minimalist
Beautiful code
Editor
Getting the right colors
Style hierarchies
Styling on steroids
Imports and exports
TextMate bundles
Summary
2. Understanding the Keymap
Different keymaps
Finding shortcuts
Setting shortcuts
Troubleshooting on Mac
Summary
3. Getting Places
Omni
Back and Forward
Macro
Go to definition or navigate to declaration
Search Everywhere
The Switcher tool
The Project panel
Micro
The Structure panel
Ace Jump
Summary
4. Editing
Improving code completion
Understanding what intentions can do for you
Collecting runtime types
Adding docstrings and type information
The skeletons in PyCharm's closet
Setting up IPython Notebook
Editor plugins
Writing code
Refactoring
Multiple cursors
doc_mode
Reading code
The lens mode
Diagrams
Method hierarchies
Summary
5. Interpreters and Consoles
All about interpreters
Adding interpreters
Creating virtualenvs
Through the terminal
Installing packages
Setting paths
Remote interpreters
Using Vagrant in PyCharm
The PyCharm console
Console configuration
Summary
6. Debugging
Running, debugging, and setting breakpoints
Debugging workflow
Dealing with threads and processes
Processes
Debugging from the console
Attach to Process…
Profiling
Summary
7. The PyCharm Ecosystem
The IntelliJ ecosystem
Support for PyCharm
YouTrack.JetBrains
What makes a good plugin?
Summary
8. File Templates and Snippets
File templates
Understanding variables
Making new templates
Snippets (live templates)
Surround templates
Summary
9. Version Control Integration
Initializing version control
Ignoring files
Remotes
The VCS menu
The Changes panel
Changing Diff colors
Change lists
Summary
10. HTML and JavaScript Tools
JavaScript support
Getting the most out of JavaScript code completion
Using JSDoc
Using libraries
Transpiled to JavaScript languages
Support for libraries and frameworks
Client-side frameworks
Server-side frameworks and NodeJS
JavaScript Code Quality Tools
HTML and CSS
Emmet
Live debugging
Installing the plugin
Debugging the file
File watchers
Summary
11. Web Development with PyCharm
Database tools
Adding a data source
Connecting to a database
Adding files
Using the SQL console
Parameterized statements
Console history
Database diagrams
Exporting data
Copying DDLs
Exporting the table contents
Web frameworks
Common features
Support for templating engines
Customized project creation
Debugging in templates
Django
Setting up Django
Model dependency diagrams
Manage.py tasks
Django Console
Summary
Index
Mastering PyCharm
Mastering PyCharm
Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: October 2015
Production reference: 1201015
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78355-131-6
www.packtpub.com
Credits
Author
Quazi Nafiul Islam
Reviewers
Frederic De Groef
Ivan Kleshnin
Acquisition Editor
Richard Brookes-Bland
Content Development Editor
Anand Singh
Technical Editor
Ankita Thakur
Copy Editor
Swati Priya
Project Coordinator
Paushali Desai
Proofreader
Safis Editing
Indexer
Monica Ajmera Mehta
Graphics
Disha Haria
Production Coordinator
Arvindkumar Gupta
Cover Work
Arvindkumar Gupta
About the Author
Quazi Nafiul Islam is a consultant and an occasional speaker, and has worked professionally with Python for 3 years while completing his bachelor's degree in computer science. He blogs regularly on his website, nafiulis.me.
He struggled to find the right tools that could aid his workflow when working on large Python projects until he was introduced to PyCharm. He loved it so much that he wrote a book on it, his very first one.
About the Reviewers
Frederic De Groef has an MSc in computer science from the Brussels University, Belgium. He previously worked as a researcher in an applied sciences laboratory at the same university. There, he worked on immersive 3D visualization systems and successfully campaigned for the use of Python as the favored tool by students, both as the research and introductory programming language.
He is currently working as a software engineer at SoftKinetic Systems, a subsidiary of Sony that develops time-of-flight sensors and cameras as well as computer vision libraries for gesture recognition, body tracking, and 3D scanning. For 2 years, his focus shifted towards engineering productivity, automation, quality assurance and validation, and API design. Nowadays, his daily work includes extensive use of Python for supporting research and development of machine learning methods, computer vision algorithms, and ToF cameras.
He can be reached at <f.degroef@gmail.com>.
Ivan Kleshnin is a self-employed web developer and consultant. He uses JetBrain's IDEs extensively for his everyday tasks. Ivan likes functional programming, LISP, math, interfaces, and everything in between. Nowadays, he develops rich web applications in JavaScript and Clojure for his commercial and personal projects. Besides programming and reading tech books, he enjoys traveling. He can be reached at <ivan@paqmind.com>.
www.PacktPub.com
Support files, eBooks, discount offers, and more
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Free access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.
To Mr. Jon Storer for teaching me the importance of context and being the best teacher I've ever had.
Preface
TLDR: So you want more PyCharm productivity, but don't want to read a book. I get that! So, just head over to the main menu, go over to Help and then Productivity Guide. If you want to get down to the best tools, read Chapter 4, Editing, Chapter 5, Interpreters and Consoles, and Chapter 6, Debugging. However, if you read this book, you'll get a lot more.
Welcome to Mastering PyCharm. If you've bought this book, then you probably want to become more effective with PyCharm in your day-to-day work. However, whether you can truly master a tool as multifaceted as PyCharm is completely up for debate since PyCharm changes so fast and so quickly. However, what I can promise you is that you will learn a great deal not only about how to use PyCharm, but how PyCharm works as part of the IntelliJ ecosystem of IDEs and what that means in terms of tooling and extensibility.
What this book covers
Chapter 1, Getting the Right Look, will help you make PyCharm look the exact way you want it to. So, whether you want too many buttons or too few or you want to change the theme or modify it more effectively, PyCharm will help you do all these.
Chapter 2, Understanding the Keymap, will help you map all the actions to their shortcuts and search for the actions using the action name or by invoking the shortcut. If that doesn't make sense, it means you've been missing out on something. This chapter also covers how to overcome known problems with keyboard shortcuts.
Chapter 3, Getting Places, covers a host of tools that PyCharm has. These tools will help you navigate everything from a really large file to huge codebases with loads of packages.
Chapter 4, Editing, will explain all the tools and help you learn more about writing error-free code quickly.
Chapter 5, Interpreters and Consoles, covers a lot of interpreters that Python has. PyCharm can support a whole host of them and provide code completion inside the console and much more. If you don't read this chapter, you're really going to miss out on some of the most powerful tools PyCharm has to offer.
Chapter 6, Debugging, being an iterative chapter, covers how to incorporate PyCharm's powerful debugger in to your debugging workflow. Buckle up; this one's going to get greasy.
Chapter 7, The PyCharm Ecosystem, answers PyCharm's existential questions. Who makes it? How does it work? How do you extend it? Where do plugins come from? Oh, and a lot more.
Chapter 8, File Templates and Snippets, covers the powerful set of snippets and file templates that PyCharm has. This will help you pump out code as fast as you can hit Tab. This chapter also