Newbie Question

Janos Blazi jblazi at hotmail.com
Sun Oct 7 04:42:00 EDT 2001


Let us assume, you want to use the function strip from the string modeul.
There are three possibilities:

(1)
>>>import string
in this case you have to use qualified names:
>>>s=string.strip(s)

(2)
>>>from string import split
then you can omit the "string."-prefix:
>>>s=strip(s)
but you have only imported the function strip

(3)
>>>from string import *
then you can use +every+ function from string without the "string."-prefix

J.B.




-----=  Posted via Newsfeeds.Com, Uncensored Usenet News  =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
 Check out our new Unlimited Server. No Download or Time Limits!
-----==  Over 80,000 Newsgroups - 19 Different Servers!  ==-----



More information about the Python-list mailing list