首頁 > 計(jì)算機(jī)網(wǎng)絡(luò) > 編程語言與程序設(shè)計(jì) > Mastering Python Scripting for System Administrators
舉報(bào)

會(huì)員
Mastering Python Scripting for System Administrators
PythonhasevolvedovertimeandextendeditsfeaturesinrelationtoeverypossibleIToperation.Pythonissimpletolearn,yethaspowerfullibrariesthatcanbeusedtobuildpowerfulPythonscriptsforsolvingreal-worldproblemsandautomatingadministrators'routineactivities.TheobjectiveofthisbookistowalkthroughaseriesofprojectsthatwillteachreadersPythonscriptingwitheachproject.ThisbookwillinitiallycoverPythoninstallationandquicklyrevisebasictoadvancedprogrammingfundamentals.Thebookwillthenfocusonthedevelopmentprocessasawhole,fromsetuptoplanningtobuildingdifferenttools.ItwillincludeITadministrators'routineactivities(textprocessing,regularexpressions,filearchiving,andencryption),networkadministration(socketprogramming,emailhandling,theremotecontrollingofdevicesusingtelnet/ssh,andprotocolssuchasSNMP/DHCP),buildinggraphicaluserinterface,workingwithwebsites(Apachelogfileprocessing,SOAPandRESTAPIscommunication,andwebscraping),anddatabaseadministration(MySQLandsimilardatabasedataadministration,dataanalytics,andreporting).Bytheendofthisbook,youwillbeabletousethelatestfeaturesofPythonandbeabletobuildpowerfultoolsthatwillsolvechallenging,real-worldtasks
最新章節(jié)
- Leave a review - let other readers know what you think
- Other Books You May Enjoy
- Chapter 18 MySQL and SQLite Database Administrations
- Chapter 17 Statistics Gathering and Reporting
- Chapter 16 Web Scraping – Extracting Useful Data from Websites
- Chapter 15 SOAP and REST API Communication
品牌:中圖公司
上架時(shí)間:2021-07-02 12:32:54
出版社:Packt Publishing
本書數(shù)字版權(quán)由中圖公司提供,并由其授權(quán)上海閱文信息技術(shù)有限公司制作發(fā)行
- Leave a review - let other readers know what you think 更新時(shí)間:2021-07-02 14:01:21
- Other Books You May Enjoy
- Chapter 18 MySQL and SQLite Database Administrations
- Chapter 17 Statistics Gathering and Reporting
- Chapter 16 Web Scraping – Extracting Useful Data from Websites
- Chapter 15 SOAP and REST API Communication
- Chapter 14 Working with Apache and Other Log Files
- Chapter 13 Building Graphical User Interfaces
- Chapter 12 Remote Monitoring of Hosts Over Telnet and SSH
- Chapter 11 Handling Emails Using Python Scripting
- Chapter 10 Basic Networking – Socket Programming
- Chapter 9 Working with Various Files
- Chapter 8 Documentation and Reporting
- Chapter 7 Text Processing and Regular Expressions
- Chapter 6 File Archiving Encrypting and Decrypting
- Chapter 5 Handling Files Directories and Data
- Chapter 4 Automating Regular Administrative Activities
- Chapter 3 Unit Testing – Introduction to the Unit Testing Framework
- Chapter 2 Debugging and Profiling Python Scripts
- Chapter 1 Python Scripting Overview
- Assessments
- Further reading
- Questions
- Summary
- Deleting the data
- Updating the data
- Retrieving the data
- Inserting the data
- Creating a table
- Connecting to the database
- SQLite database administration
- Deleting the data
- Updating the data
- Retrieving the data
- Creating a table and inserting data
- Getting a database version
- MySQL database administration
- MySQL and SQLite Database Administrations
- Further reading
- Questions
- Summary
- Contour plots
- Box plots
- Line scatter plots
- Scatter plots
- Plotly
- Bar charts
- Scatter plots
- Histograms
- Matplotlib
- Data visualization
- DataFrames
- Series
- Pandas module
- Universal array functions
- Indexing a 2D array
- Array indexing
- Using arrays and scalars
- NumPY module
- Statistics Gathering and Reporting
- Further reading
- Questions
- Summary
- Extracting information from Wikipedia
- The beautifulsoup library
- The requests library
- Data extraction
- What is web scraping?
- Web Scraping - Extracting Useful Data from Websites
- Further reading
- Questions
- Summary
- Working with JSON data
- Using standard libraries for RESTful APIs
- What is a RESTful API?
- Using libraries for SOAP
- What is SOAP?
- SOAP and REST API Communication
- Further reading
- Questions
- Summary
- Parsing other log files
- Common log format
- Access log
- Error log
- Tricks for parsing different files
- Analyzing exceptions
- The need for exceptions
- Parsing complex log files
- Working with Apache and Other Log Files
- Further reading
- Questions
- Summary
- Installing and using the Apache Log Viewer app
- Using a library to create a GUI-based application
- Introduction to GUI
- Building Graphical User Interfaces
- Further reading
- Questions
- Summary
- SSH using the Netmiko library
- SSH using the Paramiko library
- SSH using fabric module
- The subprocess.Popen() module
- SSH
- The telnetlib() module
- Remote Monitoring of Hosts Over Telnet and SSH
- Questions
- Summary
- Receiving email using the imaplib library
- Receiving email using the poplib library
- POP3 and IMAP servers
- Adding HTML and multimedia content
- Email message format
- Handling Emails Using Python Scripting
- Further reading
- Questions
- Summary
- Python urllib response headers
- The urllib package
- Sending commands to the server using the sendcmd() function
- Getting a welcome message using getwelcome():
- Downloading files
- The ftplib module
- The http.server module
- The http.client module
- The http package
- Sockets
- Basic Networking - Socket Programming
- Further reading
- Questions
- Summary
- Reading a text file
- Writing a text file
- The close() function
- File opening
- The open() function
- Working with txt files
- Writing into a CSV file
- Reading a CSV file
- Working with CSV files
- Reading multiple cells
- Appending values
- Creating a new Excel file
- Using openpyxl
- Reading specific columns in an Excel file
- Reading an Excel file
- Using pandas
- Extracting the names of columns
- Reading an Excel file
- Using the xlrd module
- Working with Excel files
- Rotating PDF pages
- Extracting text
- Reading a PDF document and getting the number of pages
- Working with PDF files
- Working with Various Files
- Further reading
- Questions
- Summary
- Sending email
- Information formatting
- Standard input and output
- Documentation and Reporting
- Further reading
- Questions
- Summary
- Avoiding UnicodeDecodeError
- Decoding
- Encoding
- Unicode code point
- Unicode strings
- The sub() function
- The findall() function
- The search() function
- The match() function
- Regular expressions
- The shorten() function
- The indent() function
- The dedent() function
- The fill() function
- The wrap() function
- Text wrapping
- Text Processing and Regular Expressions
- Further reading
- Questions
- Summary
- File encryption and decryption
- ZIP creation
- Tar archives
- Unpacking archives
- Creating archives
- Creating and unpacking archives
- File Archiving Encrypting and Decrypting
- Further reading
- Questions
- Summary
- Using a tarfile module to examine the contents of TAR files
- Using the tarfile module to create TAR archives
- Compressing and restoring
- Metadata: data about data
- Pattern matching files and directories
- Merging data
- Comparing data
- Working with paths
- Deleting data
- Renaming data
- Moving the data
- Copying the data
- Copying moving renaming and deleting data
- Renaming a directory
- Listing files and directories
- Changing the directory
- Get the working directory
- Using the os module to work with directories
- Handling Files Directories and Data
- Further reading
- Questions
- Summary
- Making backups (with rsync)
- Examining the content of a filesystem
- Creating and deleting the directory
- Using the os module for handling directory and files
- Launching webbrowser
- Putting limits on CPU and memory usage
- Generating warnings
- Adding logging and warning code to scripts
- Reading configuration files
- Prompting for passwords during runtime and validation
- Capturing output using the subprocess module
- Executing external commands and getting their output
- Handling passwords at runtime in scripts
- Input by input file
- Input by pipe
- Input by redirection
- Accepting input by redirection pipe and input files
- Automating Regular Administrative Activities
- Further reading
- Questions
- Summary
- Methods used in unit testing
- Creating unit tests
- What is unittest?
- Unit Testing - Introduction to the Unit Testing Framework
- Further reading
- Questions
- Summary
- Making programs run faster
- timeit
- The cProfile module
- Profiling and timing programs
- Debugging basic program crashes
- Within a Python script
- From a command line
- Within an interpreter
- The pdb debugger
- Debuggers tools
- Error handling (exception handling)
- Python debugging techniques
- What is debugging?
- Debugging and Profiling Python Scripts
- Further reading
- Questions
- Summary
- Importing modules
- Modules
- Lambda functions
- The return statement
- Functions
- How to create a generator in Python?
- Generators
- Iterators
- while loop
- The range() function
- for loop
- Loops
- Python if...elif...else statement
- Python if...else statement syntax
- Python if statement syntax
- Decision making
- Sys.argv
- Command-line arguments in Python
- Parsing command-line arguments
- Dictionaries
- Sets
- max() and min()
- Indexing slicing and matrices
- Basic tuple operations
- Deleting tuple elements
- Updating tuples
- Accessing values in tuples
- Tuples
- Indexing slicing and matrices
- List operations
- Basic list operations
- Deleting list elements
- Updating lists
- Accessing values in lists
- Understanding lists
- Strings are immutable
- Triple quotes in Python
- % string formatting operator
- Special string operators
- Escape characters
- Updating strings
- Accessing values in strings
- String slicing
- Concatenation (+) and repetition (*)
- Strings
- Number type conversion
- Numbers
- Creating and assigning values to variables
- Variables
- Indentation and tabs
- Using the quit() or exit() functions
- The keyboard shortcut
- Exiting the Python console
- Importing modules through the Python interpreter
- Multiple lines
- Writing scripts with the Python interactive console
- Starting the interactive console
- The difference between Python and Bash scripting
- Python interpreter
- Installing Geany and PyCharm
- Installing and using the virtual environment
- Installing Jupyter notebook
- Installation on Mac
- Installing and using pip to install packages
- Installation on the Windows platform
- Installation on the Linux platform
- Python installation
- Python syntax compared to other programming languages
- Why Python?
- Technical requirements
- Python Scripting Overview
- Reviews
- Get in touch
- Conventions used
- Download the example code files
- To get the most out of this book
- What this book covers
- Who this book is for
- Preface
- Packt is searching for authors like you
- About the reviewers
- About the author
- Contributors
- Packt.com
- Why subscribe?
- About Packt
- Dedication
- Mastering Python Scripting for System Administrators
- Copyright and Credits
- Title Page
- coverpage
- coverpage
- Title Page
- Copyright and Credits
- Mastering Python Scripting for System Administrators
- Dedication
- About Packt
- Why subscribe?
- Packt.com
- Contributors
- About the author
- About the reviewers
- Packt is searching for authors like you
- Preface
- Who this book is for
- What this book covers
- To get the most out of this book
- Download the example code files
- Conventions used
- Get in touch
- Reviews
- Python Scripting Overview
- Technical requirements
- Why Python?
- Python syntax compared to other programming languages
- Python installation
- Installation on the Linux platform
- Installation on the Windows platform
- Installing and using pip to install packages
- Installation on Mac
- Installing Jupyter notebook
- Installing and using the virtual environment
- Installing Geany and PyCharm
- Python interpreter
- The difference between Python and Bash scripting
- Starting the interactive console
- Writing scripts with the Python interactive console
- Multiple lines
- Importing modules through the Python interpreter
- Exiting the Python console
- The keyboard shortcut
- Using the quit() or exit() functions
- Indentation and tabs
- Variables
- Creating and assigning values to variables
- Numbers
- Number type conversion
- Strings
- Concatenation (+) and repetition (*)
- String slicing
- Accessing values in strings
- Updating strings
- Escape characters
- Special string operators
- % string formatting operator
- Triple quotes in Python
- Strings are immutable
- Understanding lists
- Accessing values in lists
- Updating lists
- Deleting list elements
- Basic list operations
- List operations
- Indexing slicing and matrices
- Tuples
- Accessing values in tuples
- Updating tuples
- Deleting tuple elements
- Basic tuple operations
- Indexing slicing and matrices
- max() and min()
- Sets
- Dictionaries
- Parsing command-line arguments
- Command-line arguments in Python
- Sys.argv
- Decision making
- Python if statement syntax
- Python if...else statement syntax
- Python if...elif...else statement
- Loops
- for loop
- The range() function
- while loop
- Iterators
- Generators
- How to create a generator in Python?
- Functions
- The return statement
- Lambda functions
- Modules
- Importing modules
- Summary
- Questions
- Further reading
- Debugging and Profiling Python Scripts
- What is debugging?
- Python debugging techniques
- Error handling (exception handling)
- Debuggers tools
- The pdb debugger
- Within an interpreter
- From a command line
- Within a Python script
- Debugging basic program crashes
- Profiling and timing programs
- The cProfile module
- timeit
- Making programs run faster
- Summary
- Questions
- Further reading
- Unit Testing - Introduction to the Unit Testing Framework
- What is unittest?
- Creating unit tests
- Methods used in unit testing
- Summary
- Questions
- Further reading
- Automating Regular Administrative Activities
- Accepting input by redirection pipe and input files
- Input by redirection
- Input by pipe
- Input by input file
- Handling passwords at runtime in scripts
- Executing external commands and getting their output
- Capturing output using the subprocess module
- Prompting for passwords during runtime and validation
- Reading configuration files
- Adding logging and warning code to scripts
- Generating warnings
- Putting limits on CPU and memory usage
- Launching webbrowser
- Using the os module for handling directory and files
- Creating and deleting the directory
- Examining the content of a filesystem
- Making backups (with rsync)
- Summary
- Questions
- Further reading
- Handling Files Directories and Data
- Using the os module to work with directories
- Get the working directory
- Changing the directory
- Listing files and directories
- Renaming a directory
- Copying moving renaming and deleting data
- Copying the data
- Moving the data
- Renaming data
- Deleting data
- Working with paths
- Comparing data
- Merging data
- Pattern matching files and directories
- Metadata: data about data
- Compressing and restoring
- Using the tarfile module to create TAR archives
- Using a tarfile module to examine the contents of TAR files
- Summary
- Questions
- Further reading
- File Archiving Encrypting and Decrypting
- Creating and unpacking archives
- Creating archives
- Unpacking archives
- Tar archives
- ZIP creation
- File encryption and decryption
- Summary
- Questions
- Further reading
- Text Processing and Regular Expressions
- Text wrapping
- The wrap() function
- The fill() function
- The dedent() function
- The indent() function
- The shorten() function
- Regular expressions
- The match() function
- The search() function
- The findall() function
- The sub() function
- Unicode strings
- Unicode code point
- Encoding
- Decoding
- Avoiding UnicodeDecodeError
- Summary
- Questions
- Further reading
- Documentation and Reporting
- Standard input and output
- Information formatting
- Sending email
- Summary
- Questions
- Further reading
- Working with Various Files
- Working with PDF files
- Reading a PDF document and getting the number of pages
- Extracting text
- Rotating PDF pages
- Working with Excel files
- Using the xlrd module
- Reading an Excel file
- Extracting the names of columns
- Using pandas
- Reading an Excel file
- Reading specific columns in an Excel file
- Using openpyxl
- Creating a new Excel file
- Appending values
- Reading multiple cells
- Working with CSV files
- Reading a CSV file
- Writing into a CSV file
- Working with txt files
- The open() function
- File opening
- The close() function
- Writing a text file
- Reading a text file
- Summary
- Questions
- Further reading
- Basic Networking - Socket Programming
- Sockets
- The http package
- The http.client module
- The http.server module
- The ftplib module
- Downloading files
- Getting a welcome message using getwelcome():
- Sending commands to the server using the sendcmd() function
- The urllib package
- Python urllib response headers
- Summary
- Questions
- Further reading
- Handling Emails Using Python Scripting
- Email message format
- Adding HTML and multimedia content
- POP3 and IMAP servers
- Receiving email using the poplib library
- Receiving email using the imaplib library
- Summary
- Questions
- Remote Monitoring of Hosts Over Telnet and SSH
- The telnetlib() module
- SSH
- The subprocess.Popen() module
- SSH using fabric module
- SSH using the Paramiko library
- SSH using the Netmiko library
- Summary
- Questions
- Further reading
- Building Graphical User Interfaces
- Introduction to GUI
- Using a library to create a GUI-based application
- Installing and using the Apache Log Viewer app
- Summary
- Questions
- Further reading
- Working with Apache and Other Log Files
- Parsing complex log files
- The need for exceptions
- Analyzing exceptions
- Tricks for parsing different files
- Error log
- Access log
- Common log format
- Parsing other log files
- Summary
- Questions
- Further reading
- SOAP and REST API Communication
- What is SOAP?
- Using libraries for SOAP
- What is a RESTful API?
- Using standard libraries for RESTful APIs
- Working with JSON data
- Summary
- Questions
- Further reading
- Web Scraping - Extracting Useful Data from Websites
- What is web scraping?
- Data extraction
- The requests library
- The beautifulsoup library
- Extracting information from Wikipedia
- Summary
- Questions
- Further reading
- Statistics Gathering and Reporting
- NumPY module
- Using arrays and scalars
- Array indexing
- Indexing a 2D array
- Universal array functions
- Pandas module
- Series
- DataFrames
- Data visualization
- Matplotlib
- Histograms
- Scatter plots
- Bar charts
- Plotly
- Scatter plots
- Line scatter plots
- Box plots
- Contour plots
- Summary
- Questions
- Further reading
- MySQL and SQLite Database Administrations
- MySQL database administration
- Getting a database version
- Creating a table and inserting data
- Retrieving the data
- Updating the data
- Deleting the data
- SQLite database administration
- Connecting to the database
- Creating a table
- Inserting the data
- Retrieving the data
- Updating the data
- Deleting the data
- Summary
- Questions
- Further reading
- Assessments
- Chapter 1 Python Scripting Overview
- Chapter 2 Debugging and Profiling Python Scripts
- Chapter 3 Unit Testing – Introduction to the Unit Testing Framework
- Chapter 4 Automating Regular Administrative Activities
- Chapter 5 Handling Files Directories and Data
- Chapter 6 File Archiving Encrypting and Decrypting
- Chapter 7 Text Processing and Regular Expressions
- Chapter 8 Documentation and Reporting
- Chapter 9 Working with Various Files
- Chapter 10 Basic Networking – Socket Programming
- Chapter 11 Handling Emails Using Python Scripting
- Chapter 12 Remote Monitoring of Hosts Over Telnet and SSH
- Chapter 13 Building Graphical User Interfaces
- Chapter 14 Working with Apache and Other Log Files
- Chapter 15 SOAP and REST API Communication
- Chapter 16 Web Scraping – Extracting Useful Data from Websites
- Chapter 17 Statistics Gathering and Reporting
- Chapter 18 MySQL and SQLite Database Administrations
- Other Books You May Enjoy
- Leave a review - let other readers know what you think 更新時(shí)間:2021-07-02 14:01:21