Commit f84eb5a3 authored by Éric Araujo's avatar Éric Araujo

Branch merge

parents b9a428d5 5ab47769
...@@ -719,7 +719,7 @@ cookies (assumes Unix/Netscape convention for location of the cookies file):: ...@@ -719,7 +719,7 @@ cookies (assumes Unix/Netscape convention for location of the cookies file)::
import os, http.cookiejar, urllib.request import os, http.cookiejar, urllib.request
cj = http.cookiejar.MozillaCookieJar() cj = http.cookiejar.MozillaCookieJar()
cj.load(os.path.join(os.environ["HOME"], ".netscape/cookies.txt")) cj.load(os.path.join(os.path.expanduser("~"), ".netscape", "cookies.txt"))
opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj)) opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))
r = opener.open("http://example.com/") r = opener.open("http://example.com/")
......
...@@ -197,7 +197,7 @@ normally be executed automatically during interactive sessions from the user's ...@@ -197,7 +197,7 @@ normally be executed automatically during interactive sessions from the user's
import os import os
import readline import readline
histfile = os.path.join(os.environ["HOME"], ".pyhist") histfile = os.path.join(os.path.expanduser("~"), ".pyhist")
try: try:
readline.read_history_file(histfile) readline.read_history_file(histfile)
except IOError: except IOError:
......
...@@ -206,31 +206,21 @@ always available. ...@@ -206,31 +206,21 @@ always available.
The struct sequence *flags* exposes the status of command line flags. The The struct sequence *flags* exposes the status of command line flags. The
attributes are read only. attributes are read only.
+------------------------------+------------------------------------------+ ============================= =============================
| attribute | flag | attribute flag
+==============================+==========================================+ ============================= =============================
| :const:`debug` | -d | :const:`debug` :option:`-d`
+------------------------------+------------------------------------------+ :const:`division_warning` :option:`-Q`
| :const:`division_warning` | -Q | :const:`inspect` :option:`-i`
+------------------------------+------------------------------------------+ :const:`interactive` :option:`-i`
| :const:`inspect` | -i | :const:`optimize` :option:`-O` or :option:`-OO`
+------------------------------+------------------------------------------+ :const:`dont_write_bytecode` :option:`-B`
| :const:`interactive` | -i | :const:`no_user_site` :option:`-s`
+------------------------------+------------------------------------------+ :const:`no_site` :option:`-S`
| :const:`optimize` | -O or -OO | :const:`ignore_environment` :option:`-E`
+------------------------------+------------------------------------------+ :const:`verbose` :option:`-v`
| :const:`dont_write_bytecode` | -B | :const:`bytes_warning` :option:`-b`
+------------------------------+------------------------------------------+ ============================= =============================
| :const:`no_user_site` | -s |
+------------------------------+------------------------------------------+
| :const:`no_site` | -S |
+------------------------------+------------------------------------------+
| :const:`ignore_environment` | -E |
+------------------------------+------------------------------------------+
| :const:`verbose` | -v |
+------------------------------+------------------------------------------+
| :const:`bytes_warning` | -b |
+------------------------------+------------------------------------------+
.. data:: float_info .. data:: float_info
......
...@@ -123,10 +123,7 @@ interpreter. :: ...@@ -123,10 +123,7 @@ interpreter. ::
# bound to the Esc key by default (you can change it - see readline docs). # bound to the Esc key by default (you can change it - see readline docs).
# #
# Store the file in ~/.pystartup, and set an environment variable to point # Store the file in ~/.pystartup, and set an environment variable to point
# to it: "export PYTHONSTARTUP=/home/user/.pystartup" in bash. # to it: "export PYTHONSTARTUP=~/.pystartup" in bash.
#
# Note that PYTHONSTARTUP does *not* expand "~", so you have to put in the
# full path to your home directory.
import atexit import atexit
import os import os
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment