[Tutor] Is there a Python book which gives sample code / usage of all the modules which ship with python???

karthik Guru karthikg@aztec.soft.net
Thu, 29 Nov 2001 19:55:47 +0530


I got it!! thanks.

Let me just post it if it c'd be of some use to a fellow newbie!

This is what i had in the conf.txt file


[server]
database:octago
user:sa
password:blank
[personal]
name:karthik
age:21
company:Aztec

'personal' and 'server' are the sections.

config = ConfigParser.ConfigParser()
config.add_section("server")
config.add_section("personal")

//read the conf file

fname = open("conf.txt","r")
config.readfp(fname)

print config.get("server","database") // under the server section get the
value for the database key
>> octago
print config.get("personal","name")
>>karthik

python is fun :-)

-----Original Message-----
From: tutor-admin@python.org [mailto:tutor-admin@python.org]On Behalf Of
karthik Guru
Sent: Thursday, November 29, 2001 7:07 PM
To: tutor@python.org
Subject: [Tutor] Is there a Python book which gives sample code / usage
of all the modules which ship with python???
Importance: High



or is there a website which lists the code samples??.
Oreilly, manning etc do not publish python related books in India :-(
The only one we have here is "Core Python programming" by Chun.










_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor