Pickle Problem

2009-03-03 Thread Fab86
Hello, I am new to using Python and am looking at exporting some of my code into a seperate document. The code I am using for the pickle is: file = open('testdoc.txt', 'w') pickle.dump(res1.total_results_available,file) pickle.dump(res2.total_results_available,file) pickle.dump(res3.total_resul

Re: Pickle Problem

2009-03-03 Thread Fab86
On Mar 3, 10:34 am, Chris Rebert wrote: > On Tue, Mar 3, 2009 at 1:52 AM, Fab86 wrote: > > Hello, > > > I am new to using Python and am looking at exporting some of my code > > into a seperate document. > > > The code I am using for the pickle is: &g

Re: Pickle Problem

2009-03-03 Thread Fab86
Fantastic, just what I was looking for Andrew. Many thanks, Fabien On Mar 3, 11:50 am, "andrew cooke" wrote: > Fab86 wrote: > > I am wanting to store the integers in a file so that I can then run it > > through some software without having to edit it. Will json enable

Re: Pickle Problem

2009-03-03 Thread Fab86
Thanks, this seems like a simpler way to do it. I plan on recording 200 values to this file from the outcome of 200 Yahoo searches. Is there any type of loop I can make to do this or do I have to have a line like "print >> f, res1.total_results_available" 200 times? Regards, Fabien On Mar 3, 12

Re: Pickle Problem

2009-03-03 Thread Fab86
res1, I then use the total_results_available class which saves res1 as an integer. This is happening 200 times. How could I make a for loop to do this? Thanks, Fabien On Mar 3, 12:21 pm, odeits wrote: > On Mar 3, 4:16 am, Fab86 wrote: > > > > > Thanks, this seems like a simpler way to do it. &

Re: Pickle Problem

2009-03-03 Thread Fab86
On Mar 3, 1:02 pm, MRAB wrote: > Fab86 wrote: > > I am getting res1 and res2 etc from this code: > > > srch1 = WebSearch(app_id=YahooKey) > > srch1.query = "avoir site:.al" > > res1 = srch1.parse_results() > > > srch2 = WebSearch(app_id=Yaho

Re: Pickle Problem

2009-03-03 Thread Fab86
On Mar 3, 6:48 pm, "Gabriel Genellina" wrote: > En Tue, 03 Mar 2009 16:39:43 -0200, Fab86 escribió: > > > I am having a bit on an issue getting my program to work. The online > > database which I am trying to contact keep timing out meaning I can > > not carry

Re: Pickle Problem

2009-03-03 Thread Fab86
On Mar 3, 8:59 pm, "Gabriel Genellina" wrote: > En Tue, 03 Mar 2009 16:50:25 -0200, Fab86 escribió: > > > > > On Mar 3, 6:48 pm, "Gabriel Genellina" wrote: > >> En Tue, 03 Mar 2009 16:39:43 -0200, Fab86   > >> escribió: > > >

Re: Pickle Problem

2009-03-03 Thread Fab86
On Mar 4, 12:00 am, MRAB wrote: > Fab86 wrote: > > On Mar 3, 8:59 pm, "Gabriel Genellina" wrote: > >> En Tue, 03 Mar 2009 16:50:25 -0200, Fab86 escribió: > > >>> On Mar 3, 6:48 pm, "Gabriel Genellina" wrote: > >>>> En Tue

Re: Pickle Problem

2009-03-04 Thread Fab86
On Mar 4, 1:40 am, "Gabriel Genellina" wrote: > En Tue, 03 Mar 2009 23:11:30 -0200, Fab86 escribió: > > > > > On Mar 4, 12:00 am, MRAB wrote: > >> Fab86 wrote: > >> > On Mar 3, 8:59 pm, "Gabriel Genellina" wrote: > >&g

Re: Pickle Problem

2009-03-05 Thread Fab86
On Mar 4, 2:49 pm, MRAB wrote: > Fab86 wrote: > > On Mar 4, 1:40 am, "Gabriel Genellina" wrote: > >> En Tue, 03 Mar 2009 23:11:30 -0200, Fab86 escribió: > > >>> On Mar 4, 12:00 am, MRAB wrote: > >>>> Fab86 wrote: > >>>&g

While loop

2009-03-05 Thread Fab86
Hello, I am currently working on my program which send queries to Yahoo and then saves them into a flatfile. The problem I have is that I need to conduct 200 searches and Yahoo typically times out during the search with an error. I have caught the error and told it to time.sleep(10) however I can

Re: While loop

2009-03-05 Thread Fab86
On Mar 5, 5:23 pm, Marco Mariani wrote: > Fab86 wrote: > > Is it possible to get the program to catch the exception, wait 10 > > seconds, then carry of from where it was rather than starting again? > > something like this? probably works in PASCAL as well :) > > &g

Re: While loop

2009-03-05 Thread Fab86
On Mar 5, 5:49 pm, Fab86 wrote: > On Mar 5, 5:23 pm, Marco Mariani wrote: > > > > > Fab86 wrote: > > > Is it possible to get the program to catch the exception, wait 10 > > > seconds, then carry of from where it was rather than starting again? > > >