python_how-to_chapter_1

Python How-To - Chapter 1

Return to Python How-To Table of Contents, Python How-To, Python, Python Bibliography, Manning Python Series, Manning Data Science Series, Manning Books Purchased by Cloud Monk, Manning Bibliography, Cloud Monk's Book Purchases, Cloud Monk Library

“ (PyHow2 2023)

1 Developing a pragmatic learning strategy

This chapter covers

What being pragmatic means

What Python can do

When you should consider alternative languages

What you can expect to learn from this book

” (PyHow2 2023)

Python is an amazing programming language. Its open source, general-purpose, platform-independent nature has given it an enormous developer community, along with an incredible ecosystem that includes tens of thousands of freely available libraries for web development, machine learning (ML), data science, and many other domains. I hope that we share this belief: knowing how to code in Python is great, but knowing how to write truly efficient, secure, and maintainable applications gives you a tremendous advantage. This book will help you go from a Python beginner to confident programmer.” (PyHow2 2023)

“In the Python ecosystem, we use domain-specific Python tools, such as web frameworks and ML libraries, to complete various tasks in our jobs. The effective employment of these tools is nontrivial, as it requires considerable familiarity with essential Python skills, such as processing texts, dealing with structured data, creating control flows, and handling files. Python programmers can write different solutions to address the same tasks. Among these solutions, one is generally better than the others because it may be more concise, more readable, or more efficient, which we collectively term as Pythonic: an idiomatic coding style that all Python programmers strive to acquire. This book is about how to write Pythonic code to address programming tasks.” (PyHow2 2023)

Python is so well developed and has so many features to learn that it would be impossible or unwise to try to learn everything about it from this book. Instead, I'll take a pragmatic approach to defining what I'll teach in this book: the essential skills that you'll most likely use in your projects. Equally important, I'll frequently mention how to use these skills with the consideration]] of readability and maintainability so that you can form good coding habits, which I'll bet that you and your teammates will greatly appreciate.” (PyHow2 2023)

Note You'll see callouts like this one throughout the book. Many of them are devoted to tips regarding readability and maintainability. Don't miss them!

1.1 Aiming at becoming a pragmatic programmer

We code for purposes, such as building websites, training ML models, or analyzing data. Whatever our purposes are, we want to be pragmatic; we write code]] to solve real problems. Thus, before we learn to code from the beginning or advance our coding skills in the middle of our career, we should be clear about our intentions. But even if you're unsure of what you desire to achieve with Python at this stage, the good news is that core Python features are universal knowledge. After you grasp the core features, you can apply them to any domain-specific Python tools.

Aiming to become a pragmatic programmer means that you should focus on the techniques that are most useful. Mastering these skills is just the first milestone in your journey, however; the long-term game in coding is writing readable code that not only works, but also fosters maintainability.

1.1.1 Focusing on writing readable Python code

As a developer, I'm obsessed with readability. Writing code is like speaking a real-world language. When we speak a language, don't we want others to understand us? If your answer is yes, you probably agree with me that we want others to understand our code too. Whether our code's readers possess the necessary technical expertise]] to understand our code is out of our control. What we can control is how we write the code — how readable we make it. Consider some simple questions:

Are your variables named properly to indicate what they are? No one can appreciate your code if it's full of variables named var0, temp_var, or x, for example.

Do your functions have proper signatures to indicate what they do? People are lost if they see functions named do_data(data) or run_step1().

Do you organize your code consistently across files? People expect different files of the same type to use similar layouts. Do you place import statements at the top of your files, for example?

Is your project folder structured with specific files stored in the desired folders? When your project's scope grows, you should create separate folders for related files.

These example questions pertain to readability. We don't just ask them from time to time; instead, we ask these kinds of readability questions throughout our projects. The reason is simple: good practice makes perfect. Trained as a neuroscientist, I know exactly how the brain works when it comes to behavioral learning. By practicing readability through these self-checking questions, we're training our brain's neural circuits. In the long term, your brain will be trained to know what behaviors constitute good practice in coding, and you'll write readable and maintainable code without even thinking about it.

1.1.2 Considering maintainability even before you write any code

In rare cases, we write code]] for one-time]] use. When we write a script, we almost always succeed in convincing ourselves that we'll never use the script again; thus, we don't care about creating good variable names, laying out the code properly, or refactoring functions and data models, not to mention making sure that we leave no comments (or outdated ones). But how many times did it turn out that we had to use the same script the next week or even the following day? This has probably happened to most of us.

The previous paragraph describes a mini-scale maintainability problem. In this case, it affects only your own productivity in a short span of time. If you work in a team environment, however, problems introduced by individual contributors add up to large-scale maintainability problems. The team members fail to follow the same naming rules for variables, functions, and files. Countless incidents of commented-out code remain. Outdated comments are everywhere.

To address maintainability problems in a later stage of your own projects, you should build a good mindset when you're learning to code. Following are some questions that you might consider to help you develop a goodmaintainability” mindset for the long run:

Is your code free of outdated comments and commented-out code? If the answer is no, update or delete them! These situations are even worse than those without any comments because they may provide conflicting information.

Is there considerable duplication in the code? If the answer is yes, refactoring is probably warranted. A rule of thumb in coding is DRY (Don't Repeat Yourself). By removing duplicates, you'll deal with a single shared portion, which is less prone to bugs than changes in repeated parts.

Do you use version-control tools such as Git? If the answer is no, look at the extensions or plugins of your integrated development environment (IDE). For Python, common IDEs include PyCharm and Visual Studio Code. Many IDEs have integrated version-control tools that make it much easier to manage versions.

Being a pragmatic Python programmer requires this type of maintainability training. After all, almost all Python tools are open source and evolving rapidly. Thus, maintainability should be the cornerstone of any viable project. Throughout the book, where applicable, we'll touch base on how to implement maintainability practices in our daily Python coding. Please re[[member that readability is the key to sustained maintainability. When you focus on writing readable code, your codebase's maintainability improves consequentially.

1.2 What Python can do well or as well as other languages

Python owes its growing popularity to the characteristics of the language itself. Although none of these characteristics is unique to Python, when they were organically combined, Python was set to grow into a widely adopted language. The following list summarizes Python's key characteristics:

Cross-platformPython runs on common platforms, such as Windows, Linux, and MacOS. Thus, Python code is transferrable. Any code that you write on your own platform can run on other computers without any restrictions imposed by the differences between platforms.

Expressive and readablePython's syntax is simpler than that of many other languages. The expressive, readable coding style is widely adopted by Python programmers. You'll find that well-written Python code is enjoyable to read, just like well-written prose.

Fast for prototyping — Given its simple syntax, Python code is generally more concise than code written in other languages. Thus, it requires less work to produce a functional prototype in Python than in other languages.

Standalone — When you install Python on your computer, it becomes ready to use right after “unboxing.” The basic Python installation package consists of all essential libraries that you need to perform any routine coding work.

Open source, free, and extensible — Although Python works standalone, you can write and use your own packages. If others have published any packages you need, you can install them with a one-line command without worrying about license or subscription fees.

These key characteristics have attracted many programmers, forming a tremendous developer community. The open source nature of Python allows interested users to contribute to this language and its ecosystem in general. Table 1.1 summarizes some notable domains and their respective Python tools. This table isn't an exhaustive list, and you're encouraged to explore Python tools in the specialty domain of your own interest.

Table 1.1 Overview of domain-specific Python tools

Domain

Tool

Highlights

Web development

Flask

A micro web framework; good for building lightweight web apps; flexible extensibility for third-party functionalities

Web development

Django

A complete web framework; good for building database-driven web apps; highly scalable as an enterprise solution

FastAPI

A web framework for building application programming interfaces (APIs); data validation and data conversion; automatic generation of API web interfaces

Streamlit

A web framework for easy building of data-related apps; popular among data scientists and ML engineers

Data science

NumPy

Specialized for processing large, multidimensional arrays; high computational efficiency; integral to many other libraries

pandas

A versatile package for processing spreadsheet-like two-dimensional data; comprehensive data manipulations

statsmodels

A popular package for statistics, such as linear regression]], correlation, Bayesian modeling, and survival analysis

Matplotlib

An object-oriented paradigm for drawing histograms, scatter plots, pie charts, and other common figures with a variety of customizable settings

Seaborn

An easy-to-use visualization library for drawing attractive graphics; high-level APIs based on Matplotlib

Machine learning

Scikit-learn

A wide range of preprocessing tools for building ML models; implementation of common ML algorithms

TensorFlow

A framework with both high- and low-level APIs; Tensor board visualization tool; good for building complex neural networks

Keras

High-level APIs for building neural networks; easy to use; good for building low-performance models

PyTorch

A framework for building neural networks; more intuitive code styles than TensorFlow; good for building complex neural networks

FastAI

High-level APIs for building neural networks on top of PyTorch; easy to use

Frameworks, libraries, packages, and modules

When we discuss tools, we use several closely related terms, including frameworks, libraries, packages, and modules. Different languages may use some of these terms and have slightly different meanings. Here, I discuss the meanings of these terms that most Python programmers accept.

Frameworks have the largest scope. Frameworks provide a complete set of functionalities that are designed to perform a dedicated job at a high level, such as web development.

Libraries are building blocks of frameworks, consisting of packages. Libraries provide functionalities without users having to worry about the underlying packages.

Packages provide specific functionalities. More specifically, packages bundle modules, and each module consists of a set of closely related data structures and functions in a single file, such as a .py file.

1.3 What Python can't do or can't do well

Everything has limits, and so does Python. There are many things that Python can't do, or at least can't do well compared with alternative tools. Although some people are trying to push Python in such a way that we can use it for other purposes, at this stage, we should know its limits in two important areas:

Mobile applications — In this mobile age, we all have smartphones and use apps in almost every aspect of life, such as banking, online shopping, health, communications, and certainly gaming. Unfortunately, there have been no great Python frameworks for developing smartphone apps despite attempts such as Kivy and BeeWare. If you work in mobile development, you should consider mature alternatives such as Swift for iOS apps and Kotlin for Android apps. As a pragmatic programmer, you choose a language that leads to a product with the best user experience.

Low-level development — When it comes to developing software that interacts directly with hardware, Python isn't the best choice. Due to the interpreted nature of Python, the overall execution speed isn't fast enough for developing low-level software, such as device drivers, which require instant responsiveness. If you're interested in developing software at a low level, you should consider alternative languages that are better at interfacing with the hardware. C and C++ are good options for developing device drivers, for example.

1.4 What you'll learn in this book

We've talked a little bit about what it means to be a pragmatic programmer. Now let's talk about how you're going to get there. As you write programs, you'll inevitably run into new programming challenges. In this book, we've identified the programming techniques you'll need to take for the tasks you're most likely to encounter.

1.4.1 Focusing on domain-independent knowledge

All things are connected in some way directly or indirectly, and so is Python knowledge. To put this discussion]] in a context, consider figure 1.1. We can conceptualize Python features and its applications as three related entities.

Figure 1.1 The relationship between domain-independent and domain-specific Python knowledge. Domain-independent knowledge includes basic and advanced Python features, which are closely related. Together, they form the basis for domain-specific knowledge in distinct content domains.

The goal of learning Python for most of us is to apply Python to address problems in the domain where we work, which requires domain-specific Python knowledge, such as web development and data science. As a prerequisite for fulfilling your job, your knowledge base should encompass essential Python features — more specifically, domain-independent Python knowledge. Even when your job role switches or evolves, you can apply the essential Python knowledge to your new position.

In this book, you'll focus on gaining domain-independent Python knowledge. To facilitate the learning process, we can operationally define domain-independent Python knowledge as two building components: the basic and the advanced.

For the basics, we should know common data structures and their manipulations. We also need to know how to evaluate conditions to construct the if…elsestatement. When we perform repeated work, we can take advantage of for and while loops. To reuse blocks of code, we can refactor them into functions and classes. Mastering these basics is sufficient for writing useful Python code to perform your job tasks. If you know most of the basics, you're ready to learn the advanced skills.

The advanced skills enable you to write better code that's more efficient and that takes advantage of versatile Python features. Let's see a simple example to feel the versatility of Python. When we use a for loop to iterate a list object, we often need to show the position of each item beside the item itself, such as

prime_numbers = [2, 3, 5] # desired output: Prime Number

  1. 1: 2 Prime Number #2: 3 Prime Number #3: 5

If we use only the basic features, we may come up with the following solution. In the solution, we create a range object that allows retrieval of the 0-based index to produce the position information. For the output, we use string concatenation:

for num_i in range(len(prime_numbers)): num_pos = num_i + 1 num = prime_numbers[num_i] print(“Prime Number

  1. ” + str(num_pos) + “: ” + str(num))

However, after you read this book, you'll become a more experienced Python user and should be able to produce the following solution that is cleaner and more Pythonic:

for num_pos, num in enumerate(prime_numbers, start=1): print(f“Prime Number

  1. {num_pos}: {num}”)

The above solution involves three techniques: tuple unpacking to obtain num_pos and num (section 4.4), creating the enumerate object (section 5.3), and formatting the output using f-strings (section 2.1). I'm not going to expand the discussion]] of these techniques here since they'll be covered in their respective sections. Nevertheless, this example is simply showing you what this book is all about — how to use a variety of techniques to produce Pythonic solutions.

Besides these techniques, you'll learn and apply advanced function concepts, such as decorators and closures, for example. When you define classes, you'll know how to make them work together to minimize the code and reduce the potential for bugs. When your program is done, you'll know how to log and test your code to make it production-ready.

This book is all about synthesizing domain-independent Python knowledge. You'll not only learn pragmatic advanced features, but also basic Python features and fundamental computer programming concepts where applicable. The key term here is synthesizing, as discussed in section 1.4.2.

1.4.2 Solving problems through synthesis

A common dilemma that beginners run into is that they seem to know a variety of techniques, but don't know how and when to use them to solve problems. For each technique we discuss in this book, we'll show you how it works independently, and we'll also show you how it fits with other techniques. We hope that you'll start to see how all the different pieces can be composed into an infinite number of new programs.

As a fundamental note on learning and synthesizing various techniques, you should expect that learning to code isn't a linear path. After all, Python's technical features are closely interrelated. Although you'll focus on learning intermediate and advanced Python techniques, they can't be isolated completely from basic vs. Instead, you'll notice that I'll frequently make remarks on basic techniques or intentionally reiterate techniques that I've already covered.

1.4.3 Learning skills in context

As we mentioned earlier, this book focuses on learning skills that are built on domain-independent Python knowledge. Being domain-independent means that you can apply the skills covered in this book to any domain where you'd like to use Python. It's almost impossible to learn anything without an example, however. We'll show most techniques in this book by using an ongoing project to provide a consistent context within which to discuss specific skills. If you're familiar with a particular skill, you can skip to the section's Discussion]] part, in which I'll discuss some key aspects of the covered skills.

As a heads-up, the generic project is a task-management web app. In the application, you can manage tasks, including adding, editing, and removing tasks — everything that will be implemented with pure Python, such as data models, functions, classes, and anything else you can think of that an application may have. Moving forward, the important thing to note is that the goal is not to get a perfect, shiny application from this book. Instead, you want to learn all the essential Python techniques in the process of creating this web app so you can apply your domain-independent knowledge to projects in your own jobs.

Summary

“It's critical for you to build a pragmatic learning strategy. By focusing on learning the domain-independent features of Python, you'll get yourself ready for any Python-related job role.” (PyHow2 2023)

Python is a general-purpose, open source programming language that fosters a tremendous community of developers who make and share Python packages.” (PyHow2 2023)

Python is competitive in many domains, including web development, data science, and ML. Each domain has specific Python frameworks and packages that you can use.” (PyHow2 2023)

Python has its limitations. If you consider developing mobile apps or low-level device drivers, you should use Swift, Kotlin, Java, C, C++, Rust, or any other applicable language.” (PyHow2 2023)

“I make a distinction between domain-independent Python knowledge and domain-dependent Python knowledge. This book focuses on teaching domain-independent Python knowledge.” (PyHow2 2023)

Learning to code is not a linear path. Although you'll learn advanced features in this book, I'll frequently mention basic ones. Also, you'll encounter some difficult vs, which will create an upward spiral learning path.

The essential recipe for learning Python or any programming language is synthesizing individual technical skills to form a comprehensive skill set. Through the synthesis process, you'll learn the language in a pragmatic way, knowing what works for the problem that you're addressing.

“ (PyHow2 2023)

Fair Use Sources

Python Vocabulary List (Sorted by Popularity)

Python Programming Language, Python Interpreter, Python Standard Library, Python Virtual Environment, Python pip (Pip Installs Packages), Python List, Python Dictionary, Python String, Python Function, Python Class, Python Module, Python Package, Python Object, Python Tuple, Python Set, Python Import Statement, Python Exception, Python Decorator, Python Lambda Function, Python Generator, Python Iterable, Python Iterator, Python Comprehension, Python Built-in Function, Python Built-in Type, Python Keyword, Python Conditional Statement, Python Loop, Python For Loop, Python While Loop, Python If Statement, Python elif Statement, Python else Statement, Python Pass Statement, Python Break Statement, Python Continue Statement, Python None Object, Python True, Python False, Python Boolean, Python Integer, Python Float, Python Complex Number, Python Type Hint, Python Annotations, Python File Handling, Python Open Function, Python With Statement, Python Context Manager, Python Exception Handling, Python Try-Except Block, Python Finally Block, Python Raise Statement, Python Assertion, Python Module Search Path, Python sys Module, Python os Module, Python math Module, Python datetime Module, Python random Module, Python re Module (Regular Expressions), Python json Module, Python functools Module, Python itertools Module, Python collections Module, Python pathlib Module, Python subprocess Module, Python argparse Module, Python logging Module, Python unittest Module, Python doctest Module, Python pdb (Python Debugger), Python venv (Virtual Environment), Python PyPI (Python Package Index), Python setuptools, Python distutils, Python wheel, Python pyproject.toml, Python requirements.txt, Python setup.py, Python IDLE, Python REPL (Read-Eval-Print Loop), Python Shebang Line, Python Bytecode, Python Compilation, Python CPython Interpreter, Python PyPy Interpreter, Python Jython Interpreter, Python IronPython Interpreter, Python GIL (Global Interpreter Lock), Python Garbage Collection, Python Memory Management, Python Reference Counting, Python Weak Reference, Python C Extension, Python Extension Modules, Python WSGI (Web Server Gateway Interface), Python ASGI (Asynchronous Server Gateway Interface), Python Django Framework, Python Flask Framework, Python Pyramid Framework, Python Bottle Framework, Python Tornado Framework, Python FastAPI Framework, Python aiohttp Framework, Python Sanic Framework, Python Requests Library, Python urllib Module, Python urllib3 Library, Python BeautifulSoup (HTML Parser), Python lxml (XML Processing), Python Selenium Integration, Python Scrapy Framework, Python Gunicorn Server, Python uWSGI Server, Python mod_wsgi, Python Jinja2 Template, Python Mako Template, Python Chameleon Template, Python Asyncio Library, Python Coroutines, Python Await Statement, Python async/await Syntax, Python Async Generator, Python Event Loop, Python asyncio.gather, Python asyncio.run, Python subprocess.run, Python concurrent.futures, Python Threading Module, Python Multiprocessing Module, Python Queue Module, Python Lock, Python RLock, Python Semaphore, Python Event, Python Condition Variable, Python Barrier, Python Timer, Python Socket Module, Python select Module, Python ssl Module, Python ftplib, Python smtplib, Python imaplib, Python poplib, Python http.client, Python http.server, Python xmlrpc.client, Python xmlrpc.server, Python socketserver Module, Python codecs Module, Python hashlib Module, Python hmac Module, Python secrets Module, Python base64 Module, Python binascii Module, Python zlib Module, Python gzip Module, Python bz2 Module, Python lzma Module, Python tarfile Module, Python zipfile Module, Python shutil Module, Python glob Module, Python fnmatch Module, Python tempfile Module, Python time Module, Python threading.Thread, Python multiprocessing.Process, Python subprocess.Popen, Python logging.Logger, Python logging.Handler, Python logging.Formatter, Python logging.FileHandler, Python logging.StreamHandler, Python logging.config, Python warnings Module, Python traceback Module, Python atexit Module, Python signal Module, Python locale Module, Python getpass Module, Python readline Module, Python rlcompleter Module, Python platform Module, Python sys.path, Python sys.argv, Python sys.exit, Python sys.stdin, Python sys.stdout, Python sys.stderr, Python sys.getsizeof, Python sys.setrecursionlimit, Python sys.version, Python sys.platform, Python sys.modules, Python gc Module, Python gc.collect, Python gc.set_threshold, Python inspect Module, Python inspect.getmembers, Python inspect.signature, Python dis Module, Python disassemble, Python marshal Module, Python tokenize Module, Python tokenize.generate_tokens, Python ast Module, Python ast.parse, Python compile Function, Python eval Function, Python exec Function, Python frozenset, Python bytes Type, Python bytearray Type, Python memoryview Type, Python slice Object, Python range Object, Python reversed Function, Python enumerate Function, Python zip Function, Python map Function, Python filter Function, Python reduce Function, Python sum Function, Python min Function, Python max Function, Python round Function, Python abs Function, Python divmod Function, Python pow Function, Python sorted Function, Python any Function, Python all Function, Python isinstance Function, Python issubclass Function, Python dir Function, Python help Function, Python vars Function, Python id Function, Python hash Function, Python ord Function, Python chr Function, Python bin Function, Python oct Function, Python hex Function, Python repr Function, Python ascii Function, Python callable Function, Python format Function, Python globals, Python locals, Python super Function, Python breakpoint Function, Python input Function, Python print Function, Python open Function, Python eval Function (Repeat noted), Python classmethod, Python staticmethod, Python property Decorator, Python __init__ Method, Python __str__ Method, Python __repr__ Method, Python __eq__ Method, Python __hash__ Method, Python __lt__ Method, Python __le__ Method, Python __gt__ Method, Python __ge__ Method, Python __ne__ Method, Python __add__ Method, Python __sub__ Method, Python __mul__ Method, Python __truediv__ Method, Python __floordiv__ Method, Python __mod__ Method, Python __pow__ Method, Python __len__ Method, Python __getitem__ Method, Python __setitem__ Method, Python __delitem__ Method, Python __contains__ Method, Python __iter__ Method, Python __next__ Method, Python __enter__ Method, Python __exit__ Method, Python __call__ Method, Python __new__ Method, Python __init_subclass__ Method, Python __class_getitem__ Method, Python __mro__, Python __name__ Variable, Python __main__ Module, Python __doc__, Python __package__, Python __file__, Python __debug__, Python unittest.TestCase, Python unittest.main, Python unittest.mock, Python unittest.mock.patch, Python unittest.mock.Mock, Python pytest Framework, Python pytest.mark, Python pytest fixtures, Python nose2 Testing, Python tox Tool, Python coverage Tool, Python hypothesis Testing, Python black Formatter, Python isort Tool, Python flake8 Linter, Python pylint Linter, Python mypy Type Checker, Python bandit Security Linter, Python pydoc Documentation, Python Sphinx Documentation, Python docstrings, Python reStructuredText, Python unittest.mock.MagicMock, Python unittest.mock.MockReturnValue, Python unittest.mock.MockSideEffect, Python argparse.ArgumentParser, Python argparse Namespace, Python configparser Module, Python configparser.ConfigParser, Python json.dumps, Python json.loads, Python json.dump, Python json.load, Python decimal Module, Python fractions Module, Python statistics Module, Python heapq Module, Python bisect Module, Python math.sqrt, Python math.floor, Python math.ceil, Python math.isnan, Python math.isinf, Python math.pi, Python math.e, Python math.gamma, Python random.random, Python random.randint, Python random.choice, Python random.shuffle, Python random.sample, Python datetime.datetime, Python datetime.date, Python datetime.time, Python datetime.timedelta, Python datetime.timezone, Python calendar Module, Python zoneinfo Module, Python locale.getdefaultlocale, Python glob.glob, Python fnmatch.filter, Python shutil.copy, Python shutil.move, Python tempfile.NamedTemporaryFile, Python tempfile.TemporaryDirectory, Python zipfile.ZipFile, Python tarfile.open, Python gzip.open, Python bz2.open, Python lzma.open, Python pickle Module, Python pickle.dump, Python pickle.load, Python shelve Module, Python sqlite3 Module, Python sqlite3.connect, Python http.server.HTTPServer, Python http.server.BaseHTTPRequestHandler, Python wsgiref.simple_server, Python xml.etree.ElementTree, Python xml.etree.Element, Python xml.etree.SubElement, Python configparser.ConfigParser.write, Python configparser.ConfigParser.read, Python re.search, Python re.match, Python re.findall, Python re.split, Python re.sub, Python re.compile, Python logging.basicConfig, Python logging.debug, Python logging.info, Python logging.warning, Python logging.error, Python logging.critical, Python collections.Counter, Python collections.defaultdict, Python collections.OrderedDict, Python collections.deque, Python collections.namedtuple, Python collections.ChainMap, Python dataclasses.dataclass, Python dataclasses.field, Python enum.Enum, Python enum.auto, Python typing Module, Python typing.List, Python typing.Dict, Python typing.Union, Python typing.Optional, Python typing.Any, Python typing.TypeVar, Python typing.Generic, Python typing.Protocol, Python typing.NamedTuple, Python functools.lru_cache, Python functools.reduce, Python functools.partial, Python functools.singledispatch, Python operator Module, Python operator.itemgetter, Python operator.attrgetter, Python operator.methodcaller, Python itertools.chain, Python itertools.product, Python itertools.permutations, Python itertools.combinations, Python itertools.groupby, Python itertools.accumulate, Python parse Library, Python pathlib.Path, Python pathlib.Path.resolve, Python pathlib.Path.mkdir, Python pathlib.Path.rmdir, Python pathlib.Path.unlink, Python pathlib.Path.glob, Python pathlib.Path.read_text, Python pathlib.Path.write_text, Python subprocess.check_call, Python subprocess.check_output, Python subprocess.call, Python unittest.mock.ANY, Python importlib Module, Python importlib.import_module, Python importlib.resources, Python pkgutil Module, Python runpy Module, Python pip wheel, Python pip install, Python pip freeze, Python pip uninstall, Python build Tools, Python twine Upload, Python poetry Package Manager, Python poetry.lock File, Python Hatch Project, Python virtualenv Tool, Python conda Environment, Python cffi Module, Python ctypes Module, Python ctypes.CDLL, Python ctypes.Structure, Python cProfile Module, Python pstats Module, Python timeit Module, Python imaplib.IMAP4, Python smtplib.SMTP, Python ssl.create_default_context, Python email.message.EmailMessage, Python email.mime.text, Python email.mime.multipart, Python xml.dom.minidom, Python xml.dom.pulldom, Python xml.sax Module, Python xml.sax.handler, Python xml.sax.make_parser, Python configobj Library, Python toml Module, Python tomli Module, Python yaml Module (PyYAML), Python pyenv Tool, Python poetry build, Python poetry publish, Python wheel packaging, Python pyinstaller Tool, Python cx_Freeze, Python nuitka Compiler, Python cython Compiler, Python mypy.ini, Python flake8.ini, Python black --check, Python black --diff, Python pylint.rcfile, Python coverage.py, Python coverage.xml, Python coverage combine, Python coverage html, Python coverage report, Python pytest.ini, Python pytest --cov, Python pytest --lf, Python pytest --ff, Python pytest -k, Python pytest -m, Python docker-compose Integration, Python fabric Library, Python invoke Library, Python pipenv Tool, Python pipenv Pipfile, Python pipenv lock, Python poetry pyproject.toml, Python functools.cache, Python functools.total_ordering, Python decimal.Decimal, Python decimal.Context, Python fractions.Fraction, Python fractions.gcd Deprecated, Python statistics.mean, Python statistics.median, Python statistics.mode, Python statistics.stdev, Python statistics.variance, Python tkinter Module, Python tkinter.Tk, Python tkinter.Frame, Python tkinter.Button, Python tkinter.Label, Python tkinter.Entry, Python tkinter.Text, Python tkinter.Menu, Python tkinter.Canvas, Python tkinter filedialog, Python tkinter messagebox, Python tkinter ttk Widgets, Python turtle Module, Python turtle.Turtle, Python curses Module, Python curses.wrapper, Python sqlite3.Cursor, Python sqlite3.Row, Python sqlite3.RowFactory, memory, Python memoryview.cast, Python bisect.bisect, Python bisect.bisect_left, Python bisect.bisect_right, Python heapq.heappush, Python heapq.heappop, Python heapq.heapify, Python math.factorial, Python math.comb, Python math.perm, Python random.uniform, Python random.gauss, Python random.seed, Python datetime.utcnow, Python datetime.now, Python datetime.strptime, Python datetime.strftime, Python timezone.utc, Python zoneinfo.ZoneInfo, Python re.IGNORECASE, Python re.MULTILINE, Python re.DOTALL, Python re.VERBOSE, Python re.IGNORECASE Flag, Python logging.getLogger, Python logging.addHandler, Python logging.setLevel, Python logging.LoggerAdapter, Python warnings.warn, Python warnings.simplefilter, Python pdb.set_trace, Python pdb.runcall, Python pdb.runctx, Python inspect.isfunction, Python inspect.ismethod, Python inspect.isclass, Python inspect.getsource, Python inspect.getdoc, Python ast.literal_eval, Python compile(source), Python eval(expression), Python exec(statement), Python frozenset Literal, Python memoryview Slice, Python slice.start, Python slice.stop, Python slice.step, Python range.start, Python range.stop, Python range.step, Python enumerate(start), Python zip_longest, Python map(func), Python filter(func), Python reduce(func), Python sum(iterable), Python min(iterable), Python max(iterable), Python all(iterable), Python any(iterable), Python isinstance(obj), Python issubclass(cls), Python dir(object), Python help(object), Python vars(object), Python id(object), Python hash(object), Python ord(char), Python chr(int), Python bin(int), Python oct(int), Python hex(int), Python repr(object), Python ascii(object), Python callable(object), Python format(value), Python globals(), Python locals(), Python super(class), Python breakpoint(), Python input(), Python print(), Python open(filename), Python property(fget), Python classmethod(method), Python staticmethod(method), Python __init__.py, Python __main__.py, Python __init__ Module, Python __main__ Execution, Python __doc__ String, Python setuptools.setup, Python setuptools.find_packages, Python distutils.core.setup, Python wheel bdists, Python pyproject.build, Python pydoc CLI, Python Sphinx conf.py, Python docutils Integration, Python unittest.TextTestRunner, Python unittest.TestLoader, Python unittest.TestSuite, Python unittest.skip, Python unittest.expectedFailure, Python unittest.mock.call, Python unittest.mock.Mock.assert_called_with, Python pytest.mark.skip, Python pytest.mark.xfail, Python pytest.mark.parametrize, Python pytest fixture Scope, Python pytest fixture autouse, Python coverage run, Python coverage erase, Python coverage xml, Python coverage json, Python black line-length, Python black target-version, Python pylint --disable, Python pylint --enable, Python flake8 ignore, Python mypy --ignore-missing-imports, Python mypy --strict, Python bandit -r, Python bandit.config, Python cProfile.run, Python pstats.Stats, Python timeit.timeit, Python timeit.repeat, Python multiprocessing.Pool, Python multiprocessing.Queue, Python multiprocessing.Value, Python multiprocessing.Array, Python subprocess.DEVNULL, Python subprocess.PIPE, Python requests.get, Python requests.post, Python requests.put, Python requests.delete, Python requests.Session, Python requests.adapters, Python asyncio.sleep, Python asyncio.create_task, Python asyncio.gather, Python asyncio.wait, Python asyncio.run_until_complete, Python asyncio.Lock, Python asyncio.Semaphore, Python asyncio.Event, Python asyncio.Condition, Python aiohttp.ClientSession, Python aiohttp.web, Python aiohttp.ClientResponse, Python aiohttp.ClientWebSocketResponse, Python websockets.connect, Python websockets.serve, Python sqlalchemy Engine, Python sqlalchemy Session, Python sqlalchemy ORM, Python sqlalchemy Table, Python sqlalchemy Column, Python sqlalchemy create_engine, Python sqlalchemy select, Python sqlalchemy insert, Python sqlalchemy update, Python sqlalchemy delete, Python sqlalchemy MetaData, Python sqlalchemy text, Python ORM Databases, Python celery Task, Python celery Broker, Python celery Worker, Python celery Beat, Python celery Flower, Python gunicorn wsgi, Python uvicorn ASGI, Python hypercorn ASGI, Python waitress WSGI, Python werkzeug WSGI, Python gevent Hub, Python greenlet, Python eventlet, Python paramiko SSH, Python scp Module, Python fabric task, Python invoke task, Python importlib.metadata, Python toml.load, Python yaml.safe_load, Python yaml.dump, Python pyenv install, Python pyenv global, Python pyenv local, Python pipenv install, Python pipenv run, Python poetry install, Python poetry run, Python poetry publish, Python hatch build, Python hatch run, Python conda install, Python conda create, Python conda activate, Python cffi.FFI, Python ctypes.Structure, Python ctypes.byref, Python ctypes.pointer, Python cProfile.Profile, Python pstats.sort_stats, Python timeit.default_timer, Python zoneinfo.ZoneInfo.from_file, Python xml.dom.minidom.parse, Python xml.dom.minidom.parseString, Python xml.sax.parse, Python xml.sax.ContentHandler, Python configobj.ConfigObj, Python tomli.load, Python yaml.Loader, Python pydoc -w, Python Sphinx autodoc, Python unittest.mock.patch.object, Python unittest.mock.call_args, Python unittest.mock.call_count, Python pytest --maxfail, Python pytest --disable-warnings, Python pytest --last-failed, Python pytest --exitfirst, Python pytest -v, Python pytest -q, Python pytest -s, Python pytest-cov Plugin, Python pytest-xdist Parallel, Python pytest-mock Plugin, Python docker run (Python-based Images), Python fabric.Connection, Python fabric.run, Python fabric.sudo, Python pipenv shell, Python pipenv graph, Python poetry lock, Python poetry update, Python black --check, Python black --diff, Python pylint --rcfile, Python flake8 --max-line-length, Python flake8 --statistics, Python isort --profile black, Python mypy.ini settings, Python bandit.yaml, Python coverage combine, Python coverage html, Python coverage json, Python coverage report

Python: Python Variables, Python Data Types, Python Control Structures, Python Loops, Python Functions, Python Modules, Python Packages, Python File Handling, Python Errors and Exceptions, Python Classes and Objects, Python Inheritance, Python Polymorphism, Python Encapsulation, Python Abstraction, Python Lists, Python Dictionaries, Python Tuples, Python Sets, Python String Manipulation, Python Regular Expressions, Python Comprehensions, Python Lambda Functions, Python Map, Filter, and Reduce, Python Decorators, Python Generators, Python Context Managers, Python Concurrency with Threads, Python Asynchronous Programming, Python Multiprocessing, Python Networking, Python Database Interaction, Python Debugging, Python Testing and Unit Testing, Python Virtual Environments, Python Package Management, Python Data Analysis, Python Data Visualization, Python Web Scraping, Python Web Development with Flask/Django, Python API Interaction, Python GUI Programming, Python Game Development, Python Security and Cryptography, Python Blockchain Programming, Python Machine Learning, Python Deep Learning, Python Natural Language Processing, Python Computer Vision, Python Robotics, Python Scientific Computing, Python Data Engineering, Python Cloud Computing, Python DevOps Tools, Python Performance Optimization, Python Design Patterns, Python Type Hints, Python Version Control with Git, Python Documentation, Python Internationalization and Localization, Python Accessibility, Python Configurations and Environments, Python Continuous Integration/Continuous Deployment, Python Algorithm Design, Python Problem Solving, Python Code Readability, Python Software Architecture, Python Refactoring, Python Integration with Other Languages, Python Microservices Architecture, Python Serverless Computing, Python Big Data Analysis, Python Internet of Things (IoT), Python Geospatial Analysis, Python Quantum Computing, Python Bioinformatics, Python Ethical Hacking, Python Artificial Intelligence, Python Augmented Reality and Virtual Reality, Python Blockchain Applications, Python Chatbots, Python Voice Assistants, Python Edge Computing, Python Graph Algorithms, Python Social Network Analysis, Python Time Series Analysis, Python Image Processing, Python Audio Processing, Python Video Processing, Python 3D Programming, Python Parallel Computing, Python Event-Driven Programming, Python Reactive Programming.

Variables, Data Types, Control Structures, Loops, Functions, Modules, Packages, File Handling, Errors and Exceptions, Classes and Objects, Inheritance, Polymorphism, Encapsulation, Abstraction, Lists, Dictionaries, Tuples, Sets, String Manipulation, Regular Expressions, Comprehensions, Lambda Functions, Map, Filter, and Reduce, Decorators, Generators, Context Managers, Concurrency with Threads, Asynchronous Programming, Multiprocessing, Networking, Database Interaction, Debugging, Testing and Unit Testing, Virtual Environments, Package Management, Data Analysis, Data Visualization, Web Scraping, Web Development with Flask/Django, API Interaction, GUI Programming, Game Development, Security and Cryptography, Blockchain Programming, Machine Learning, Deep Learning, Natural Language Processing, Computer Vision, Robotics, Scientific Computing, Data Engineering, Cloud Computing, DevOps Tools, Performance Optimization, Design Patterns, Type Hints, Version Control with Git, Documentation, Internationalization and Localization, Accessibility, Configurations and Environments, Continuous Integration/Continuous Deployment, Algorithm Design, Problem Solving, Code Readability, Software Architecture, Refactoring, Integration with Other Languages, Microservices Architecture, Serverless Computing, Big Data Analysis, Internet of Things (IoT), Geospatial Analysis, Quantum Computing, Bioinformatics, Ethical Hacking, Artificial Intelligence, Augmented Reality and Virtual Reality, Blockchain Applications, Chatbots, Voice Assistants, Edge Computing, Graph Algorithms, Social Network Analysis, Time Series Analysis, Image Processing, Audio Processing, Video Processing, 3D Programming, Parallel Computing, Event-Driven Programming, Reactive Programming.


Python Glossary, Python Fundamentals, Python Inventor: Python Language Designer: Guido van Rossum on 20 February 1991; PEPs, Python Scripting, Python Keywords, Python Built-In Data Types, Python Data Structures - Python Algorithms, Python Syntax, Python OOP - Python Design Patterns, Python Module Index, pymotw.com, Python Package Manager (pip-PyPI), Python Virtualization (Conda, Miniconda, Virtualenv, Pipenv, Poetry), Python Interpreter, CPython, Python REPL, Python IDEs (PyCharm, Jupyter Notebook), Python Development Tools, Python Linter, Pythonista-Python User, Python Uses, List of Python Software, Python Popularity, Python Compiler, Python Transpiler, Python DevOps - Python SRE, Python Data Science - Python DataOps, Python Machine Learning, Python Deep Learning, Functional Python, Python Concurrency - Python GIL - Python Async (Asyncio), Python Standard Library, Python Testing (Pytest), Python Libraries (Flask), Python Frameworks (Django), Python History, Python Bibliography, Manning Python Series, Python Official Glossary - Python Glossary - Glossaire de Python - French, Python Topics, Python Courses, Python Research, Python GitHub, Written in Python, Python Awesome List, Python Versions. (navbar_python - see also navbar_python_libaries, navbar_python_standard_library, navbar_python_virtual_environments, navbar_numpy, navbar_datascience)


Cloud Monk is Retired ( for now). Buddha with you. © 2025 and Beginningless Time - Present Moment - Three Times: The Buddhas or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.


python_how-to_chapter_1.txt · Last modified: 2025/02/01 06:34 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki