On Wed, May 7, 2014 at 8:49 PM, Scott W Dunning wrote:
>
> On May 5, 2014, at 10:13 PM, meenu ravi wrote:
>
>> Likewise, the index of d, which is the last word in the word "Hello world"
>> is 10.
>>
>> So, the maximum index you can access in the word "Hello world" is 10. But
>> when you try to
On May 5, 2014, at 10:13 PM, meenu ravi wrote:
> Likewise, the index of d, which is the last word in the word "Hello world" is
> 10.
>
> So, the maximum index you can access in the word "Hello world" is 10. But
> when you try to give the command,
>
> >>> greeting [len(greeting)]
>
> It is t
On 08/05/14 01:42, C Smith wrote:
I guess intuiting efficiency doesn't work in Python because it is such
high-level? Or is there much more going on there?
Efficiency is usually language independent because its the algorithm, or
design, that determines efficiency in most cases.
Your example i
On May 7, 2014 8:42 PM, "C Smith" wrote:
>
> I guess intuiting efficiency doesn't work in Python because it is such
> high-level? Or is there much more going on there?
Hi,
The level is a good part, yes. If, like me, you don't know what C
constructs are under python constructs, you are guessing
I guess intuiting efficiency doesn't work in Python because it is such
high-level? Or is there much more going on there?
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On 2014-05-07 16:27, C Smith wrote:
#sum all even fib seq integers under 4 million
fibs = [1,2]
sum = 0
while fibs[-1] < 400:
nexty = fibs[-1] + fibs[-2]
fibs.append(nexty)
for xer in fibs:
if xer%2 == 0:
sum += xer
print sum
This gets the correct solution, but what wou
I see. Thanks that is exactly what I was looking for. Would your
example be an instance of an object-oriented approach,
compartmentalizing things into functions?
On Wed, May 7, 2014 at 7:55 PM, Joe Cortes wrote:
> Welcome to the wonderful world of generators!
>
> Looking at your code, you'll noti
On May 7, 2014 7:30 PM, "C Smith" wrote:
> Someone suggested projecteuler.net and I started blazing through
> things I had done before, when I realized this would be a good time to
> start more efficient practices instead of code that just happens to
> work and may be very inefficient.
>
> #sum
On Wed, May 07, 2014 at 06:43:11PM +0530, jitendra gupta wrote:
> Hi
>
> I just want to create a new xm file from existing xml file. so basically i
> want to put contry details in countryName.xml from these file.
>
> I thought to do via read a line by line with normal file handling. but
> there a
A topic came up on slashdot concerning "intermediate" programming,
where the poster expressed the feeling that the easy stuff is too easy
and the hard stuff is too hard.
Someone did point out that 'intermediate' programming would still
involve actually selling code or at least some professional
ex
On Tue, May 06, 2014 at 06:36:21PM +0100, Alan Gauld wrote:
> Aside:
> len() does work with range() and slicing so you can write
>
> myList[:len(mylist)]
>
> to get a copy of your list...
Even easier is a blank slice. The start defaults to zero, the
end to the length of the sequence, and the s
To elaborate:
from xml.dom.pulldom import START_ELEMENT, parse
import io
sampleData = u"""
2
2008
141100
5
2011
59900
69
20
On Wed, May 7, 2014 at 1:26 PM, jitendra gupta wrote:
> I cant use etree/SAX because there we cant get complete line , of course we
> can get it by tag name but we are not sure about tag also. Only we know
> what ever child of we need to put in new file with country name.
Why can't you use su
On 5/7/2014 3:49 PM, Stefan Behnel wrote:> Neil D. Cerutti, 07.05.2014
20:04:
>> In my own personal case, I partly prefer xml.sax simply because it
ignores
>> namespaces, a nice benefit in my cases. I wish I could make
ElementTree do
>> that.
>
> The downside of namespace unaware parsing is tha
no only XML (Complex)
On Thu, May 8, 2014 at 1:51 AM, Danny Yoo wrote:
> On Wed, May 7, 2014 at 6:13 AM, jitendra gupta
> wrote:
>
> > I just want to create a new xm file from existing xml file. so basically
> i
> > want to put contry details in countryName.xml from these file.
>
>
>
> Side que
@All thanks,
I cant use etree/SAX because there we cant get complete line , of course we
can get it by tag name but we are not sure about tag also. Only we know
what ever child of we need to put in new file with country name.
Note: File size is around 800MB, for other requirement(Like converti
On Wed, May 7, 2014 at 6:13 AM, jitendra gupta wrote:
> I just want to create a new xm file from existing xml file. so basically i
> want to put contry details in countryName.xml from these file.
Side question: does your input have to be XML, or can it be in a
simpler format such as JSON?
Neil D. Cerutti, 07.05.2014 20:04:
> On 5/7/2014 1:39 PM, Alan Gauld wrote:
>> On 07/05/14 17:56, Stefan Behnel wrote:
>>> Alan Gauld, 07.05.2014 18:11:
and ElementTree (aka etree). The documenation gives examples of both.
sax is easiest and fastest for simple XML in big files ...
>>>
>>>
On 5/7/2014 1:39 PM, Alan Gauld wrote:
On 07/05/14 17:56, Stefan Behnel wrote:
Alan Gauld, 07.05.2014 18:11:
and ElementTree (aka etree). The documenation gives examples of both.
sax
is easiest and fastest for simple XML in big files ...
I wouldn't say that SAX qualifies as "easiest". Sure,
On 07/05/14 17:56, Stefan Behnel wrote:
Alan Gauld, 07.05.2014 18:11:
and ElementTree (aka etree). The documenation gives examples of both. sax
is easiest and fastest for simple XML in big files ...
I wouldn't say that SAX qualifies as "easiest". Sure, if the task is
something like "count nu
On Wed, May 7, 2014 at 6:50 AM, Walter Prins wrote:
> Hi all,
>
> I stumbled across this post today and thought it was worth sharing
> with the Python tutor list. It provides good advice to students about
> debugging your programs and how to ask for help on forums, in
> particular Stack overflow,
Alan Gauld, 07.05.2014 18:11:
> Python comes with several XML parsers. The simplest to use are probably sax
> and ElementTree (aka etree). The documenation gives examples of both. sax
> is easiest and fastest for simple XML in big files while etree is probably
> better for more complex XML structur
On 07/05/14 14:13, jitendra gupta wrote:
I thought to do via read a line by line with normal file handling. but
there a problem with that. So i want to handle python XML . Could you
please suggest on this.
Python comes with several XML parsers. The simplest to use are probably
sax and Element
On 5/7/2014 9:13 AM, jitendra gupta wrote:
Hi
I just want to create a new xm file from existing xml file. so basically
i want to put contry details in countryName.xml from these file.
I thought to do via read a line by line with normal file handling. but
there a problem with that. So i want to
Hi
I just want to create a new xm file from existing xml file. so basically i
want to put contry details in countryName.xml from these file.
I thought to do via read a line by line with normal file handling. but
there a problem with that. So i want to handle python XML . Could you
please suggest
Hi all,
I stumbled across this post today and thought it was worth sharing
with the Python tutor list. It provides good advice to students about
debugging your programs and how to ask for help on forums, in
particular Stack overflow, but in that way equally applies to the
Python tutor list.
Link
26 matches
Mail list logo