Python reference

  • Thread starter Matthew Thorley
  • Start date
C

Cameron Laird

.
.
.
E.g. at the moment I'm working on capisuite for Linux and want to change and
enhance many things. One is the sending of emails with a fax or voice as an
attachment because at the moment it is just a call of sendmail. But I've no
sendmail and I CAN NOT install it. So I have to see how to take the
email.MIME... and send it by the SMTP module. :)
.
.
.
I'm sure your end goal can be achieved. I don't understand
your description. It is NOT necessary to have sendmail or
Python to emit e-mail with attachments. If you *want* to
use sendmail or Python, yes, that, too, certainly is feasible.
 
T

Terry Reedy

Neil Benn said:
Generally the documentation is good, remembering that this is an
open-source project and most people hate doing documentation there is a
lot of good documentation available and the books are pretty good.

and remembering that the references are voluteer work...
However there problem that I've had most frequently is actually finding
the information I need (personally I don't like the 'everyone
contribute' type of documentation as there can be a lot of clutter and
repetition). I think the module index is OK but there are fundamental
things missing. For example, I have a String object and want to find a
method that can give me a starts with. Before people say I can type
dir("IT'S OBVIOUS") or simply just guess (is it startswith, starts_with,
StartsWith, etc - that's before I get to the parameters), let's assume
that I'm coming from a language without an interepter - say Java, C#,
VB, C/C++, Pascal, etc.

If you have a specific suggestion, submit a SourceForge tracker item with
category documentation. If you have an actual patch to the LaTex source,
its a patch item. If it is pretty clearly a flaw, make a bug item. If a
suggestion for improvement but not obviously a bug, make an RFE item. Many
improvements to the official docs have come from such submissions!

In this case, it appears that the list you wanted in in 2.3.6.1 String
Methods which you find under 2.3.6 Sequence Types, etc. In the interactive
interpreter, help(str) also gives a list which eventually shows
| startswith(...)
| S.startswith(prefix[, start[, end]]) -> int
|
| Return 1 if S starts with the specified prefix, otherwise return 0.
With
| optional start, test S beginning at that position. With optional
end, stop
| comparing S at that position.

Terry J. Reedy
 
R

Reiner Block

Hi Thomas,
And to find keywords in the index of the Python docs, you could use
<http://starship.python.net/crew/theller/pyhelp.cgi>
<ironic>really great this documentation.</ironic> I'm searching and searching
for two possibilities: test if a string is a number (integer) or to strip
leading and trailing blanks. But it is impossible to find in the documentation
how to do it. :-( Really: I never saw a worse docu as this one.

Angry greetings

Reiner
--
"Was immer du tun kannst oder erträumst zu können, beginne es jetzt."
von: Johann Wolfgang von Goethe (1749-1832)

Reiner Block
http://www.bisoft.de
 
D

David Fraser

Reiner said:
Hi Thomas,



<ironic>really great this documentation.</ironic> I'm searching and searching
for two possibilities: test if a string is a number (integer) or to strip
leading and trailing blanks. But it is impossible to find in the documentation
how to do it. :-( Really: I never saw a worse docu as this one.

Search for "strip" will give you the second. The other is more difficult
to find like this - its isdigit. But both can be found easily be saying
help(str) from the Python prompt.
The problem is that you've misunderstood the purpose of this web page.
Angry greetings

There's no need to be angry! He made a page that other people can find
useful, and you didn't find it useful. He didn't set out to harm you...

David
 
H

Heiko Wundram

Am Freitag, 4. Juni 2004 22:07 schrieb Reiner Block:
<ironic>really great this documentation.</ironic> I'm searching and
searching for two possibilities: test if a string is a number (integer) or
to strip leading and trailing blanks. But it is impossible to find in the
documentation how to do it. :-( Really: I never saw a worse docu as this
one.

I don't really know how you're looking for what you need... Stripping leading
and trailing blanks is something that has to do with string manipulation. Go
and check: Library Reference -> String Type, and you'll soon find
str.strip().

About testing whether something is an integer: As always in Python, try to do
what you're doing, and test whether it succeeds.

y = "123a"
try:
x = int(y)
except ValueError:
print "Not a number."

HTH!

Heiko.
 
F

flupke

Timo Virkkala said:

This indeed helps a lot. I've entered the search key file to simulate
what i would do if i wanted to know how to write to a file but didn't
know where to start. (This is actually one of the cases where the
Python docs are very clear and the info is easy to find). Then i
find a lot of usefull info.
Now this should be part of the main python site!

Thanks
 
J

JanC

Neil Benn said:
So, following behavior of docs I would expect from other language's,
I go to the module index and it gives me the definitions for all the
functions for the String 'module' but not the String 'object'. So,
thinking - OK, it a could be in the language ('library') reference, I'll
look in there - I know that a String is a sequence so it may have a
reference there but I get a link back to the string module.

"Library reference"
<http://docs.python.org/lib/lib.html>

Strings are a built-in sequence type, so: "2.3.6 Sequence Types"
<http://docs.python.org/lib/typesseq.html>

At the bottom is a link to "2.3.6.1 String Methods"
<http://docs.python.org/lib/string-methods.html>


The only "problem" I see is to remember strings are sequences, which is not
something everybody new to Python will think about immediately.

Maybe it would help if the "contents" on the front page would show 4 levels
of headers instead of 3 levels now?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top