100% found this document useful (3 votes)
131 views72 pages

Python Programming 4th Edition Singh A. all chapter instant download

Python

Uploaded by

capiocorinbj
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
100% found this document useful (3 votes)
131 views72 pages

Python Programming 4th Edition Singh A. all chapter instant download

Python

Uploaded by

capiocorinbj
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 72

Visit https://ebookgate.

com to download the full version and


explore more ebooks

Python Programming 4th Edition Singh A.

_____ Click the link below to download _____


https://ebookgate.com/product/python-programming-4th-
edition-singh-a/

Explore and download more ebooks at ebookgate.com


Here are some recommended products that might interest you.
You can download now and explore!

Python Programming for Teens 1st Edition Kenneth A.


Lambert

https://ebookgate.com/product/python-programming-for-teens-1st-
edition-kenneth-a-lambert/

ebookgate.com

Expert Python Programming 2nd Edition Jaworski

https://ebookgate.com/product/expert-python-programming-2nd-edition-
jaworski/

ebookgate.com

Core Python Programming 2nd Edition Wesley Chun

https://ebookgate.com/product/core-python-programming-2nd-edition-
wesley-chun/

ebookgate.com

Programming Python 3rd ed Edition Mark Lutz

https://ebookgate.com/product/programming-python-3rd-ed-edition-mark-
lutz/

ebookgate.com
Ultimate Python Programming 1st Edition Deepali Srivastava

https://ebookgate.com/product/ultimate-python-programming-1st-edition-
deepali-srivastava/

ebookgate.com

Black hat Python Python programming for hackers and


pentesters 1st Edition Seitz

https://ebookgate.com/product/black-hat-python-python-programming-for-
hackers-and-pentesters-1st-edition-seitz/

ebookgate.com

Practical Maya Programming with Python 1st Edition


Galanakis

https://ebookgate.com/product/practical-maya-programming-with-
python-1st-edition-galanakis/

ebookgate.com

Learning BeagleBone Python Programming Unleash the


potential of BeagleBone using Python 1st Edition Hiam

https://ebookgate.com/product/learning-beaglebone-python-programming-
unleash-the-potential-of-beaglebone-using-python-1st-edition-hiam/

ebookgate.com

Foundations of Python Network Programming Third Edition


Brandon Rhodes

https://ebookgate.com/product/foundations-of-python-network-
programming-third-edition-brandon-rhodes/

ebookgate.com
Ajit Singh

Python
Programming
4th Edition

Featured With......
ISBN-13 :979-8321458457

Pandas
GUI Programming
Modules & Library
Database Connectivity
101 Python Programs

Copyrighted Material
AKNOWLEDGEMENT
This piece of study of python is an outcome of the encouragement, guidance, help and assistance provided
to us by our colleagues, faculties, Tech-friends and my family members.

As an acknowledgement, I would like to take the opportunity to express my deep sense of gratitude to all
those who played a crucial role in the successful completion of this book, especially to my senior scholars;
this book certainly has been benefited from discussions held with many IT professionals (Ex-students)
over the years it took to write it.

Python reflects on a number of growing trends in software development, putting it at or near the leading
edge of good programming languages. It is a very simple language surrounded by a vast library of add­
on modules. It is an open source project, supported by many individuals. It is an object-oriented language,
binding data and processing into class definitions. It is a platform-independent, scripted language, with
complete access to operating systems APIs. It supports integration of complex solutions from pre-built
components. It is a dynamic language, which avoids many of the complexities and overheads of compiled
languages.

Three Faces of a Language. There are three facets to a programming language: how you write it, what it
means, and the additional practical considerations that make a program useful. While many books cover
the syntax and semantics of Python, in this book, the pragmatic considerations are also covered. My core
objective is to build enough language skills with a good object-oriented design so that the students can have
an efficient knowledge about python on windows platform.
Special thanks goes to our respected professor Prof. Dr. Bal Gangadhar Prasad, who is not only my role
model in learning and teaching but, also a source of encouragement who has always pushed me forward to
utilize my skills in a timely manner and have ever obliged for bearing with me from time to time, insisting
me on sticking to my determination all throughout.

I would also like to thank those who provided the odd suggestions via email to me. All feedbacks were
listened to, as you will no doubt see some content influenced by your suggestions.

I hope that the reader likes this book and finds it useful in learning the concepts of python.

Thank You!!

Ajit Singh!!

PREFACE

Share the knowledge........


Strengthen the sur­
roundings........
Python Simply In Depth provides all essential programming concepts and information one shall need in
order to start developing their own Python program. The book provides a comprehensive walk-through of
Python programming in a clear, straightforward manner that beginners will appreciate. Important con­
cepts are introduced through a step-by-step discussion and reinforced by relevant examples and illustra­
tions. This book can be used as a guide to help explore, harness, and gain appreciation of the capabilities
and features of Python.

This book encapsulates rich practical hands-on experience in developing python based applications,
combined with teaching the subject for graduate/post-graduate students. The book is therefore a culmi­
nation of putting together what has been both practiced as well as preached, which is the one of the most
compelling differentiators for this book. It can also be used for independent study by anyone interested in
getting a broad introduction to a core useful set of the python language.

This book isfeatured with advanced topics, such as Python Pandas, Database Connectivity, Python GUI
Programming and Python Libraries apartfrom the core concepts like Multithreading, Exception Handling
and Useful Modules. We explained these because they can solve some problems better than standard solutions.

My approach in this book is to regard python as a language that readers will want to use as a primary tool
in many different areas of their programming work - not just for creating programs with graphical content.
Nevertheless, I recognized that visual examples are much more fun to create and work with.
This book is a close-to-complete presentation of the Python language. Whether you are new to program­
ming or a professional developer, this book’s goal is to bring you quickly up to speed on the fundamentals of
the core Python language. After reading this book, you will know enough about Python to apply it in what­
ever application domains you choose to explore in your career.

Compatible with CBSE and AICTE Syllabus........

About This Forth Edition

In the four years since the first edition of this book was published in late 2019, there have been sub­
stantial changes in Python itself. Although I have attempted to retain as much of the prior version of
this text as possible, this new edition reflects many recent changes in the Python language, as well as a
handful of structural changes.

This Book’s Prerequisites

There are no absolute prerequisites to speak of, really. Both true beginners and crusty programming
veterans have used this book successfully. If you are motivated to learn Python, this text will probably
work for you. In general, though, we have found that any exposure to programming or scripting before
this book can be helpful, even if not required for every reader.

Feedback
I have tried to wash out every error in our third edition of this book after being reviewed by lots of bachelor of
Computer Science, but as happens with any programming language - A few difficult to understand bugs shall
remain and of course, typos - and therefore, suggestions from students that may lead to improvement in next
edition in shortcomingfuture are highly appreciated.

Constructive suggestions and criticism always go a long way in enhancing any endeavour. I request all readers
to email me their valuable comments / views /feedback for the betterment of the book at ajit_singh24@ya-
hoo.com, mentioning the title and author name in the subject line. Please report any piracy spotted by you as
well. I would be glad to hear suggestionsfrom you.

Python Programming
4th Edition

Copyrighted Material
Copyright © 2024-25 by Ajit Singh, All Rights Reserved.

No part of this publication may be reproduced, stored in a retrieval system or transmitted, in any
form or by any means — electronic, mechanical, photocopying, recording or otherwise— without
prior written permission from the author, except for the inclusion of brief quotations in a review.
For information about this title or to order other books and/or electronic media, contact the
publisher:

Ajit Singh - 24+ years of experience in academics.


M.Phil, UGC NET Qualified

PYTHON
? INSTITUTE
MnM r.to*
PCAP: Programming Essentials in Python

Statement of Achievement
Presented To:

Ajit Singh
Warne

During the Cisco Networking Academy® self-paced course.the student has studied the following Skills:

• the universal concepts of computer programing (i e variables, flow control, data structures, algorrthms, condtional execution loops, functions, etc,)
• developer teds and the runtime environment;
• lire syntax and semantics of the Python language;
• the fundamentals d cbicct oncnlod programing and the way they arc acoprtcd m Python .
• the means by which to rcsdvc typ<cal implementation problems
• the writing of Python programs using standard language infrastructure.
• fundamental programing techniques, best practices, customs and vocabulary, inducing the most common library function in Python 3;

17 Jan 2020
Date

By completing the course. tha student is no* randy Io atisrn.nl rhn quaincaron PCAP-Ceditmri Assoc nte in Python Programing certification, from ths OpnnEDG Python Inshtuls
. rotacad com |mm pythoninstttixe <x g
CONTENTS

Chapter Topic(s) Page


No
1 Getting Started with Python 09
History
Evolution
Features of Python
Limitation of Python
Comparisons
Some Jargon
2 Installing Python 17
Windows Installation
Customizing Environment
Whats new
3 Interacting with Python 26
Running Python
Command-Line Interaction
The IDLE Development Environment
Script Mode
Getting Help
4 Python Syntax 34
Syntax Formalities
Indentation
Keywords
Identifiers
Statements
Comments
print() and input() functions
5 Variables and Data Types 41
Variables
Several Data Types
Numeric Conversion (or Factory) Functions
Math function
6 Operators in Pyhton 51
Types of operators
Example of each type of operators.
7 Built-in Functions 61
8 Conditional Statements 66
Conditional Processing: the if Statement
The pass Statement
The assert Statement
The if-else Operator
9 Loops 72
Iterative Processing: The for Statement
Iterative Processing: The while Statement
More Iteration Control: break and continue
Infinite loop
Nested loop
10 User-Defined Functions 78
Function Definition: The def and return Statements
Function Use
Function Varieties
Some Examples
More Function Definition Features
Local and global variable
Lamda
Functions and Namespaces
The global Statement
11 Python Useful Modules 90
Module Definition
Module Use: The import Statement
Finding Modules: The Path
Math
datetime
os
zipfileurllib
winsound
finding module PYTHONHOME & PYTHONPATH
The exec Statement
12 Classes and Object-Oriented Programming 100
Class Definition: the class Statement
Class Responsibilities
Creating and Using Objects
Constructor
Instance & global variable
Static Methods and Class Method
Object Lifecycle
Special Method Names
Inheritance
Polymorphism
13 Exception Handling in Python 113
Basic Exception Handling
Raising Exceptions
An Exceptional Example
Complete Exception Handling and The finally Clause
Exception Functions
Exception Attributes
Built-in Exceptions
14 Multithreading 124
Defination
Starting new thread
The threading module
Synchronizing thread
Multithreaded priority queue
15 Text Files in Python 133
File semantics
File Organization and Structure
Additional Background
Built-in Functions
File Statements
File Methods
File and directory related methods
16 Regular Expression in Python
Creating a Regular Expression
Using a Regular Expression
Regular Expression Exercises
17 String, List & Dictionary
String Literal Values
String Operations
String Comparison Operations
String Statements
String Built-in Functions
String Methods
String Modules
Digression on Immutability of Strings

Lists
List Literal Values
List Operations
List Comparison Operations
List Statements
List Built-in Functions
List Methods
Stack & queue using list
Copy list

Mappings and Dictionaries


Dictionary Literal Values
Dictionary Operations
144

150
Dictionary Comparison Operations
Dictionary Statements
Dictionary Built-in Functions
Dictionary Methods
Iterators
18 Python Pandas 166
Introduction to Pandas
Key features of Pandas
Anaconda Pythons Distribution
Downloading, installing and customizing Anaconda on Windows
Working with Numpy
Working with Series
Working with DataFrame
Working with Panel
Data transferring from CSV files to data frame and vice versa.
Data transferring from Excel files to data frame and vice versa.
Data transferring from SQLite to data frame and vice versa.
19 Python GUI Programming 201
Introduction to TKinter
GUI Components
Label, Button, Entry Box, Textbox, Frame, Dialog, Windows,Radio,
Checkbok
Event & Event Handling
20 Database Connectivity In Python 222
Database
Database Interface
Phythons Database API
Python Database Programming Using MySQL
Python Database Programming Using ORACLE
Handling errors in Database Programming
21 The Python Library 223
Overview of the Python Library
Most Useful Library Sections
22 101 Python Programs 243

Chapter 1
Getting Started with Python
Python is an open source, high-level programming language developed by Guido van Rossum in the late
1980s and presently administered by Python Software Foundation. It came from the ABC language that he
helped create early on in his career.

Python is an interpreted language. This means that every time a program is run, its interpreter runs through
the code and translates the codes into machine-readable byte code.
Python is an object-oriented language that allows users to manage and control data structures or objects to
create and run programs. Everything in Python is, infact,jirst class. All objects, data types, junctions, meth­
ods, and classes take equal position in Python.

The official introduction to Python is


Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a
simple but effective approach to object-oriented programming. Pythons elegant syntax and dynamic typing,
together with its interpreted nature, make it an ideal language for scripting and rapid application develop­
ment in many areas on most platforms.

It is a high-level language. Reading and writing codes in Python is much like reading and writing simple
regular English statements. Python is a powerful language that you can use to create games, write GUIs,
and develop web applications.

History of Python
Python language was developed by Guido van Rossum in the late eighties and early nineties at
the National Research Institute for Mathematics and Computer Science in the Netherlands.

Python is derived from many other languages, including Modula-3, ABC, C, C+


+, Algol-68, SmallTalk, and UNIX shell and other scripting languages.
Python is copyrighted. Like Perl, Python source code is now available
under the GNU General Public License (GPL).

Python is now maintained by a core development team at the institute, although


Guido van Rossum still holds a major role in directing its development.

Python is implemented in C, and relies on the extensive, well understood, portable C libraries. It fits seam­
lessly with Unix, Linux and POSIX environments. Since these standard C libraries are widely available for
the various MS-Windows variants, and other non-POSIX operating systems, Python runs similarly in all
environments.

Evolution of Python

The development of Python occurred at a time when many other dynamic (and open-source) program­
ming languages such as Tel, Perl, and (much later) Ruby were also being actively developed and gaining
popularity.

Version 1 of Python : Python 1.0 was released in January 1994. The major release included a number of
new features and functional programming tools including lambda, filter, map and reduce.

Version 2 of Python: In October 2000, Python 2.0 was released with the new list comprehension feature
and a garbage collection system. The Python Software Foundation has already announced that there
would be no Python 2.8. However, the Foundation will provide support to version 2.7 of the programming
language till 2020.

Version 3 of Python : Python 3.0 was released in December 2008. It came with a several new features
and enhancements, along with a number of deprecated features. The deprecated features and backward
incompatibility make version 3 of Python completely different from earlier versions. So many Python
developers still use Python 2.6 or 2.7 to avail the features deprecated from last major release.

As Python 3 is backward incompatible, the programmers cannot access features like string exceptions, old-
style classes, and implicit relative imports. Also, the developers must be familiar with changes made to
syntax and APIs. They can use a tool called 2to3 to migrate their application from Python 2 to 3 smoothly.
The tool highlights incompatibility and areas of concern through comments and warnings. The comments
help programmers to make changes to the code, and upgrade their existing applications to the latest ver­
sion of programming language.

The version 2 and version 3 of Python are completely different from each other. So each programmer must
understand the features of these distinct versions, and compare their functionality based on specific needs
of the project. Also, he needs to check the version of Python that each framework supports. However, each
developer must take advantage of the latest version of Python to avail new features and long-term support.
The difference between
"Python Implementation" vs. "Python distribution" vs. Python

Python itself is a programming language as per the behavior defined by the documentation available on
python.org. Anything that does what that documentation says it's supposed to do would "count" as being
Python....

An implementation of Python is an actual program that provides the behavior defined by the documenta­
tion available on python.org. It has various implementations which allow you to run programs written in
it. To give you a better idea, msvc, clang, gcc are implementations of C. Here are some python implementa­
tions:
• CPython: this is the default, and what you should be using if you have no idea.
• Jython: implementation in java, allows you to use the java api.
• IronPython: implementation for .net, allows you to use the .net api.
• PyPy: JIT implementation.

A distribution of Python is a bundle that contains an implementation of Python along with a bunch of
libraries or tools or packages. In theory, a distribution of Python could use any implementation, although
all the ones I know of use CPython. The download from python.org could also be considered a distribution
(a minimal distribution that doesn't contain any "extras").

In practice, most people using Python for practical purposes are using CPython (the de facto standard
implementation), so the real choice is among different distributions of that. Among those, you mainly
choose based on what extras you want to come with it. You can choose to use the "bare" distribution from
python.org and then install packages yourself, or if you plan on doing scientific/analytics computing, you
could choose one of the distributions geared towards that (e.g., Anaconda or Canopy).
Features/Advantages of Using Python Language

The features/advantages of Python language are as follows;


1. Interpreted Language - as well as also compiled to bytecode. Modules are automatically compiled
(to .pyc) when imported as well as also be explicitly compiled as per the requirement. It facilitates an inter­
active command line and interpreter shell.

2. Object Oriented Language - Almost everything is an object in this language. It supports Data hiding,
Multiple inheritance, Interfaces and polymorphism.

3. Runs across different platforms - Python works on Windows, Linux/UNIX, Mac OS X, other operating
systems and small-form devices as well as it also runs on microcontrollers used in appliances, toys, remote
controls, embedded devices, and other similar devices.
4. Highly Structured Language - Statements, functions, classes, modules, and packages enable us to write
large, well structured applications so that to have the feature of readability, locate ability, modifiability.

5. Higher Productive Language - Pythons codes are considerably shorter, simpler, and less verbose than
other high-level programming languages such as Java and C++. In addition, it has well-designed built-in
features and standard library as well as access to third party modules and source libraries. These features
enable programming in Python more efficient.

6. Dynamic Language - It is dynamic language as types are bound to values, not to variables, function and
method lookup is done at runtime, values are inspectable and we can list the methods supported by any
given object.

7. Strongly Typed Language - at runtime rather than compile time. Objects (values) have a type, but vari­
ables do not have in this language.

8. Embedding and Extending Language - Python provides a well documented and supported way
(1) to embed the Python interpreter in C/C++ applications and
(2) to extend Python with modules and objects implemented in C/C++.
Cython enables us to generate C code from Python and to "easily" create wrappers for C/C++ functions.
To embed and extend Python with Java, there is Jython.

9. Reasonably High level - It contains high level builtin data types as well as high level control structures.

10. Less Learning Time - Python is relatively easy to learn as compare to other languages. Python is a a
good to first language for learning programming because it uses simple syntax and shorter codes.

Limitations/Disadvantages of Python Language

Python has varied advantageous features, and programmers prefer this language to other programming
languages because it is easy to learn and code too. But, this language has still not made its place in some
computing arenas that includes Enterprise Development houses. Therefore, this language may not solve
some of the enterprise solutions, and limitations include-

1. Difficulty in Using Other Languages


The Python lovers become so accustomed to its features and its extensive libraries, so they face problem in
learning or working on other programming languages. Python experts may see the declaring of cast values
or variable types, syntactic requirements of adding curly braces or semi colons as an onerous task.

2. Weak Language in Mobile Computing


Python has made its presence on many desktop and server platforms, but it is seen as a weak language for
mobile computing. That is why very few mobile applications are built in it like Carbonnelle.
3. Gets Slow in Speed
Python executes with the help of an interpreter instead of the compiler, which causes it to slow down
because compilation and execution help it to work normally. On the other hand, it can be seen that it is fast
for many web applications too.

4. Run-time Errors
The Python language is dynamically typed so it has many design restrictions that are reported by some
Python developers. It is even seen that it requires more testing time, and the errors show up when the ap­
plications are finally run.

5. Underdeveloped Database Access Layers


As compared to the popular technologies like JDBC and ODBC, the Pythons database access layer is found to
be bit underdeveloped and primitive. It cannot be applied in the enterprises that need smooth interaction
of complex legacy data.

Varieties of Python Language:

Jython Python for the Java environment http://www.jython.org/


PyPy Python with a JIT compiler and stackless mode http://pypy.org/
CPython Standard Python 2.xx implemented in C.
Stackless Python with enhanced thread support and microthreads etc.
http://www.stackless.com/
IronPython Python for .NET and the CLR http://ironpython.net/
Python 3 The new, new Python. This is intended as a replacement for Python
2.x. http://www.python.org/doc/

Some Jargon

For folks new to developing software, it might help to understand a few distinctions made above.
Interpreted
Not Interpreted (i.e., Compiled)

Python is a byte-code interpreter. A Python code object is a sequence of bytes that represent various opera­
tions and values. The Python interpreter steps through the bytes, performing the operations.

A compiled language (e.g., C, C++, etc.) is translated from source form to executable binary specific to oper­
ating system and hardware platform.
Java is similar to Python: its compiled and the Java Virtual Machine is a byte-code interpreter.
Dynamic
Not Dynamic (i.e., Static)
Python is a dynamic language. Variables and functions do not have defined data types. Instead, a variable
is simply a label attached to an object. A function is a callable object with parameters, but no declared result
type. Each object has a strongly-defined permanent class.
There is no sophisticated compile-time type checking. Instead, any type mismatches will be detected at
run-time. Since many types are nearly interchangeable, there isnt a need for a lot of type checking. For ex­
amples of interchangeable (polymorphic) types, see Simple Numeric Expressions and Output.
Languages like C, C++ and Java have statically-declared variables and functions.
Scripting
Non-Scripting

The scripting distinction is an operational feature of POSIX-compliant operating systems. Files which
begin with the #!/path/to/interpreter will be used as scripts by the OS. They can be executed from the com­
mand-line because the interpreter is named in the first line of the file.

Languages like Java, C and C++ do not have this feature; these files must be compiled before they can be
executed.

Chapter 2
Installing Python
Installing Python in Windows

To install Python, you must first download the installation package of your preferred version from this
link:

https://www.python.org/downloads/

On this page, you will be asked to choose the recent versions for Python 3.11.x/3.12.x which was released
on 8th Feb 2023. Alternatively, if you are looking for a specific release, either Python 2 or 3, you can scroll
down the page to find download links for earlier versions.

python i
About Downloads Documentation Community

Download the latest version for Windows


Download Python 3.11.2

Looking for Python with a different OS? Python for Windows,


Linux/UNIX, macOS, Other

Want to help test development versions of Python? Prereleases,


Docker images
You would normally opt to download the latest version, which is Python 3.12.x. However, you may opt for the latest
version of Python 2, 2.7.18. Your preferences will usually depend on which version will be most usable for your
curriculum / project. While Python 3 is the present and future of the language, issues such as third party utility or
compatibility may require you to download Python 2.

Run the downloaded file. This brings up the Python install wizard, which is really easy to use. Just accept
the default settings, wait until the install is finished, and you are done.

£* Python 3.11.2 (64-bit) Setup

Install Python 3.11.2 (64-bit)


Select Install Now to install Python with default settings, or choose
Customize to enable or disable features.

—> Install Now


C:\Users\vignan\AppData\Local\Programs\Python\Python311

Includes IDLE, pip and documentation


Creates shortcuts and file associations

—> Customize installation


Choose location and features

python Use admin privileges when installing py.exe


for
0 Add python.exe to PATH Cancel
windows
Note that depending on your needs, you may also check the box to add Python to the Path. It will inform the
python file installer that the executable python path folder will be added to the environment variable with
the name of ‘Path’.

Finally, if the installation process is a success, the following window will appear:
£• Python 3.10.5 (64-bit) Setup

Setup was successful


New to Python? Start with the online tutorial and
documentation. At your terminal type "py" to launch Python,
or search for Python in your Start menu.

See what's new in this release, or find more info about using
Python on Windows.

S Disable path length limit


Changes your machine configuration to allow programs, including Python, to
bypass the 260 character "MAX-PATH'' limitation.

python
for
windows Close

Windows Configuration (Optional)


Windows users will need to be sure that python.exe is on their PATH. This is done with the System control
panel. Click on the Advanced tab. Click on the Environment Variables... button. Click on the System vari­
ables Path line, and click the Edit... button. This will often have a long list of items, sometimes starting
with %SystemRoot%. At the end of this list, add and the direction location of Python.exe. On my ma­
chine, I put it in D:\Softwares\Python\.

For Windows programmers, the windows command interpreter uses the last letters of the file name to
associate a file with an interpreter. You can have Windows run the python.exe program whenever you dou­
ble-click a .py file. This is done with the Folder Options control panel. The File Types tab allows you to pair
a file type with a program that processes the file.

Follow the below steps to add Python Path to Environment Variables.

Step 1: Click on Start Button and Open the Run Program.


Step 2: Now type sysdm.cpl and click OK. This opens the System Properties Dialog Box.
Step 3: Go to Advanced Tab and and Click on Environment Variables.
Step 4: In the System Variable section, Select the path variable.
Step 5: Click on Edit button and add python path to variable value.
Step 6: Click OK.

You can get your python path in the folder where you have installed python. Example - for us it D:\Soft-
wares\Python\
How to Test the Python in Microsoft Windows

The last part, it will display on how to test the result of the python installation in the previous part. It is
actually very simple as it exist in the following steps:
As usual, just execute the Command Prompt.
Following after, type the command below to test whether ‘python’ is available and it is exist in the environ­
ment variable of ‘Path’:

C:\Users\Personal>python
Python 3.11.2 (tags/v3.11.2:f377153, Jun 6 2022,16:14:13) [MSC v.1929 64 bit (AMD64)] on Win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

Last but not least, just perform another test to make sure. The following test is executing a certain com­
mand to check the version of the installed python as follows :

C:\Users\Personal>python -V
Python 3.11.2
C:\Users\Personal>

As it appear in the output of the above command execution, the version is matched. It is python with the
version of‘3.11.2’.

Python Editors
> Vim http://www.vim.org/
> Emacs See http://www.gnu.org/software/emacs/
> SciTE http://www.scintilla.org/SciTE.html.
> MS Windows only
(1) TextPad http://www.textpad.com;
(2) UltraEdit http://www.ultraedit.com/.
> Jed See http://www.jedsoft.org/jed/.
> jEdit Requires a bit of customization for Python See http://jedit.org.
> Geany http://www.geany.org/

Interactive Interpreters:
> python
> ipython
> Idle IDEs

Integrated Development Environments for Python:


> PyWin MS Windows only. Available at: http://sourceforge.net/projects/pywin3 2/
> Kdevelop Linux/KDE See http://www.kdevelop.org/
> Eric Linux KDE? See http://ericide.pythonprojects.org/index.html
> WingIDE See http://wingware.com/wingide/
> Eclipse http://eclipse.org/ There is a plug in that supports Python.
> Emacs and SciTE will evaluate a Python buffer within the editor.
Whats new in Python 3.11.x

This new version of Python mainly focuses on improving the performance of the language. A few nice features
around exception handling and error display should also improve the development experience.

1. Improved performance

On average, a 25% performance gain compared to Python 3.11 is announced. Some operations are even up to 60%
faster than the latest version. The start-up time is reduced by 10% on average.
The measurements were performed with performance using CPython compiled with GCC under Ubuntu.

The performance gain comes mainly from the specialization of some instructions when the calls to a code are repet­
itive. The fact that the code repeats itself without necessarily changing allows the interpreter to analyze the running
code and replace the generic code with type-specific pieces.
Another improvement comes from reducing the number of calls to the system memory in favor of allocating more
space. If these performance gains are always good to take, they do not turn Python into an efficient programming
language.

An increase in memory consumption of around 20% is anticipated following the implementation of these changes on
CPython.
Further performance gains are already planned in versions 3.12 and later.

2. Better exception handling

Special work has been done on error management. It is now possible to add annotations on exceptions.

try:
raise ExceptionGroup("Exception Group", (
TypeErrorf'Type error"),
KeyError("Key error"),
ValueError("Value error"),
except* (ValueError, TypeError) as exc:
exc.add_note("Add more information about the error")
raise exc

except* KeyError as exc:


raise exc
Similarly, a new syntax is emerging. It is now possible to create groups of exceptions and break down the use of except
to catch certain exceptions contained in a group.

3. A more accurate traceback

The error messages returned by Python are now more precise and include the position of the error on the faulty line
of code. This function is very similar to what other modern languages can offer.
+--------------------------
I Traceback (most recent call last):
I File "test.py", line 5, in test
I assertx < 0
|AAAAAAAAAAAA

I AssertionError: assert 0 < 0


+--------------------------

4. Improved typing
As we know, Python is a dynamically typed language, which is not always appreciated by developers. The latest
Python updates have already started the integration of an optional type system. This release continues that trend by
adding more types like Self, Literalstring, Required, and NotRequired.

from typing import Self

class Foo:
def _init_ (self, x: str):
self.x = x

def bar(self, y: str) -> Self:


return Foo(y)

5. An update to the standard library

The standard Python library is not left out and is experiencing some changes.

TOML
First of all, the tomllib module is added to the standard library to parse TOML. This addition follows support for the
pyproject.toml file, added in a previous version of Python.
This library remains limited in terms of functionalities and has only one purpose: file parsing.

import tomllib
with open("pyproject.toml", "rb") as f:
data = tomllib.load(f)
print(data["project"]["name"])

AsyncIO
The asyncio library is also entitled to an update with the addition of Task Group to replace the use of the .gather()
method on asynchronous operations.
import asyncio
async def task 1():
print("Foo")
await asyncio.sleep(5)

async def task2():


print("Bar")
await asyncio.sleep(2)

async def main():


try:
async with asyncio.TaskGroupO as task_group:
task_group.create_task(task 1 ())
task_group.create_task(task2())
except* ValueError as exc:
print(exc.exceptions)

if_ name_ == "__ main_


asyncio.run(main())
This update makes the syntax more pleasant, but does not bring any other major changes to the library.

StrEnum

The StrEnum makes an appearance. It allows to automatically convert a character string into an Enum.

from enum import StrEnum, auto


class Foo(StrEnum):
BAR = auto()
print(Foo.BAR.value) # "bar"

Path
The Path.glob() method of pathlib now allows you to specify whether you only want to retrieve folders.

from pathlib import Path


p = Path("/Users/foobar/")
everything = p.glob("*")
dirs = p.glob("7")

6. Miscellaneous deprecation

Finally, this version brings a background cleanup and removes support for many legacy modules: aifc, chunk, msilib,
pipes, telnetlib, audioop, crypt, nis, sndhdr, uu, cgi, imghdr, nntplib, spwd, xdrlib, cgitb, mailcap, ossaudiodev,
sunau...

Some of these modules will not be removed from the standard library until Python 3.13. Others will simply be re­
placed by alternative solutions, more modern and better maintained, already present in the standard library.

In conclusion, if this update does not bring anything revolutionary, it continues the Python projects already launched
with regard to the improvement of the performances of CPython, the improvement of the error management and the
addition of solutions for typing requested by part of the community.

Chapter 3
Interacting with Python
Python is a flexible and dynamic language that you can use in different ways. You can use it interactively
when you simply want to test a code or a statement on a line-by-line basis or when youre exploring its
features. You can use it in script mode when you want to interpret an entire file of statements or applica­
tion program.
To use Python interactively, you can use either the Command Line window or the IDLE Development
Environment.

Command Line Interaction


The command line is the most straightforward way to work with Python. You can easily visualize how
Python works as it responds to every completed command entered on the

> > > prompt. It may not be the most preferred interaction with Python, but it is the simplest way to explore
how Python works.

Running Python
There are three different ways to start Python -
1. Interactive Interpreter
From Windows
Start-> All Programs -> Python 3.11 -> Python 3.11
2. Script from the Command-line
A Python script can be executed at command line by invoking the interpreter on your application, as in the
following -
C: >python script.py

3. Integrated Development Environment


You can run Python from a Graphical User Interface (GUI) environment as well, if you have a GUI applica­
tion on your system that supports Python.
Windows - PythonWin is the first Windows interface for Python and is an IDE with a GUL
From Windows
Start-> All Programs -> Python 3.11 -> IDLE
Note: If youre using GNU/Linux, UNIX, and Mac OS systems, you have to run the Terminal Tool and enter
the Python command to start your session.

We use commands to tell the computer what to do. When you want Python to do something for you, you
have to instruct it by entering commands that it is familiar with. Python will then translate these com­
mands to instructions that your computer or device can understand and execute.

To see how Python works, you can use the print command to print the universal program Hello, World!
Open Pythons command line.
At the >>>prompt, type the following: print(Hello, World!)
Press enter to tell Python that youre done with your command. Very quickly, the command line window
will display Hello, World! on the following line:

Type "help", "copyright", "credits" or "license" for more information.


»> print(”hello”>
hello
»>
Python responded correctly because you gave it a command in a format that it requires. To see how it
responds when you ask it to print the same string using a wrong syntax for the print command, type and
enter the following command on the Python command prompt:
Print(Hello, World!)
This is how Python will respond:
Syntax error: invalid syntax

Youll get syntax error messages whenever you enter invalid or incomplete statements. In this case, you
typed print with a capital letter which is a big no to a case-sensitive language like Python.

If youre just using Python interactively, you can do away with the print command entirely by just typing
your statement within quotes such as Hello, World!

Getting Help
Python has two closely-related help modes. One is the general help utility, the other is a help function that
provides the documentation on a specific object, module, function or class.

The help() Utility


Help is available through the help() function.
If you enter just help() you will enter the online help utility. This help utility allows you to explore the
Python documentation.
The interaction looks like this:
> > > help
Type help() for interactive help, or help(object) for help about object.
>>> help()

Help on a specific topic


If you enter help( object) for some object, you will be given help on that specific object. This help is dis­
played using a help viewer.
Youll enter something like this:
»> help("EXPRESSIONS")

Exiting Python
To exit from Python, you can type any of these commands:
quit()
exit()
Control-Z then press enter

IDLE: Pythons Integrated Development Environment (IDE)


The IDLE (Integrated Development and Learning Environment) tool is included in Pythons installation
package but you can choose to download more sophisticated third party IDEs.
The IDLE tool offers a more efficient platform to write your code and work interactively with Python. You
can access IDLE on the same folder where you found the command line icon or on the start menu. As soon
as you click on the IDLE icon, it will take you to the Python Shell window.
You can run a code in Python via the Python IDLE.
A quick way to find your Python IDLE on Windows is by clicking on the Start menu. You should then see the
IDLE under “Recently added”.

Recently added

|L IDLE (Python 3.9 64-bit)

|L Python 3.9 Module Docs (64-bit)

B? Python 3.9 Manuals (64-bit)


Once you click on the Python IDLE, you’ll see the Shell screen.

The Python Shell Window


The Python Shell Window has dropdown menus and a > > > prompt that you have seen earlier in the com­
mand line window. Here you can type and enter statements or expressions for evaluation in the same way
that you used the command line earlier. This time however, IDLES editing menu allows you to scroll back to
your previous commands, cut, copy, and paste previous statements and make modifications. IDLE is quite
a leap from the command line interaction.

The Python Shell window has the following menu items: File, Edit, Shell, Debug, Options, Windows, and
Help.
Python 3.9.0 Shell — □ X
File Edit Shell Debug Options Window Help
Pychon 3.9.0 (cags/v3.9.O:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927
64 bit (AMD64)] on Win32
Type "help", "copyright", "credits" or "license()" for more informati
on .
»> I

Ln: 3 Col: 4
The Shell and Debug menus provide capabilities you would find useful when creating larger programs.

The Shell menu allows you to restart the shell or search the shells log to find the most recent reset.
The Debug Menu has useful menu items for tracing the source file of an exception and highlighting the
erring line. The Debugger option will usher in an interactive debugger window that will allow you to step
through the running program. The Stack Viewer option displays the current Python stack through a new
window.

The Options menu allows you to configure IDLE to suit your Python working preferences.

The Help menu opens Python Help and documentation.

The File Menu


The items on the File menu allows you to create a new file, open an old file, open a module, and/or save your
session. When you click on the New File option, you will be taken to a new window, a simple and standard
text editor where you can type or edit your code. Initially, this file window is named untitled but its name
will soon change as you save your code.

The windows menu bar varies only slightly with the Shell Window. It doesnt have the Shell and Debug
menu found in the Shell Window but it introduces two new menus: the Run and the Format menu. When
you choose to Run your code on the file window, you can see the output on the Shell Window.

The Script Mode


When working in script mode, you wont automatically see results the way you would in interactive mood.
To see an output from a script, youll have to run the script and/or invoke the print() function within your
code.
Python 3.9.0 Shell — □ X
File | Edit Shell Debug Options Window Help

New File Ctrl*N :9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927


Open... Ctrl+O
_ .... ... .. "credits" or "license ()" for more informati
Open Module... Alt+M
Recent Files ►
Module Browser Alt*C
Path Browser

Save Ctrl+S
Save As... Ctrl*Shift*S
Save Copy As... Alt*Shift*S

Print Window Ctrl+P

Close Alt*F4
Exit Ctrl+Q

Click on File and then select New File (alternatively, you may use the keyboard shortcut of Ctrl+N):
You would now see the following “untitled” box, where you can type your Python code:
Random documents with unrelated
content Scribd suggests to you:
La potence, ainsi que l'arbre défendu du paradis terrestre, donne
la mort et la science.
La vérité dans un puits et la vérité dans le vin, signifient la même
chose: il ne faut dire son secret qu'à un homme sobre.
Les bons écrits sont comparables au vin: le bon sens en est la
force; et l'esprit, la saveur.
Le respect pour nous-mêmes, voilà la morale: la déférence pour
les autres, voilà les manières.
Les amoureux s'expriment fort bien quand ils parlent d'échanger
leurs cœurs. La passion enchanteresse de l'amour dénature
effectivement le caractère des deux sexes. Elle donne de l'esprit à la
bergère, de la douceur au berger; elle échange enfin entr'eux le
courage et la timidité.
Quand le malheur est suspendu sur ma tête, je m'écrie: Dieu,
préserve-m'en. Quand il me frappe: Dieu, soit loué.
Le courage et la modestie sont les deux vertus les moins
équivoques, parce que l'hypocrisie ne sauroit les imiter.
Elles ont encore cette propriété, qu'elles s'annoncent en nous par
la même couleur.
Les hommes sont comme les plantes: les unes aiment le soleil, et
les autres l'ombre.
Il y a deux sortes d'écrivains moraux: les uns font de l'homme un
ange et les autres une bête. Ils ont tous tort: l'un argumente du
meilleur, et l'autre du pire des hommes. Le docteur Young les
concilie ainsi: «Nous ne pouvons avoir une trop haute idée de notre
nature, et une trop basse de nous-mêmes.»
Les rois sont plus malheureux que leurs sujets: l'habitude
accoutume au mal-aise, tandis que la fatigue de régner devient
chaque jour plus pénible. Ce qui m'a le plus surpris dans l'histoire,
c'est d'y rencontrer si peu d'abdications. Une douzaine ou deux, tout
au plus, de rois sont descendus volontairement de leur trône: et
encore quelques-uns s'en sont repenti!
Le mensonge est la plus insupportable poltronerie. C'est craindre
les hommes et braver Dieu.
Les franc-penseurs sont généralement ceux qui ne pensent
jamais.
Zoroastre, selon Pline, rit le jour de sa naissance, et Thomas
Morus le jour de sa mort: quel est le plus extraordinaire des deux?
Il y a eu des femmes célèbres dans toutes les sectes
philosophiques; mais rien n'a égalé le mérite des pytagoriciennes: il
falloit se taire et garder le secret.
Solon privoit les pères de leur autorité sur les bâtards, par une
raison très-curieuse: ils avoient été pères pour leur plaisir, ils étoient
récompensés par le plaisir de l'avoir été.
Hucheson, grand mathématicien, damne ou sauve les hommes,
par des équations d'algèbre en plus et en moins. Il falloit que saint
Pierre, selon lui, sût bien les mathématiques; et je ne connois que
saint Mathieu, dans le ciel, qui, en sa qualité de financier put assister
à un pareil compte.
Je demandai à un ermite, en Italie, comment il pouvoit vivre seul,
dans une chaumière élevée sur la cîme d'une montagne, à un mille
de toute habitation; il me répondit aussitôt: La providence est à ma
porte.
Dans le monde, vous êtes sujet aux caprices de chaque
extravagant: dans votre bibliothèque, vous soumettez les hommes
célèbres aux vôtres.
Une bonne comparaison doit être aussi courte et aussi concise
que la déclaration d'amour que fait un roi.
J'ai connu un brave soldat, qui me confioit le secret de son
courage, en ces termes: Dans un combat, au premier feu, je me
figurois être un homme mort; je combattois, tout le long du jour,
dans cette idée, sans appercevoir seulement le danger. Mon illusion
ne cessoit que quand je rentrois dans ma tente: je revenois des
limbes; je vis encore; me disois-je!
J'admire la philosophie de celui qui pardonne; mais j'aime le
caractère de celui qui sent.
Au commencement du seizième siècle, un prêtre ayant trouvé
dans un auteur grec, ce passage: ονους εστιν αυλος, l'ame est
immatérielle, et ayant vu dans son lexicon que αυλος signifioit flûte,
il composa, dans un exercice académique, quinze argumens, tout au
moins, pour prouver que l'ame étoit un sifflet.
Les juifs envoyèrent des ambassadeurs à Cromwel, pour savoir
s'il n'étoit pas le vrai messie.
Le pape Jules II lisoit la Bible quand on lui apprit la défaite de
son armée par les Français: il la jeta par terre pour témoigner à Dieu
son ressentiment.
L'ancienne Rome se rendit la maîtresse, (ce mot est pire que
celui de maître) de l'univers, sous ses consuls, par la même méthode
que la nouvelle a continué d'employer sous ses pontifes. Le bien de
la république étoit le prétexte de Rome ancienne; le bien de l'église
est celui de la moderne. D'après ce principe, auquel les autres sont
subordonnés, tous les vices, l'oppression et la fausseté, quand ils
favorisent la domination, deviennent ou des vertus publiques, ou des
fraudes pieuses.
Par une loi des canons, si l'on accuse un cardinal de fornication, il
faut produire soixante-dix témoins: à ce compte, il doit caresser une
fille en plein marché, pour être convaincu.
Combien le système de l'amour platonique seroit beau, s'il
pouvoit se réaliser! que ses extases seroient pures et séraphiques!
deux cœurs fidèles, doucement agités dans la même sphère
d'attraction, le même sistole, le même diastole, sujets au même flux
et reflux, et se rapprochant toujours plus près l'un de l'autre, par la
compulsion la plus agréablement insensible, comme les asymptotes
d'une hyperbole, sans jamais coïncider ensemble et rencontrer le
point de contact!
Rien ne rappelle si puissamment notre ame que l'infortune. Les
fibres tendues se relâchent; alors l'ame égarée se retire en elle-
même, s'assied toute pensive, et admet en silence la salubrité des
réflexions. Si nous avons un ami, nous pensons aussitôt à lui; si
nous avons un bienfaiteur, ses bontés pressent alors sur notre cœur.
Grand Dieu! n'est-ce pas par cette raison, que ceux qui t'ont oublié
dans leur prospérité, reviennent à toi dans leurs chagrins? quand ils
abattent nos esprits affligés, à qui pouvons-nous plus sûrement
recourir qu'à toi, qui connois nos besoins, qui tiens en dépôt nos
larmes dans ton sein, qui vois nos moindres pensées, et qui entends
chaque soupir mélancolique qui échappe à notre découragement.
Vers le milieu du treizième siècle, et sous le pontificat de
Grégoire IX, il arriva un singulier événement. Le comte de Gleichen
fut fait prisonnier dans un combat contre les Sarrasins, et condamné
à l'esclavage. Comme il fut employé aux travaux des jardins du
sérail, la fille du Sultan le remarqua. Elle jugea qu'il étoit homme de
qualité, conçut de l'amour pour lui, et lui offrit de favoriser son
évasion s'il vouloit l'épouser. Il lui fit répondre qu'il étoit marié; ce
qui ne donna pas le moindre scrupule à la Princesse accoutumée au
rit de la pluralité des femmes. Ils furent bientôt d'accord, cinglèrent
et abordèrent à Venise. Le comte alla à Rome, et raconta à Grégoire
IX chaque particularité de son histoire. Le Pape, sur la promesse
qu'il lui fit de convertir la Sarrasine, lui donna des dispenses pour
garder ses deux femmes.
La première fut si transportée de joie à l'arrivée de son mari sous
quelque condition qu'il lui fût rendu, qu'elle acquiesça à tout, et
témoigna à sa bienfaitrice l'excès de sa reconnoissance. L'histoire
nous apprend que la Sarrasine n'eut point d'enfans, et qu'elle aima
d'amour maternel ceux de sa rivale. Quel dommage qu'elle ne
donnât pas le jour à un être qui lui ressemblât!
On montre, à Gleichen, le lit où ces trois rares individus
dormoient ensemble. Ils furent enterrés dans le même tombeau
chez les bénédictins de Pétersberg; et le comte qui survécut à ses
deux femmes, ordonna qu'on mît sur le sépulcre, qui fut ensuite le
sien, cette épitaphe qu'il avoit composée.
«Ci gissent deux femmes rivales, qui s'aimèrent comme des
sœurs, et qui m'aimèrent également. L'une abandonna Mahomet
pour suivre son époux, et l'autre courut se jeter dans les bras de la
rivale qui le lui rendoit. Unis par les liens de l'amour et du mariage,
nous n'avions qu'un lit nuptial pendant notre vie; et la même pierre
nous couvre après notre mort.»

Fin du Tome sixième et dernier.


TABLE
DES MATIÈRES
Contenues dans ce Volume.

Préface des lettres d'Yorick à Eliza. Page


3
Eloge d'Eliza Drapper par l'abbé Raynal. 5
Lettres d'Yorick à Eliza. 11
Préface du Traducteur des sermons choisis. 47
Sermon I. Le bonheur. 51
Sermon II. La maison de deuil et la maison de fête. 64
Sermon III. Le Prophète Elisée et la veuve de Sarepte. 78
Sermon IV. Le lévite et sa concubine. 100
Sermon V. Plaintes de Job sur les malheurs et la briéveté de
la vie. 117
Sermon VI. Le caractère de Semeï. 134
Sermon VII. Le pharisien et le publicain. 146
Sermon VIII. La philantropie recommandée. 158
Sermon IX. La conduite de Félix envers Saint-Paul. 174
Sermon X. Les abus de la conscience. 187
Sermon XI. Considérations sur l'histoire de Jacob. 205
Sermon XII. Les voies de la providence justifiées. 221
Sermon XIII. Lazare et l'homme riche. 234
Sermon XIV. Considérations sur les grâces accordées à la
nation. 250
Sermon XV. Le caractère d'Hérode. 264
Sermon XVI. Le temps et le hasard. 278
Lettres de Sterne. 289
Pensées et anecdotes. 419

Fin de la Table du Tome sixième.


Notes du transcripteur
On a conservé l'orthographe de l'original, avec ses
incohérences (par ex. horizon/horison, vide/vuide,
fidèle/fidele/fidelle, etc.), en corrigeant toutefois les erreurs
introduites par le typographes.
*** END OF THE PROJECT GUTENBERG EBOOK OEUVRES
COMPLÈTES, TOME 6 ***

Updated editions will replace the previous one—the old editions will
be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying
copyright royalties. Special rules, set forth in the General Terms of
Use part of this license, apply to copying and distributing Project
Gutenberg™ electronic works to protect the PROJECT GUTENBERG™
concept and trademark. Project Gutenberg is a registered trademark,
and may not be used if you charge for an eBook, except by following
the terms of the trademark license, including paying royalties for use
of the Project Gutenberg trademark. If you do not charge anything
for copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the free


distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only be


used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears,
or with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United States
and most other parts of the world at no cost and with almost no
restrictions whatsoever. You may copy it, give it away or re-use it
under the terms of the Project Gutenberg License included with this
eBook or online at www.gutenberg.org. If you are not located in the
United States, you will have to check the laws of the country where
you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is derived


from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is posted


with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning
of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute this


electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the Project
Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or providing


access to or distributing Project Gutenberg™ electronic works
provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™


electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for


the “Right of Replacement or Refund” described in paragraph 1.F.3,
the Project Gutenberg Literary Archive Foundation, the owner of the
Project Gutenberg™ trademark, and any other party distributing a
Project Gutenberg™ electronic work under this agreement, disclaim
all liability to you for damages, costs and expenses, including legal
fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR
NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR
BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL
NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of receiving
it, you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or
entity that provided you with the defective work may elect to provide
a replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.

1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation,


the trademark owner, any agent or employee of the Foundation,
anyone providing copies of Project Gutenberg™ electronic works in
accordance with this agreement, and any volunteers associated with
the production, promotion and distribution of Project Gutenberg™
electronic works, harmless from all liability, costs and expenses,
including legal fees, that arise directly or indirectly from any of the
following which you do or cause to occur: (a) distribution of this or
any Project Gutenberg™ work, (b) alteration, modification, or
additions or deletions to any Project Gutenberg™ work, and (c) any
Defect you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.

The Foundation’s business office is located at 809 North 1500 West,


Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many
small donations ($1 to $5,000) are particularly important to
maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws regulating


charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.
Project Gutenberg™ eBooks are often created from several printed
editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookgate.com

You might also like