晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /proc/thread-self/root/usr/share/doc/python2-docs/html/_sources/library/ |
Upload File : |
:mod:`gl` --- *Graphics Library* interface
==========================================
.. module:: gl
:platform: IRIX
:synopsis: Functions from the Silicon Graphics Graphics Library.
:deprecated:
.. deprecated:: 2.6
The :mod:`gl` module has been removed in Python 3.
This module provides access to the Silicon Graphics *Graphics Library*. It is
available only on Silicon Graphics machines.
.. warning::
Some illegal calls to the GL library cause the Python interpreter to dump
core. In particular, the use of most GL calls is unsafe before the first
window is opened.
The module is too large to document here in its entirety, but the following
should help you to get started. The parameter conventions for the C functions
are translated to Python as follows:
* All (short, long, unsigned) int values are represented by Python integers.
* All float and double values are represented by Python floating point numbers.
In most cases, Python integers are also allowed.
* All arrays are represented by one-dimensional Python lists. In most cases,
tuples are also allowed.
* All string and character arguments are represented by Python strings, for
instance, ``winopen('Hi There!')`` and ``rotate(900, 'z')``.
* All (short, long, unsigned) integer arguments or return values that are only
used to specify the length of an array argument are omitted. For example, the C
call ::
lmdef(deftype, index, np, props)
is translated to Python as ::
lmdef(deftype, index, props)
* Output arguments are omitted from the argument list; they are transmitted as
function return values instead. If more than one value must be returned, the
return value is a tuple. If the C function has both a regular return value (that
is not omitted because of the previous rule) and an output argument, the return
value comes first in the tuple. Examples: the C call ::
getmcolor(i, &red, &green, &blue)
is translated to Python as ::
red, green, blue = getmcolor(i)
The following functions are non-standard or have special argument conventions:
.. function:: varray(argument)
Equivalent to but faster than a number of ``v3d()`` calls. The *argument* is a
list (or tuple) of points. Each point must be a tuple of coordinates ``(x, y,
z)`` or ``(x, y)``. The points may be 2- or 3-dimensional but must all have the
same dimension. Float and int values may be mixed however. The points are always
converted to 3D double precision points by assuming ``z = 0.0`` if necessary (as
indicated in the man page), and for each point ``v3d()`` is called.
.. XXX the argument-argument added
.. function:: nvarray()
Equivalent to but faster than a number of ``n3f`` and ``v3f`` calls. The
argument is an array (list or tuple) of pairs of normals and points. Each pair
is a tuple of a point and a normal for that point. Each point or normal must be
a tuple of coordinates ``(x, y, z)``. Three coordinates must be given. Float and
int values may be mixed. For each pair, ``n3f()`` is called for the normal, and
then ``v3f()`` is called for the point.
.. function:: vnarray()
Similar to ``nvarray()`` but the pairs have the point first and the normal
second.
.. function:: nurbssurface(s_k, t_k, ctl, s_ord, t_ord, type)
Defines a nurbs surface. The dimensions of ``ctl[][]`` are computed as follows:
``[len(s_k) - s_ord]``, ``[len(t_k) - t_ord]``.
.. XXX s_k[], t_k[], ctl[][]
.. function:: nurbscurve(knots, ctlpoints, order, type)
Defines a nurbs curve. The length of ctlpoints is ``len(knots) - order``.
.. function:: pwlcurve(points, type)
Defines a piecewise-linear curve. *points* is a list of points. *type* must be
``N_ST``.
.. function:: pick(n)
select(n)
The only argument to these functions specifies the desired size of the pick or
select buffer.
.. function:: endpick()
endselect()
These functions have no arguments. They return a list of integers representing
the used part of the pick/select buffer. No method is provided to detect buffer
overrun.
Here is a tiny but complete example GL program in Python::
import gl, GL, time
def main():
gl.foreground()
gl.prefposition(500, 900, 500, 900)
w = gl.winopen('CrissCross')
gl.ortho2(0.0, 400.0, 0.0, 400.0)
gl.color(GL.WHITE)
gl.clear()
gl.color(GL.RED)
gl.bgnline()
gl.v2f(0.0, 0.0)
gl.v2f(400.0, 400.0)
gl.endline()
gl.bgnline()
gl.v2f(400.0, 0.0)
gl.v2f(0.0, 400.0)
gl.endline()
time.sleep(5)
main()
.. seealso::
`PyOpenGL: The Python OpenGL Binding <http://pyopengl.sourceforge.net/>`_
.. index::
single: OpenGL
single: PyOpenGL
An interface to OpenGL is also available; see information about the **PyOpenGL**
project online at http://pyopengl.sourceforge.net/. This may be a better option
if support for SGI hardware from before about 1996 is not required.
:mod:`DEVICE` --- Constants used with the :mod:`gl` module
==========================================================
.. module:: DEVICE
:platform: IRIX
:synopsis: Constants used with the gl module.
:deprecated:
.. deprecated:: 2.6
The :mod:`DEVICE` module has been removed in Python 3.
This modules defines the constants used by the Silicon Graphics *Graphics
Library* that C programmers find in the header file ``<gl/device.h>``. Read the
module source file for details.
:mod:`GL` --- Constants used with the :mod:`gl` module
======================================================
.. module:: GL
:platform: IRIX
:synopsis: Constants used with the gl module.
:deprecated:
.. deprecated:: 2.6
The :mod:`GL` module has been removed in Python 3.
This module contains constants used by the Silicon Graphics *Graphics Library*
from the C header file ``<gl/gl.h>``. Read the module source file for details.