Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
8fab8cf2
Commit
8fab8cf2
authored
Mar 08, 1998
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Logical markup.
parent
b991f8d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
14 deletions
+16
-14
Doc/lib/libuser.tex
Doc/lib/libuser.tex
+8
-7
Doc/libuser.tex
Doc/libuser.tex
+8
-7
No files found.
Doc/lib/libuser.tex
View file @
8fab8cf2
...
...
@@ -17,13 +17,14 @@ that wishes to use the mechanism must execute the statement
import user
\end{verbatim}
The
\
cod
e
{
user
}
module looks for a file
\file
{
.pythonrc.py
}
in the user's
The
\
modul
e
{
user
}
module looks for a file
\file
{
.pythonrc.py
}
in the user's
home directory and if it can be opened, exececutes it (using
\code
{
execfile()
}
) in its own (i.e. the module
\code
{
user
}
's) global
namespace. Errors during this phase are not caught; that's up to the
program that imports the
\code
{
user
}
module, if it wishes. The home
directory is assumed to be named by the
\code
{
HOME
}
environment
variable; if this is not set, the current directory is used.
\function
{
execfile()
}
\bifuncindex
{
execfile
}
) in its own (i.e. the
module
\module
{
user
}
's) global namespace. Errors during this phase
are not caught; that's up to the program that imports the
\module
{
user
}
module, if it wishes. The home directory is assumed to
be named by the
\code
{
HOME
}
environment variable; if this is not set,
the current directory is used.
The user's
\file
{
.pythonrc.py
}
could conceivably test for
\code
{
sys.version
}
if it wishes to do different things depending on
...
...
@@ -37,7 +38,7 @@ generally not a good idea.
A suggestion for programmers who wish to use this mechanism: a simple
way to let users specify options for your package is to have them
define variables in their
\file
{
.pythonrc.py
}
file that you test in
your module. For example, a module
\
cod
e
{
spam
}
that has a verbosity
your module. For example, a module
\
modul
e
{
spam
}
that has a verbosity
level can look for a variable
\code
{
user.spam
_
verbose
}
, as follows:
\begin{verbatim}
...
...
Doc/libuser.tex
View file @
8fab8cf2
...
...
@@ -17,13 +17,14 @@ that wishes to use the mechanism must execute the statement
import user
\end{verbatim}
The
\
cod
e
{
user
}
module looks for a file
\file
{
.pythonrc.py
}
in the user's
The
\
modul
e
{
user
}
module looks for a file
\file
{
.pythonrc.py
}
in the user's
home directory and if it can be opened, exececutes it (using
\code
{
execfile()
}
) in its own (i.e. the module
\code
{
user
}
's) global
namespace. Errors during this phase are not caught; that's up to the
program that imports the
\code
{
user
}
module, if it wishes. The home
directory is assumed to be named by the
\code
{
HOME
}
environment
variable; if this is not set, the current directory is used.
\function
{
execfile()
}
\bifuncindex
{
execfile
}
) in its own (i.e. the
module
\module
{
user
}
's) global namespace. Errors during this phase
are not caught; that's up to the program that imports the
\module
{
user
}
module, if it wishes. The home directory is assumed to
be named by the
\code
{
HOME
}
environment variable; if this is not set,
the current directory is used.
The user's
\file
{
.pythonrc.py
}
could conceivably test for
\code
{
sys.version
}
if it wishes to do different things depending on
...
...
@@ -37,7 +38,7 @@ generally not a good idea.
A suggestion for programmers who wish to use this mechanism: a simple
way to let users specify options for your package is to have them
define variables in their
\file
{
.pythonrc.py
}
file that you test in
your module. For example, a module
\
cod
e
{
spam
}
that has a verbosity
your module. For example, a module
\
modul
e
{
spam
}
that has a verbosity
level can look for a variable
\code
{
user.spam
_
verbose
}
, as follows:
\begin{verbatim}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment