SPOJ, Problem Code: sumtrian, Reducing time taken to solve.

2008-06-01 Thread Shriphani
d the allowed time limit." I suspect that the first portion of my solution which looks at the input, figures out the number of triangles and forms a list that contains lists containing each row of the triangle, is wrong. I am not too sure how to optimize it. I would appreciate help. Thanks,

Parsing links within a html file.

2008-01-14 Thread Shriphani
Hello, I have a html file over here by the name guide_ind.html and it contains links to other html files like guides.html#outline . How do I point BeautifulSoup (I want to use this module) to guides.html#outline ? Thanks Shriphani P. -- http://mail.python.org/mailman/listinfo/python-list

Re: pdf library.

2008-01-02 Thread Shriphani
On Jan 1, 5:38 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Tue, 01 Jan 2008 04:21:29 -0800,Shriphaniwrote: > > On Jan 1, 4:28 pm, Piet van Oostrum <[EMAIL PROTECTED]> wrote: > >> >>>>>Shriphani<[EMAIL PROTECTED]> (S)

Re: pdf library.

2008-01-01 Thread Shriphani
On Jan 1, 4:28 pm, Piet van Oostrum <[EMAIL PROTECTED]> wrote: > >>>>>Shriphani<[EMAIL PROTECTED]> (S) wrote: > >S> I tried pyPdf for this and decided to get the pagelinks. The trouble > >S> is that I don't know how to determine whether a part

Re: pdf library.

2007-12-31 Thread Shriphani
On Dec 30 2007, 5:08 am, Waldemar Osuch <[EMAIL PROTECTED]> wrote: > On Dec 29, 11:54 am,Shriphani<[EMAIL PROTECTED]> wrote: > > > Hi, > > I am looking for a pdf library that will give me a list of pages where > > new chapters start. Can someone poi

pdf library.

2007-12-29 Thread Shriphani
Hi, I am looking for a pdf library that will give me a list of pages where new chapters start. Can someone point me to such a module ? Regards, Shriphani P. -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble with for loop

2007-11-06 Thread Shriphani
On Nov 6, 3:09 pm, Ant <[EMAIL PROTECTED]> wrote: > On Nov 6, 9:59 am, Shriphani <[EMAIL PROTECTED]> wrote: > ... > > > My main intention is to state that each of the variables namely a, b, > > c, ## can take value from 1 to 9. > > How do I go about

Trouble with for loop

2007-11-06 Thread Shriphani
? Regards, Shriphani Palakodety -- http://mail.python.org/mailman/listinfo/python-list

gdbm troubles.

2007-10-11 Thread Shriphani
dictionary = gdbm.open('dictionary','c') dictionary['Ellipsize'] = 'Openbox' dictionary.get('Ellipsize') the last line generates an attribute error. Can someone tell me what I am doing wrong? Regards, Shriphani Palakodety -- http://mail.python.org/mailman/listinfo/python-list

Re: Last value of yield statement

2007-10-10 Thread Shriphani
On Oct 10, 4:05 pm, John Machin <[EMAIL PROTECTED]> wrote: > On 10/10/2007 8:19 PM, Shriphani wrote: > > > > > Hello all, > > > Let us say I have a function like this: > > > def efficientFiller(file): > > worthless_list = [] > >

Re: Last value of yield statement

2007-10-10 Thread Shriphani
On Oct 10, 3:34 pm, Dustan <[EMAIL PROTECTED]> wrote: > On Oct 10, 5:19 am, Shriphani <[EMAIL PROTECTED]> wrote: > > > Hello all, > > > Let us say I have a function like this: > > > def efficientFiller(file): > > Note that you are shadowing the built

Last value of yield statement

2007-10-10 Thread Shriphani
w_list = list(efficient_filler) print new_list I want to plainly get the last value the yield statement generates. How can I go about doing this please? Regards, Shriphani Palakodety -- http://mail.python.org/mailman/listinfo/python-list

Editing particular lines of a text file.

2007-10-09 Thread Shriphani
rt the line. This part is where I face a problem. How do I plainly edit just one line. I would also like to look at some sample code that does this. 5. open a new file and write the new file with the inserted strings to it. 6. close both files opened. Regards, Shriphani Palakodety -- http:

Re: True of False

2007-09-27 Thread Shriphani
, "f"] > > if "c" in a == True: > Print "Yes" > > When I run this, it runs, but nothing prints. What am I doing wrong? > Thanks. > > Kou Hello, Just try : a = ["a","b","c","d","e",&quo

Re: comparing elements of a list with a string

2007-09-27 Thread Shriphani
+ ":" + str(date_components[2]) time = element.split('-')[-1] yield (date, time) print listAllbackups('fstab') I ran it in the terminal and I got: Why does it do that and not just print out all the values of (date, time) Regards, Shriphani Pa

comparing elements of a list with a string

2007-09-25 Thread Shriphani
ckups(file): list_of_files = os.listdir("/home/shriphani/backupdir") for element in list_of_files: if element.find(file) != -1: date = ### time = return (date, time) The major trouble is that the return statement causes it to exit af

obtaining multiple values from a function.

2007-09-25 Thread Shriphani
hello all, If I have a function that loops over a few elements and is expected to throw out a few tuples as the output, then what should I be using in place of return ? Shriphani Palakodety. -- http://mail.python.org/mailman/listinfo/python-list

Re: Making a small change to a large XML document

2007-09-24 Thread Shriphani
Dan Stromberg wrote: > Say I want to take an existing XML document, and change the value="9997" > and value="9998" to two different numbers, without changing any of the > rest of the document - not even changing comments or indentation, if > avoidable. > > What's the best way of doing it in python

python-fam documentation.

2007-07-23 Thread Shriphani
? Thanks, Shriphani Palakodety. -- http://mail.python.org/mailman/listinfo/python-list