In the following snippet, the loop in the global namespace takes twice as long
as the loop in the function namespace. Why?
limit = 5000
def f1():
counter = 0
while counter < limit:
counter += 1
time1 = time.time()
f1()
print(time.time() - time
> From: James Hartley <>
> Subject: [Tutor] opening a pipe?
> Sent: 2008-02-12 09:24
>
> A Perl script can easily serve as a filter within a pipe as seen in
> the following:
>
> use strict;
> use warnings;
>
> open(IN, 'cat hello.txt |') or die 'unable to open file';
> while () {
>
> ---Original Message---
> From: Kent Johnson <[EMAIL PROTECTED]>
> Subject: Re: [Tutor] reading random line from a file
> Sent: 2007-07-18 10:19
>
[SNIP]
>
> It probably doesn't matter, but this will pick longer lines more often
> than short ones.
>
This method only keeps one
>return self.atts[name]
>if self.parent:
>return self.parent.lookup(name)
>raise KeyError
>#
>
>
>
Many thanks Danny. This example was an moment of epiphany for me, one
that will pr
"0110", 'C' : "0111"}
> strinput = 'ABBC'
> result = [mydic[x] for x in strinput_process]
> print result
>
You might also want to look at "Number to String in Arbirtrary Base" recipe:
http://a
people like what they download,
they will come back and look for other things. In effect, your previous
programs can advertise your newer programs. Exposure is valuable.
--
Poor Yorick
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
You just admitted on a public forum to committing a crime. Not wise,
friend.
--
Poor Yorick
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
f for proficiency is high.
--
Poor Yorick
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
g indented html/xml documents. Anyone know how to do this in vim?
--
Poor Yorick
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
er,
like Treepad. If you decide to get more complicated, you can use LEO as a
templating tool to generate your resulting .py files from your snippets.
--
Poor Yorick
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
browse
http://www.benedict.com/ instead posting off-topic commentaries about people
who turn to the list with questions.
Bye,
Poor Yorick
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Nathan Pinno wrote:
> guess = float(raw_input(a," + ",b," = "))
> TypeError: [raw_]input expected at most 1 arguments, got 4
>
> guess = float(raw_input(a," + ",b," = "))
> return answer, guess
>
hint: how many ar
on this list. Blow it out your hairdo...
Bye,
Poor Yorick
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Kevin Bixler wrote:
> I was asked to make a program that reverses the text that a user would
> input. I have tried what I thought would work which is
> phrase.reverse(). phrase = the raw_input. Help!
> Thank you,
> Kevin Bixler
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel
14 matches
Mail list logo