Previous article: A bulleted list of the contents of the Python tutorial (Chapter 9) (under construction)
Python3 Engineer Certification Basic Exam As a countermeasure, this is a personal memo that summarizes the contents of the Python tutorial (book) in easy-to-memorize bullet points.
Python Tutorial: https://docs.python.org/ja/3/tutorial/ Chapter 10: https://docs.python.org/ja/3/tutorial/stdlib.html Books: https://www.oreilly.co.jp/books/9784873117539/
--Python3 Engineer Certification Basic Exam Score ―― 4/40 questions (10.0%) ☆☆ ★★★ (Importance: Medium-) --Theme --Standard library
-** os module ** provides functions to interact with the OS. -* os.getcwd () * # Get the current directory -* os.chdir ('/ server / accesslogs') * # change current directory -* os.system ('mkdir today') * # Command execution in the shell on the system side -** shutil module ** provides functions to manage files and directories. -* shutil.copyfile ('data.db','archive.db') * #copy the file -* shutil.move ('/ build / executables','installdir') * #Move files / directories
-** glob module ** provides a function to wildcard directories and return a list of filenames. -* glob.glob ('\ *. Py') * # \ * .py Search for files
-The command line arguments are stored as a list in the ** argv attribute ** of the ** sys module . ---> For details, see ["2.1.1 Passing arguments"](https://qiita.com/Wakii/items/3a9efa210d2f602fa36e#211-%E5%BC%95%E6%95%B0%E3%82% See 92% E6% B8% A1% E3% 81% 99). - getopt module ** processes sys.argv like the UNIX getopt () function. - opts,args = getopt.getopt(args, shortopts, longopts=[]) -** argparse module ** provides powerful and flexible command line processing capabilities. - parser = argparse.ArgumentParser(description='Process some integers.') - args = parser.parse_args() - print(args.accumulate(args.integers))
--The sys module has the following attributes and methods in addition to argv. -** sys.stdin ** ... STDIN (standard input) file object -** sys.stdout ** ... STDOUT (standard output) file object -** sys.stderr ** ... STDERR (standard error output) file object -** sys.exit () ** ... Exit the script.
-** re module ** provides a regular expression tool for advanced string processing. --For simple operations such as replacement, the ** string method ** is easier to read and debug.
-** math module ** gives you access to lower C library functions for floating point math. -** random module ** is used to get random numbers. -** statistics module ** is used to calculate basic statistics (mean, median, variance, etc.) of numerical data.
--The following is an example of a module for Internet access. -** urllib.request module ** is used to get the data of the specified URL. -** The smtplib module is used to send ** mail.
-** datetime module ** is used for date and time calculation and output format manipulation.
--Modules that support data compression are provided for each compression format as follows. -** zlib module ** -** gzip module ** -** bz2 module ** -** lzma module ** -** zipfile module ** -** tarfile module **
-** timeit module ** provides timer (time measurement) function of Python code. -** profile module ** provides the following program statistics. ――How often were each part called? ――How long did it take to execute each part? -** The pstats module ** provides information to format and display program statistics. ――As an aside, note that there are two typos here (timetit, pstrats) in books.
-** doctest module ** provides a tool to scan the module and automatically validate the tests embedded in the docstring. -** unittest module ** provides a framework for unit testing like JUnit.
--Python has a philosophy of battery inclusion (Battery Included: ready to use). -** xmlrpc.client module ** and ** xmlrpc.server module ** allow easy implementation of remote procedure calls. -** email package ** is a library package that processes email messages. -** json package ** supports parsing (interpreting) JSON files. -** csv module ** supports direct read / write function of CSV file. --XML processing is supported by the following packages. -** xml.etree.ElementTree package ** -** xml.dom package ** -** xml.sax package ** -** sqlite3 module ** is a wrapper for SQLite database library, which provides a persistent database that can be updated and accessed with subtly non-standard SQL syntax. --Internationalization is supported by the following modules. -** gettext module ** -** locale module ** -** codecs package **
Next article: A bulleted list of the contents of the Python tutorial (Chapter 11) (under construction)
Recommended Posts