mirror of
https://github.com/python/cpython.git
synced 2025-09-18 06:30:38 +00:00
Remove things specific to the old Macintosh, and spell "Mac OS X" consistently.
This commit is contained in:
parent
f2a2c796e3
commit
9af9498c6e
34 changed files with 189 additions and 205 deletions
|
@ -23,7 +23,7 @@ You could write a Unix shell script or Windows batch files for some of these
|
|||
tasks, but shell scripts are best at moving around files and changing text data,
|
||||
not well-suited for GUI applications or games. You could write a C/C++/Java
|
||||
program, but it can take a lot of development time to get even a first-draft
|
||||
program. Python is simpler to use, available on Windows, MacOS X, and Unix
|
||||
program. Python is simpler to use, available on Windows, Mac OS X, and Unix
|
||||
operating systems, and will help you get the job done more quickly.
|
||||
|
||||
Python is simple to use, but it is a real programming language, offering much
|
||||
|
|
|
@ -237,15 +237,15 @@ automatically added to the end. ``'r+'`` opens the file for both reading and
|
|||
writing. The *mode* argument is optional; ``'r'`` will be assumed if it's
|
||||
omitted.
|
||||
|
||||
On Windows and the Macintosh, ``'b'`` appended to the mode opens the file in
|
||||
binary mode, so there are also modes like ``'rb'``, ``'wb'``, and ``'r+b'``.
|
||||
Windows makes a distinction between text and binary files; the end-of-line
|
||||
characters in text files are automatically altered slightly when data is read or
|
||||
written. This behind-the-scenes modification to file data is fine for ASCII
|
||||
text files, but it'll corrupt binary data like that in :file:`JPEG` or
|
||||
:file:`EXE` files. Be very careful to use binary mode when reading and writing
|
||||
such files. On Unix, it doesn't hurt to append a ``'b'`` to the mode, so
|
||||
you can use it platform-independently for all binary files.
|
||||
On Windows, ``'b'`` appended to the mode opens the file in binary mode, so there
|
||||
are also modes like ``'rb'``, ``'wb'``, and ``'r+b'``. Windows makes a
|
||||
distinction between text and binary files; the end-of-line characters in text
|
||||
files are automatically altered slightly when data is read or written. This
|
||||
behind-the-scenes modification to file data is fine for ASCII text files, but
|
||||
it'll corrupt binary data like that in :file:`JPEG` or :file:`EXE` files. Be
|
||||
very careful to use binary mode when reading and writing such files. On Unix,
|
||||
it doesn't hurt to append a ``'b'`` to the mode, so you can use it
|
||||
platform-independently for all binary files.
|
||||
|
||||
|
||||
.. _tut-filemethods:
|
||||
|
|
|
@ -157,9 +157,9 @@ shell scripts, by putting the line ::
|
|||
(assuming that the interpreter is on the user's :envvar:`PATH`) at the beginning
|
||||
of the script and giving the file an executable mode. The ``#!`` must be the
|
||||
first two characters of the file. On some platforms, this first line must end
|
||||
with a Unix-style line ending (``'\n'``), not a Mac OS (``'\r'``) or Windows
|
||||
(``'\r\n'``) line ending. Note that the hash, or pound, character, ``'#'``, is
|
||||
used to start a comment in Python.
|
||||
with a Unix-style line ending (``'\n'``), not a Windows (``'\r\n'``) line
|
||||
ending. Note that the hash, or pound, character, ``'#'``, is used to start a
|
||||
comment in Python.
|
||||
|
||||
The script can be given an executable mode, or permission, using the
|
||||
:program:`chmod` command::
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue