Adress book

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2008
Posts: 402
Reputation: leegeorg07 is an unknown quantity at this point 
Solved Threads: 31
leegeorg07's Avatar
leegeorg07 leegeorg07 is offline Offline
Posting Pro in Training

Re: Adress book

 
0
  #21
Jul 3rd, 2009
oh right ok, thanks, however for the replacement problem, could you just use a unique decision?
don't judge me because I'm a year 8!

'it is better to fight for something than to live for nothing'General George S Patton
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 4,069
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 938
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Re: Adress book

 
0
  #22
Jul 3rd, 2009
Originally Posted by leegeorg07 View Post
oh right ok, thanks, however for the replacement problem, could you just use a unique decision?
Don't quite understand what you mean with 'unique decision', can you give an example?
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 402
Reputation: leegeorg07 is an unknown quantity at this point 
Solved Threads: 31
leegeorg07's Avatar
leegeorg07 leegeorg07 is offline Offline
Posting Pro in Training

Re: Adress book

 
0
  #23
Jul 4th, 2009
well the simplest version for unique is to use a set where you would incorporate both of them in a set making sure the new information is first like:
  1. mydata = ['hello', 'test', 'change']
  2. mynewdata = ['hello', 'test', 'change']
  3. myset = set(mynewdata, mydata)
although having thought of that it would be better to use
  1. file = open('filename', 'r+')
so that you will overwrite it, but you can still read it
don't judge me because I'm a year 8!

'it is better to fight for something than to live for nothing'General George S Patton
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Python Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC