• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python pager.pager函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中sage.misc.pager.pager函数的典型用法代码示例。如果您正苦于以下问题:Python pager函数的具体用法?Python pager怎么用?Python pager使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了pager函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: usage

    def usage(self, use_pager=True):
        """
        Returns the basic description of using the Tachyon raytracer (simply what is returned by running tachyon with no input).  The output is paged unless use_pager=False.

        TESTS::

            sage: from sage.interfaces.tachyon import TachyonRT
            sage: t = TachyonRT()
            sage: t.usage(use_pager=False)
            Tachyon Parallel/Multiprocessor Ray Tracer   Version...
        """
        r = os.popen('tachyon').read()
        if use_pager == True:
            pager()(r)
        else:
            print r
开发者ID:bgxcpku,项目名称:sagelib,代码行数:16,代码来源:tachyon.py


示例2: help

    def help(self, string):
        """
        Display Giac help about string.

        This is the same as typing "?string" in the Giac console.

        INPUT:

        -  ``string`` -- a string to search for in the giac help system

        EXAMPLES::

            sage: giac.help('Psi')         # not tested - depends of giac and $LANG
            Psi(a,n)=nth-derivative of the function DiGamma ([email protected]) at point a (Psi(a,0)=Psi(a))...
        """
        pager()(self._help(string))
开发者ID:mcognetta,项目名称:sage,代码行数:16,代码来源:giac.py


示例3: help

    def help(self, str):
        """
        Display Maple help about str. This is the same as typing "?str" in
        the Maple console.

        INPUT:

        -  ``str`` - a string to search for in the maple help
           system

        EXAMPLES::

            sage: maple.help('digamma') #not tested
            Psi - the Digamma and Polygamma functions
            ...
        """
        pager()(self._help(str))
开发者ID:sageb0t,项目名称:testsage,代码行数:17,代码来源:maple.py


示例4: source

    def source(self, s):
        """
        Display the Maple source (if possible) about s. This is the same as
        returning the output produced by the following Maple commands:

        interface(verboseproc=2): print(s)

        INPUT:

        -  ``s`` - a string representing the function whose
           source code you want

        EXAMPLES::

            sage: maple.source('curry')  #not tested
            p -> subs('_X' = args[2 .. nargs], () -> p(_X, args))
        """
        try:
            pager()(self._source(s))
        except Exception:
            pager()('No source code could be found.')
开发者ID:sageb0t,项目名称:testsage,代码行数:21,代码来源:maple.py


示例5: usage

 def usage(self):
     r = os.popen('povray').read()
     pager()(r)
开发者ID:CETHop,项目名称:sage,代码行数:3,代码来源:povray.py


示例6: help

    def help(self, use_pager=True):
        """
        Prints (pages) the help file written by John Stone describing scene files for Tachyon.  The output is paged unless use_pager=False. 

        TESTS::

            sage: from sage.interfaces.tachyon import TachyonRT
            sage: t = TachyonRT()
            sage: t.help(use_pager=False)
            This help, which was written by John Stone, describes ...
        """
        s = r"""
This help, which was written by John Stone, describes how to create
scene files.
        
At the present time, scene description files are very simple.  
The parser can't handle multiple file scene descriptions, although they
may be added in the future.  Most of the objects and their scene description
are closely related to the RAY API 
\emph{(See the API docs for additional info.)}

\subsection{Basic Scene Requirements}
  Unlike some other ray tracers out there, RAY requires that you 
specify most of the scene parameters in the scene description file itself.
If users would rather specify some of these parameters at the command line,
then I may add that feature in the future.  
A scene description file contains keywords, and values associated or grouped
with a keyword.  All keywords can be in caps, lower case, or mixed case
for the convenience of the user.  File names and texture names are 
normally case-sensitive, although the behavior for file names is 
operating system-dependent.  All values are either character strings, or
floating point numbers.  In some cases, the presence of one keyword will
require additional keyword / value pairs. 

  At the moment there are several keywords with values, 
that must appear in every scene description file.  
Every scene description file must begin with the 
{\bf BEGIN\_SCENE} keyword, and end with the {\bf END\_SCENE} keyword.
All definitions and declarations of any kind must be inside the 
{\bf BEGIN\_SCENE}, {\bf END\_SCENE} pair.
The {\bf RESOLUTION} keyword is followed by an x resolution
and a y resolution in terms of pixels on each axis.  There are currently 
no limits placed on the resolution of an output image other than the
computer's available memory and reasonable execution time.
An example of a simple scene description skeleton is show below:
\begin{verbatim}
BEGIN_SCENE
  RESOLUTION 1024 1024 
...
...  Camera definition..
...
...  Other objects, etc..
...

END_SCENE
\end{verbatim}

\subsection{Camera and viewing parameters}
  One of the most important parts of any scene, is the camera position and
orientation.  Having a good angle on a scene can make the difference between
an average looking scene and a strikingly interesting one.  There may be
multiple camera definitions in a scene file, but the last camera definition
overrides all previous definitions.
There are several parameters that control the camera in \RAY, 
{\bf PROJECTION}, {\bf ZOOM}, {\bf ASPECTRATIO}, {\bf ANTIALIASING},
 {\bf CENTER}, {\bf RAYDEPTH}, {\bf VIEWDIR}, and {\bf UPDIR}.  

The first and last keywords required in the definition of a camera are the 
{\bf CAMERA} and {\bf END\_CAMERA} keywords.  The {\bf PROJECTION} keyword 
is optional, the remaining camera keywords are required, and must be 
written in the sequence they are listed in the examples in this section.

\subsubsection{Camera projection modes}
  The {\bf PROJECTION} keyword must be followed by one of the supported
camera projection mode identifiers {\bf PERSPECTIVE}, {\bf PERSPECTIVE_DOF}, 
{\bf ORTHOGRAPHIC}, or {\bf FISHEYE}.  The {\bf FISHEYE} projection mode 
requires two extra parameters {\bf FOCALLENGTH} and {\bf APERTURE} 
which precede the regular camera options.

\begin{verbatim}
Camera
  projection perspective_dof
  focallength 0.75
  aperture 0.02
  Zoom 0.666667
  Aspectratio 1.000000
  Antialiasing 128
  Raydepth 30
  Center  0.000000 0.000000 -2.000000
  Viewdir -0.000000 -0.000000 2.000000
  Updir   0.000000 1.000000 -0.000000
End_Camera
\end{verbatim}

\subsubsection{Common camera parameters}
  The {\bf ZOOM} parameter controls the camera in a way similar to a 
telephoto lens on a 35mm camera.  A zoom value of 1.0 is standard, 
with a 90 degree field of view.  By changing the zoom factor to 2.0, 
the relative size of any feature in the frame is twice as big, while 
the field of view is decreased slightly.  The zoom effect is 
#.........这里部分代码省略.........
开发者ID:bgxcpku,项目名称:sagelib,代码行数:101,代码来源:tachyon.py


示例7: help

    def help(self, topic, pager=True):
        r"""
        Print help on the given topic.

        INPUT:

        - ``topic`` -- string

        EXAMPLES::

            sage: gap3.help('help', pager=False)           #optional - gap3
            Help _______________________________________________________...
            <BLANKLINE>
            This  section describes  together with  the following sectio...
            help system.  The help system lets you read the manual inter...

        ::

            sage: gap3.help('SymmetricGroup', pager=False) #optional - gap3
            no section with this name was found

        TESTS::

            sage: m = gap3([[1,2,3],[4,5,6]]); m           #optional - gap3
            [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]
            sage: gap3.help('help', pager=False)           #optional - gap3
            Help _______________________________________________________...
            sage: m                                        #optional - gap3
            [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]
            sage: m.Print()                                #optional - gap3
            [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]
            sage: gap3.help('Group', pager=False)          #optional - gap3
            Group ______________________________________________________...
            sage: m                                        #optional - gap3
            [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]
            sage: m.Print()                                #optional - gap3
            [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]
        """

        import pexpect
        if self._expect is None:
            self._start()
        E = self._expect
        helptext = []

        # we request the help document
        E.sendline("? %s" % topic)
        # it seems necessary to skip TWO echoes (as is done in the GAP4 interface)
        E.expect("\r\n")
        E.expect("\r\n")

        # next we process the help document; translating special characters, etc.
        while True:
            try:
                x = E.expect_list(self._compiled_full_pattern, timeout=2)
            except pexpect.TIMEOUT:
                break
            if x == 1:
                # matched @@; replace with @
                helptext.append('@')
                helptext.append(E.before)
            elif x == 2:
                # matched a special char; convert and insert
                helptext.append(chr(ord(E.after[1:2])-ord('A')+1))
                helptext.append(E.before)
            elif x == 10:
                # matched @n (normal input mode); it seems we're done
                break
            elif x==11:
                # matched @r (echoing input); skip to end of line
                E.expect_list(self._compiled_small_pattern)

        # merge the help text into one string and print it.
        helptext = "".join(helptext).strip()
        if pager is True:
            import sage.misc.pager
            pager.pager()(helptext)
        else:
            print helptext
开发者ID:bukzor,项目名称:sage,代码行数:79,代码来源:gap3.py



注:本文中的sage.misc.pager.pager函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python prandom.randint函数代码示例发布时间:2022-05-27
下一篇:
Python mrange.mrange函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap