FWD: Questions about shelve

Jackson david.jay.jackson at wcox.com
Tue Oct 23 18:03:42 EDT 2001


Objective (Please see script below):
Create simple server outage tracking db. While MySQL
would be easer to use, it's not as much fun *grin*

Data layout:
Each record consist of; hostname,date,problem,resolution with
hostname and date beging key fields, and problem/resolution being multi-line text field.

What's missing:
1. Need to be able to enter more than one outage per server, did I read someplace that you can set Btree to allow dup keys?

2. Change "end_of_field" char to Ctrl+a to allow multi line imput for problem and resolution fields.

Thanks for you time.
David Jackson


-------------      Script -----------------------

#!/usr/bin/python
import shelve
#
people = shelve.open("/tmp/btree.db")
host=raw_input("Enter Hostname: ")  	
date=raw_input("Date of Outage: ")				problem=raw_input("Problem Descrption: ")
resolution=raw_input("Problem Resolution: ")
people[host]=[date,problem,resolution]
people.close()
	






More information about the Python-list mailing list