[perl-python] 20050113 looking up syntax

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Xah Lee

    #1

    [perl-python] 20050113 looking up syntax

    while programing in Python, one can lookup syntax or info for keywords
    or modules within Python.

    In the command line, type

    python

    to get into the python interactive program. then type
    help()[color=blue]
    >From there one can type any keyword or module name to find out the[/color]
    syntax or info. Everything is self-contained and self-explanatory.

    to exit help, type control-d.

    if you haven't tried already, you can type 1+1 while running python.
    The result will be displayed interactively. So in this way, Python can
    be used as a calculator.

    ---------------------

    for perl syntax lookup, use perldoc in the command line. For example:
    perldoc perl

    use 'perldoc -f functionName' for specific function. example:
    perldoc -f qq

    note that keywords cannot be looked up with -f. For basic keywords like

    if, while..., use
    perldoc perlop

    Master 'perldoc perl' as a way to get familiar of what info are
    available and what subroutine or aspect of perl is in what section of
    the documentation associated with what documentation name abbreviation.

    Master 'perldoc perldoc' to know all its power of options and
    flexibility. If you use emacs, in particular you want to add the -t
    option. Master the unix text editor vi to learn the navigation system
    of perldoc. The basics are: control-f for page down, control-v for page

    up, q for exit. Also, one may wish to peruse 'perldoc perlfaq' to
    acquaint yourself about the preamble of nine volumes of perl's FAQ.

    ---------------------------

    Note: this post is from the Perl-Python a-day mailing list at
    Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!

    to subscribe, send an email to perl-python-subscribe@yahoo groups.com
    if you are reading it on a web page, program examples may not run
    because they've been changed by yahoo.com or google.com.
    Xah
    xah@xahlee.org


  • Peter Hansen

    #2
    Re: [perl-python] 20050113 looking up syntax

    Xah Lee wrote:
    [snip]
    [color=blue]
    > Note: this post is from the Perl-Python a-day mailing list at
    > http://groups.yahoo.com/group/perl-python/
    > to subscribe, send an email to perl-python-subscribe@yahoo groups.com[/color]

    So why duplicate the posts by posting them to the newsgroups?
    Now that you've advertised the mailing list (and thank you,
    I'll be sure to hurry off now and subscribe) there's no longer
    any reason to post to the newsgroups, is there? Please?

    -Peter

    Comment

    • Jürgen Exner

      #3
      Re: [perl-python] 20050113 looking up syntax

      Xah Lee wrote:[color=blue]
      > ---------------------
      >
      > for perl syntax lookup, use perldoc in the command line. For example:
      > perldoc perl[/color]

      Wrong. That command will give you a high-level overview of Perl but tell you
      nothing about the syntax.
      To lookup the Perl syntax you would have to use

      perldoc perlsyn
      [color=blue]
      > use 'perldoc -f functionName' for specific function. example:
      > perldoc -f qq[/color]

      BS. That will tell you what a function does, it doesn't tell you anything at
      all about the syntax of Perl.
      BTW: Why on earth are you using qq() as an example? That doc page just
      points you to 'perldoc perlop'.
      [color=blue]
      > note that keywords cannot be looked up with -f. For basic keywords
      > like
      >
      > if, while..., use
      > perldoc perlop[/color]

      BS. What gave you the idea that keywords were operators? Of course keywords
      can be found where they belong, in the syntax definition of the language,
      but not in the operator section of the documentation.

      Why don't you just stop posting this nonsense?

      jue



      Comment

      • Istvan Albert

        #4
        Re: [perl-python] 20050113 looking up syntax

        Jürgen Exner wrote:
        [color=blue]
        > Why don't you just stop posting this nonsense?[/color]

        He will, fairly soon. I'm suspecting that the original
        intent behind these posts was to stir up a perl vs python
        flamewar. That is unlikely to materialize since the
        poster does not seem to understand neither of these
        languages.

        I.

        Comment

        • Erik Max Francis

          #5
          Re: [perl-python] 20050113 looking up syntax

          Peter Hansen wrote:
          [color=blue]
          > So why duplicate the posts by posting them to the newsgroups?[/color]

          Because he's a well-known pest.

          --
          Erik Max Francis && max@alcyone.com && http://www.alcyone.com/max/
          San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
          Yes I'm / Learning from falling / Hard lessons
          -- Lamya

          Comment

          Working...