Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80257

Understanding "help" command description syntax - explanation needed

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <webmailgroups@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; '"this': 0.03; 'syntax': 0.04; 'beginner': 0.05; 'i?m': 0.05; 'odd': 0.07; 'suppose': 0.07; 'subject:help': 0.08; 'string': 0.09; '[1,': 0.09; 'can?t': 0.09; 'seen,': 0.09; 'subject:command': 0.09; 'way:': 0.09; 'you?ve': 0.09; 'python': 0.11; 'language,': 0.12; '-&gt;': 0.16; 'all?': 0.16; 'command,': 0.16; 'examples?': 0.16; 'googled': 0.16; 'googling': 0.16; 'mean,': 0.16; 'new[,': 0.16; 'number?': 0.16; 'project)': 0.16; 'subject:description': 0.16; 'all.': 0.16; 'everyone,': 0.19; 'it?s': 0.19; 'written': 0.21; 'help.': 0.21; 'command': 0.22; 'example': 0.22; 'print': 0.22; 'finally,': 0.24; 'instance,': 0.24; 'earlier': 0.24; 'question': 0.24; 'purposes': 0.26; 'this:': 0.26; 'function': 0.29; 'appreciated.': 0.29; 'list:': 0.30; "i'm": 0.30; 'getting': 0.31; '(maybe': 0.31; 'parameters.': 0.31; 'sites.': 0.31; 'skip:? 10': 0.33; 'problem': 0.35; 'knowledge': 0.35; "can't": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'url:rec-html40': 0.35; 'really': 0.36; 'idle': 0.36; 'skip:> 10': 0.36; "didn't": 0.36; 'charset :us-ascii': 0.36; 'thanks': 0.36; "i'll": 0.36; 'url:org': 0.36; 'url:microsoft': 0.37; 'list': 0.37; 'clear': 0.37; 'message- id:@gmail.com': 0.38; 'skip:& 10': 0.38; 'question,': 0.38; 'subject:needed': 0.38; 'url:office': 0.38; 'to:addr:python-list': 0.38; 'url:schemas': 0.38; 'url:omml': 0.39; 'url:2004': 0.39; 'skip:& 20': 0.39; "couldn't": 0.39; 'subject:" ': 0.39; 'use.': 0.39; 'url:12': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'even': 0.60; 'skip:u 10': 0.60; 'numbers': 0.61; 'range': 0.61; "you've": 0.63; 'more': 0.64; 'different': 0.65; 'here': 0.66; 'skip:w 30': 0.69; 'received:109': 0.72; 'obvious': 0.74; 'introduce': 0.78; '^_^': 0.84; 'examples.': 0.84; 'that?s': 0.84; 'contents.': 0.91; 'write:': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type :thread-index:content-language; bh=YmNKoAo270uZyfLboyPcMvXdrNyvVXiD3exQUzYcR5w=; b=WVKQOehntVMNI23RytVh7AA+X5r5ufc7Z8xjiwOhnxoHEMHUz2gZlqEDKIIm0Ft+AL nxyykmnDCKanXcijGVtbszpNpakDnoQZmZtYil51zjvCijks9U21MBhUdYCoxoXsGqmq Sdyp4PuAbqy7kVkQqxa3G77Zw8kBOfMgrP4eb6E34mcuvtjxdgz4CikI6I2mXT446f5W LRjNPh4CJcJzw3lHzwHffrYvp1IjanUsIvzANElUl2mAxAKEvo71eQsEjxIAETNSUpi7 ZZ0FJ1IrZE12Gr+7S66tuLYKqvaNhqHO4KXIY/T/7194ePu7exEG5DqX5Y5kUOmR9PHV ECTA==
X-Received by 10.194.248.162 with SMTP id yn2mr10564234wjc.16.1415185259988; Wed, 05 Nov 2014 03:00:59 -0800 (PST)
From "Ivan Evstegneev" <webmailgroups@gmail.com>
To <python-list@python.org>
Subject Understanding "help" command description syntax - explanation needed
Date Wed, 5 Nov 2014 13:00:16 +0200
MIME-Version 1.0
Content-Type multipart/alternative; boundary="----=_NextPart_000_0001_01CFF8F8.72DBD0A0"
X-Mailer Microsoft Outlook 14.0
Thread-Index Ac/456sldZmAQz40R3uDMxojroxaqQ==
Content-Language en-us
X-Mailman-Approved-At Wed, 05 Nov 2014 12:41:17 +0100
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.15486.1415187679.18130.python-list@python.org> (permalink)
Lines 274
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1415187679 news.xs4all.nl 2934 [2001:888:2000:d::a6]:57467
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:80257

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Hello everyone,

 

I'm a Python beginner and just getting familiar with it. (I need it for my
EE B.Sc. project) 

For the learning purposes I use IDLE and (Learning Python by written by Mark
Lutz).

Let's say that I have some earlier experience with C language, but still
Python is a different one )))

 

Anyway, the question I would like to ask is about understanding "help"
contents.

It may look to obvious and even a dumb question, but still I need your help.

 

Here is a brief background with example in order to introduce my problem in
more clear way:

 

Suppose I get some list created: 

 

>>>L=[i for i in range(1,15,2)]

As it can be seen, this is the odd numbers list: [1, 3, 5, 7, 9, 11, 13]

 

Supppose I need to check the occurrence of number 7, in this case I'll just
write:

>>>L.index(7)

The result is :3

 

So here is the question itself:

If I use the help command to check the "range" command I get this info: 

 

range(stop) -> range object

range(start, stop[, step]) -> range object

 

As you've seen in my example I used range(1,15,2). But this knowledge I got
from googling a couple of sites.

I still can't understand the "help" command description. 

For instance, how do I need to understand that (start,stop[,step])  it's
just a three numbers? 

What do those brackets--> [,] mean?

 

The same about "str.replace" command, where I get this:

 

S.replace(old, new[, count]) - using this description I can't really
understand how to write the "replace" function parameters.

 

So I googled it up and found this example in order to get more clear
understanding of command use.

 

str = "this is string example....wow!!! this is really string"

print str.replace("is", "was")

print str.replace("is", "was", 3)

 

The result: 

thwas was string example....wow!!! thwas was really string

thwas was string example....wow!!! thwas is really string

 

But still how do I know that those "old, new" are the strings and [,count]
just a number? 

 I mean, it was more naturally(as a baginner) to me to write
str.replace(is,was[,3]) and that's all. 

 

 

Finally, as for my opinion, this is a lame way to learn  "what a command do"
by constantly googling it for examples. 

 

I need to get more familiar with "help", but the main problem, is that I
couldn't find any suitable explanations/tutorials about "help" syntax and
etc. (maybe didn't search well).

 

Any explanations/links will be greatly appreciated. I need some help for
"help" ^_^

 

Thanks in advance,

 

Ivan.   

 

 

Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Understanding "help" command description syntax - explanation needed "Ivan Evstegneev" <webmailgroups@gmail.com> - 2014-11-05 13:00 +0200
  Re: Understanding "help" command description syntax - explanation needed Larry Hudson <orgnut@yahoo.com> - 2014-11-05 23:16 -0800

csiph-web