Skip to content

Instantly share code, notes, and snippets.

@nit99kumar
Created March 13, 2014 10:16
Show Gist options
  • Save nit99kumar/9525677 to your computer and use it in GitHub Desktop.
Save nit99kumar/9525677 to your computer and use it in GitHub Desktop.
a = raw_input("enter filename: ")
num_of_att = int(raw_input("enter the number of attributes: "))
fob = open(a, 'a')
att = raw_input("enter attribute list: ")
tempatt = att.split(' ')
for i in xrange(num_of_att):
fob.write(tempatt[i] + "\t")
fob.write("\n")
flag = 1
while flag == 1:
rec = raw_input("enter record: ")
templist = rec.split(' ')
for i in xrange(num_of_att):
fob.write(templist[i] + "\t")
fob.write("\n")
flag = input("press 1 to enter another record: ")
fob.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment