PowerShell Guide to Python
PowerShell Guide to Python
A Comparative Approach to Learn two Scripting Languages at once. Fast!
About the Book
This PowerShell Scripting guide to Python is designed to make readers familiar with syntax, semantics and core concepts of Python language, in an approach that readers can totally relate with the concepts of PowerShell already in their arsenal, to learn Python fast and effectively, such that it sticks with readers for longer time.
"Use what you know to learn what you don't. " also known as Associative learning.
Book follows a comparative method to jump start readers journey in Python, but who is the target audience? and who should read this book -
- Any System Administrator who want to step into Development or Programming roles, and even if you don't want to be a developer, knowledge of another scripting language will make your skill set more robust.
- Python Developers who want to learn PowerShell scripting and understand its ease of user and importance to manage any platform.
- This book works both ways: As a reader you can use the book to learn Python if you know PowerShell, or learn PowerShell if you know Python. PowerShell and Python code samples and screenshots next to each other makes it very easy for readers to relate the common concepts and practices and learn the scripting language in no time.
Python is one of the top programming languages and in fast changing IT scenarios to DevOps and Cloud to the future - Data Science, Artificial Intelligence (AI) and Machine Learning Python is a must know.
But this PowerShell Scripting guide to Python would be very helpful for you if you already have some knowledge of PowerShell
NOTE! This is a Leanpub "Agile-published" book. That means the book is currently unfinished and in-progress. As I continue to complete the chapters, we will re-publish the book with the new and updated content. Readers will receive an email once a new version is published!
Team Package of 5 Books
25% discount on each copy
Team Package of 10 Books
30% discount on each copy
Good approach to grow-up your knowledge in Python very quickly
Learning Python becomes simple with this book when you come from the PowerShell world. Prateek has really done an awesome work of consolidating into one book what will take you several months to acquire this knowledge by yourself. What I like in this book is this approach to learn a new language from a language you know well. A really a good way to grow-up your knowledge in Python very quickly without too many difficulties.
Made for SysAmins who want to learn Python
As a regular SysAdmin with some basic PowerShell knowledge who want's to switch to DevOps, this book is building on whatever I already know to help me learn Python.
PowerShell as a segue to Python
As a programmer, I wanted to learn python, but since I am already working on Powershell. So this book was suggested to me which can help me learning python through Powershell. I started reading the book and from the 1st day itself, I found it so interesting, short crisp and simple way to learn something new. I must say this book not only helps in learning python but also pushed me to learn more things in PowerShell as well. Great book, recommended!
Learn 2 scripting languages at 2X speed
As an Infrastructure developer, you need multiple skills and this one is definitely helpful. Must read this book to upgrade your skills at 2x. Dear Prateek, Keep updating and upgrading us!
Thanks a lot for writing this amazing book that explains the concepts of two popular scripting language. Before reading this book, I was not sure to learn Python but now, not only I am aware of Python programming, also this book helped me to strengthen my basic concepts of PowerShell. If you know a bit about PowerShell and want to learn Python also then this is the right fit for you.
- 1 Introduction
2 About the Book
- 2.1 Why did I write this book
- 2.2 Who is the Target Audience
- 2.3 Prerequisites
- 2.4 Feedback
3 The Basics
- 3.1 Version
- 3.2 Case Sensitivity
- 3.3 Indentation
- 3.4 Comments
- 3.5 Variables
4 Console Input/Output
- 4.1 Printing to Console
- 4.2 Reading from Console
- 4.3 Reading from Console Securely
5 Creating your First Script
- 5.1 Saving Commands as a Script File
- 5.2 Running the Script File
6 Passing Command-Line Arguments
- 6.1 ‘sys.argv’ in Python
- 6.2 ‘$args’ Automatic Variable in PowerShell
- 6.3 ‘Params()’ in PowerShell
- 6.4 ‘argparse’ Module in Python
- 6.5 Parameter Help
7 Object Introspection
- 7.1 Class, Object, Property, and Method
- 7.2 ‘Get-Member’ cmdlet in PowerShell
- 7.3 ‘type()’ Method in Python
- 7.4 ‘dir()’ Method in Python
- 7.5 ‘inspect’ Module in Python
8 The Help System
- 8.1 Get-Help cmdlet in PowerShell
- 8.2 ‘help()’ Method in Python
- 8.3 Understanding How a Module Works
- 9.1 Modular Programming
- 9.2 Importing Modules
- 9.3 Installing Modules
- 9.4 Creating Modules
10 Data Types
- 10.1 Common Data types
- 10.2 Checking the Data Type
- 10.3 Data type casting
11 String Manipulations and Formatting
- 11.1 Common String Operations
- 11.2 String Formatting
- 11.3 Substring or String Slicing
- 11.4 Testing String Membership
- 11.5 Built-in methods
12 Date and Time
- 12.1 Get Date and Time
- 12.2 Convert String to datetime object
- 12.3 DateTime formatting
- 12.4 Time Span or Time Delta
13 File Handling
- 13.1 Reading from a File
- 13.2 File Modes
- 13.3 Create and write to a text File
- 13.4 Appending data to the File
14 Arrays, List, ArrayList and Tuples
- 14.1 Arrays
- 14.2 ArrayList (.Net)
- 14.3 Lists
- 14.4 Common PowerShell Array and Python Lists Operations
- 14.5 Tuples
- 14.6 Sets
15 Dictionary and Hashtable
- 15.1 Hash Table
- 15.2 Dictionary
16 Conditional Statements
- 16.1 If Statement
- 16.2 Else Statement
- 16.3 The elif and ifelse statement
- 16.4 Nested Conditional Statements
- 17.1 For Loop
- 17.2 ForEach and ForeEach-Object
- 17.3 While Loop
- 17.4 Loop Control Statements
- 17.5 Nested Loops
- 18.1 Types of Functions
- 18.2 Creating a Function
- 18.3 Calling a Function
- 18.4 Functions vs Methods
- 18.5 Parameters and Arguments
- 18.6 Mandatory and Default parameters
- 18.7 The Anonymous Functions
19 Handling XML and JSON Data
- 19.1 Difference between JSON and XML
- 19.2 Reading XML from a file
- 19.3 Accessing XML as Objects
- 19.4 Accessing XML with XPath
- 19.5 Using XML for Object Serialization
- 19.6 Parsing JSON
- 19.7 JSON Serialization and De-Serialization
20 Reading and Writing CSV Files
- 20.1 What is CSV
- 20.2 Reading CSV File
- 20.3 Writing CSV File
21 Error Handling
- 21.1 Types of Errors
- 21.2 Raising an Exception or Throwing an error
- 21.3 Handling Exceptions using Try..catch..finally
22 Built-In Functions
- 22.1 Basic Mathematical Operations
- 22.2 Selection and Arrangement
- 22.3 Union and Intersection
- 22.4 Dynamic Execution of Code
The Leanpub 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
C++ Best PracticesJason Turner
Level up your C++, get the tools working for you, eliminate common problems, and move on to more exciting things!
OpenIntro StatisticsDavid Diez, Christopher Barr, Mine Cetinkaya-Rundel, and OpenIntro
A complete foundation for Statistics, also serving as a foundation for Data Science.
Leanpub revenue supports OpenIntro (US-based nonprofit) so we can provide free desk copies to teachers interested in using OpenIntro Statistics in the classroom and expand the project to support free textbooks in other subjects.
More resources: openintro.org.
Functional Design and ArchitectureAlexander Granin
Software Design in Functional Programming, Design Patterns and Practices, Methodologies and Application Architectures. How to build real software in Haskell with less efforts and low risks. The first complete source of knowledge.
Atomic KotlinBruce Eckel and Svetlana Isakova
For both beginning and experienced programmers! From the author of the multi-award-winning Thinking in C++ and Thinking in Java together with a member of the Kotlin language team comes a book that breaks the concepts into small, easy-to-digest "atoms," along with exercises supported by hints and solutions directly inside IntelliJ IDEA!
C++20 is the next big C++ standard after C++11. As C++11 did it, C++20 changes the way we program modern C++. This change is, in particular, due to the big four of C++20: ranges, coroutines, concepts, and modules.
The book is almost daily updated. These incremental updates ease my interaction with the proofreaders.
Introductory Statistics with Randomization and SimulationMine Cetinkaya-Rundel, Christopher Barr, OpenIntro, and David Diez
A complete foundation for Statistics, also serving as a foundation for Data Science, that introduces inference using randomization and simulation while covering traditional methods.
Leanpub revenue supports OpenIntro, so we can provide free desk copies to teachers interested in using our books in the classroom.
More resources: openintro.org.
Java OOP Done RightAlan Mellor
Object Oriented Programming is still a great way to create clean, maintainable code. But only if you use it right.
This book gives you 25 years of OO best practice, ready to use.
You'll learn to design objects behaviour-first, use TDD to help, then confidently apply Design Patterns, SOLID principles and Refactoring to make clean, crafted code.
Ansible for DevOpsJeff Geerling
Ansible is a simple, but powerful, server and configuration management tool. Learn to use Ansible effectively, whether you manage one server—or thousands.
Composing SoftwareEric Elliott
All software design is composition: the act of breaking complex problems down into smaller problems and composing those solutions. Most developers have a limited understanding of compositional techniques. It's time for that to change.
Cloud StrategyGregor Hohpe
“Strategy is the difference between making a wish and making it come true.” A successful migration to the cloud shouldn’t be driven by wishes, but guided by a sound strategy, frameworks, and decision models. This book tells you how—without becoming superficial nor getting lost in technology and product details.
Software Architecture for Developers: Volumes 1 & 2 - Technical leadership and communication
2 Books"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before...
CCIE Service Provider Ultimate Study Bundle
2 BooksPiotr Jablonski, Lukasz Bromirski, and Nick Russo have joined forces to deliver the only CCIE Service Provider training resource you'll ever need. This bundle contains a detailed and challenging collection of workbook labs, plus an extensively detailed technical reference guide. All of us have earned the CCIE Service Provider certification...
Cisco CCNA 200-301 Complet
4 BooksCe lot comprend les quatre volumes du guide préparation à l'examen de certification Cisco CCNA 200-301.
CCDE Practical Studies (All labs)
3 BooksCCDE lab
Modern Management Made Easy
3 BooksRead all three Modern Management Made Easy books. Learn to manage yourself, lead and serve others, and lead the organization.
The Future of Digital Health
6 BooksWe put together the most popular books from The Medical Futurist to provide a clear picture about the major trends shaping the future of medicine and healthcare. Digital health technologies, artificial intelligence, the future of 20 medical specialties, big pharma, data privacy and how technology giants such as Amazon or Google want to conquer...
Modern C++ by Nicolai Josuttis
Django for Beginners/APIs/Professionals
"The C++ Standard Library" and "Concurrency with Modern C++"
2 BooksGet my books "The C++ Standard Library" and "Concurrency with Modern C++" in a bundle. The first book gives you the details you should know about the C++ standard library; the second one dives deeper into concurrency with modern C++. In sum, you get more than 600 pages full of modern C++ and about 250 source files presenting the standard library...
Linux Administration Complet
4 BooksCe lot comprend les quatre volumes du Guide Linux Administration :Linux Administration, Volume 1, Administration fondamentale : Guide pratique de préparation aux examens de certification LPIC 1, Linux Essentials, RHCSA et LFCS. Administration fondamentale. Introduction à Linux. Le Shell. Traitement du texte. Arborescence de fichiers. Sécurité...