[perl-python] 20050113 looking up syntax

Discussion in 'Python' started by Xah Lee, Jan 14, 2005.

  1. Xah Lee

    Xah Lee Guest

    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()
    >From there one can type any keyword or module name to find out the

    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
    http://groups.yahoo.com/group/perl-python/
    to subscribe, send an email to
    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

    http://xahlee.org/PageTwo_dir/more.html
     
    Xah Lee, Jan 14, 2005
    #1
    1. Advertising

  2. Xah Lee

    Peter Hansen Guest

    Xah Lee wrote:
    [snip]

    > 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


    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
     
    Peter Hansen, Jan 14, 2005
    #2
    1. Advertising

  3. Xah Lee wrote:
    > ---------------------
    >
    > for perl syntax lookup, use perldoc in the command line. For example:
    > perldoc perl


    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

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


    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'.

    > note that keywords cannot be looked up with -f. For basic keywords
    > like
    >
    > if, while..., use
    > perldoc perlop


    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
     
    Jürgen Exner, Jan 14, 2005
    #3
  4. Jürgen Exner wrote:

    > Why don't you just stop posting this nonsense?


    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.
     
    Istvan Albert, Jan 14, 2005
    #4
  5. Peter Hansen wrote:

    > So why duplicate the posts by posting them to the newsgroups?


    Because he's a well-known pest.

    --
    Erik Max Francis && && 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
     
    Erik Max Francis, Jan 15, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gabriele renzi
    Replies:
    2
    Views:
    238
    gabriele renzi
    Dec 31, 2005
  2. Ken Bloom
    Replies:
    3
    Views:
    242
  3. Good Night Moon
    Replies:
    9
    Views:
    315
    Rick DeNatale
    Jul 25, 2007
  4. Andrew Crook
    Replies:
    2
    Views:
    108
    Andrew Crook
    Sep 6, 2003
  5. Xah Lee
    Replies:
    2
    Views:
    97
    Jürgen Exner
    Jan 14, 2005
Loading...

Share This Page