PowerShell Guide to Python
A Comparative Approach to Learn two Scripting Languages at once. Fast!
Learn core concepts of Python effectively and FAST! In a way that is relatable with the concepts of PowerShell you already know.
The book is designed in associative learning approach, so that concepts sticks with readers for longer time and they can jump-start their Python programming journey.
Buy early, pay less, free updates.
About
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!
While the book is in progress, please review it and send any feedback or error corrections at prateek@ridicurious.com and you can also tweet me your queries here . Thank you.
Packages
Pick Your Package
All packages include the ebook in the following formats: PDF, EPUB, and Web
The Book
Minimum price
Suggested price$25.00$20.00
Team Package of 5 Books
Minimum price
Suggested price$95.0025% discount on each copy
$75.00
This book is also available in the following packages:
Team Package of 10 Books
30% discount on each copy
- Minimum price
- $140.00
- Suggested price
- $180.00
Author
About the Author
Prateek Singh
Prateek Singh is an Infrastructure Developer, an avid PowerShell blogger, and a community contributor. In 2017 and 2018, FeedSpot and SQLHack recognized his blog RidiCurious.com as among the “Top 50 PowerShell blogs in the world.” Find his open-sourced at GitHub, and reach out to him on Twitter at @singhprateik.
Prateek has written more than 250 articles on his blog and several other websites such as 4SysOps.com, IPSwitch.com, and TechTarget.com and also runs a YouTube channel. He is a published author of 3 books and contributing author of 2 Book and currently writing the 6th one, following is the complete list:
Contents
Table of Contents
1Introduction
2About the Book
- 2.1Why did I write this book
- 2.2Who is the Target Audience
- 2.3Prerequisites
- 2.4Feedback
3The Basics
- 3.1Version
- 3.2Case Sensitivity
- 3.3Indentation
- 3.4Comments
- 3.5Variables
- Key Pointers
- Reading Recommendations
4Console Input/Output
- 4.1Printing to Console
- 4.2Reading from Console
- 4.3Reading from Console Securely
- Key Pointers
- Reading Recommendations
5Creating your First Script
- 5.1Saving Commands as a Script File
- 5.2Running the Script File
- Key Pointers
- Reading Recommendations
6Passing 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.5Parameter Help
- Key Pointers
- Reading Recommendations
7Object Introspection
- 7.1Class, 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
- Key Pointers
- Reading Recommendations
8The Help System
- 8.1Get-Help cmdlet in PowerShell
- 8.2‘help()’ Method in Python
- 8.3Understanding How a Module Works
9Modules
- 9.1Modular Programming
- 9.2Importing Modules
- 9.3Installing Modules
- 9.4Creating Modules
10Data Types
- 10.1Common Data types
- 10.2Checking the Data Type
- 10.3Data type casting
11String Manipulations and Formatting
- 11.1Common String Operations
- 11.2String Formatting
- 11.3Substring or String Slicing
- 11.4Testing String Membership
- 11.5Built-in methods
12Date and Time
- 12.1Get Date and Time
- 12.2Convert String to datetime object
- 12.3DateTime formatting
- 12.4Time Span or Time Delta
13File Handling
- 13.1Reading from a File
- 13.2File Modes
- 13.3Create and write to a text File
- 13.4Appending data to the File
14Arrays, List, ArrayList and Tuples
- 14.1Arrays
- 14.2ArrayList (.Net)
- 14.3Lists
- 14.4Common PowerShell Array and Python Lists Operations
- 14.5Tuples
- 14.6Sets
15Dictionary and Hashtable
- 15.1Hash Table
- 15.2Dictionary
16Conditional Statements
- 16.1If Statement
- 16.2Else Statement
- 16.3The elif and ifelse statement
- 16.4Nested Conditional Statements
17Loops
- 17.1For Loop
- 17.2ForEach and ForeEach-Object
- 17.3While Loop
- 17.4Loop Control Statements
- 17.5Nested Loops
18Functions
- 18.1Types of Functions
- 18.2Creating a Function
- 18.3Calling a Function
- 18.4Functions vs Methods
- 18.5Parameters and Arguments
- 18.6Mandatory and Default parameters
- 18.7The Anonymous Functions
19Handling XML and JSON Data
- 19.1Difference between JSON and XML
- 19.2Reading XML from a file
- 19.3Accessing XML as Objects
- 19.4Accessing XML with XPath
- 19.5Using XML for Object Serialization
- 19.6Parsing JSON
- 19.7JSON Serialization and De-Serialization
20Reading and Writing CSV Files
- 20.1What is CSV
- 20.2Reading CSV File
- 20.3Writing CSV File
21Error Handling
- 21.1Types of Errors
- 21.2Raising an Exception or Throwing an error
- 21.3Handling Exceptions using Try..catch..finally
22Built-In Functions
- 22.1Basic Mathematical Operations
- 22.2Selection and Arrangement
- 22.3Union and Intersection
- 22.4Dynamic Execution of Code
Get the free sample chapters
Click the buttons to get the free sample in PDF or EPUB, or read the sample online here
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.
Learn more about writing on Leanpub
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) and EPUB (for phones, tablets and 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.
Learn more about Leanpub's ebook formats and where to read them
Write and Publish on Leanpub
You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!
Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.
Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.