I saw that great idea from Steven, and I appreciate it. I think it will
work. Just need to figure out how to get 4 numbers from the player on one line
for easy comparison, e.g. telling whether the number is correct position and
number, incorrect position and correct number, or both are incorr
Ron Adam wrote:
> But together, sum and product, probably cover about 90% of situations in
> which you would use reduce. Getting a total (sum) from a list probably
> covers 80% of the situations reduce would be used on it's own. (I can't
> think of any real uses of product at the moment. It's
Hi all,
Sure I'm able to publish the code, only the previous version though. If
you want the first version; find Josh Cogliati, and ask him. It didn't have
a random function, though. I got the idea to improve it from my computer
course.
Here is the code:
#Plays the guessing game higher
Thanks! Even the fact that these ideas
have been organized into a PEP is
exciting to methere is hope that
they may *someday* be implemented. Maybe sooner than people think.
Another reason to love Python like no other.
Chris
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> On Sat, 02 Jul 2005 20:26:31 -0700, Devan L wrote:
>
>
>> Claiming that sum etc. do the same job is the whimper of
>>someone who doesn't want to openly disagree with Guido.
>>
>>Could you give an example where sum cannot do the job(besides the
>>previously mentioned prod
Steven D'Aprano wrote:
> On Fri, 24 Jun 2005 14:29:37 -0700, James wrote:
>
> > Interesting thread ...
> >
> > 1.) Language support for ranges as in Ada/Pascal/Ruby
> > 1..10 rather than range(1, 10)
>
> What advantages do Pascal-like for loops give over Python for loops?
>
> The only two I can thi
Hello Peter,
> > Is there a way to know in a POP session of a message was seen (old) or not
> > (new)?
>
> Define "seen". It could be interpreted as either "TOP" or "RETR" having
> been executing for a message, or something like "this client has seen
> this message before" ... not sure what yo
Terry Hancock wrote:
> My general attitude towards IDEs and editors has been
> extremely conservative, but today I decided to see what
> this "folding" business was all about.
>
> I see that vim (and gvim, which is what I actually use)
> has this feature, and it is fairly nice, but at present i
"Will McCutchen" <[EMAIL PROTECTED]> writes:
>> Is there any way of keeping this info in PIL?
>
> I don't think so... when I investigated in the past, I think I
> discovered that the PIL can't write EXIF data (I might be wrong,
> though, or my information might be outdated).
There is this:
http:
Python 3000 is the proveribal and so far hypothetical version of the
language in which backward incompatible changes will be allowed (and
encouraged).
See
http://www.python.org/peps/pep-3000.html
for details.
[EMAIL PROTECTED] wrote:
> Guido gave a nice "Python Regrets" Power Point talk at OSCO
On Saturday 02 July 2005 10:50 pm, Peter Hansen wrote:
> Terry Hancock wrote:
> > On Saturday 02 July 2005 08:53 pm, Dennis Lee Bieber wrote:
> > And for that matter, some of the posters here have *been* 14.
>
> Terry, almost every single one of the posters here have been 14.
> At some time. :-)
U
[EMAIL PROTECTED] wrote:
> Guido gave a nice "Python Regrets" Power Point talk at OSCON few years
> ago.
>
> I was wondering if the plan is to ever implement these ideas.
>
> e.g. Guido said he'd prefer 'print' to be a *function* with perhaps a
> 'println' version IIRC.
>
>He also had a
Guido gave a nice "Python Regrets" Power Point talk at OSCON few years
ago.
I was wondering if the plan is to ever implement these ideas.
e.g. Guido said he'd prefer 'print' to be a *function* with perhaps a
'println' version IIRC.
He also had a ton of stuff he'd rather see become iterato
Dennis Lee Bieber wrote:
> The Windows registry is "a maze of twisty little passages, all
> alike"
ITYM "a maze of twisty little passeges,
{058C1536-2201-11D2-BFC1-00805F858323}"
> The registry a cryptic, bloated, system by which M$ can hide
> details about anything they want... In
On Sun, 03 Jul 2005 01:01:18 -0400, Christopher Subich <[EMAIL PROTECTED]>
wrote:
>Steven D'Aprano wrote:
>> comps. But reduce can't be written as a list comp, only as a relatively
>> complex for loop at a HUGE loss of readability -- and I've never used
>> Lisp or Scheme in my life. I'm surely not
Steven D'Aprano wrote:
> comps. But reduce can't be written as a list comp, only as a relatively
> complex for loop at a HUGE loss of readability -- and I've never used
> Lisp or Scheme in my life. I'm surely not the only one.
See my reply to your other post for a more detailed explanation, but I
Terry Hancock <[EMAIL PROTECTED]> writes:
> This is true in the same sense that Python is unnecessary
> because all programs can be written in assembler. Or machine
> code for that matter. Entered by flipping switches, even -- throw
> away that keyboard.
>
> I have actually seen this done, BTW.
Devan L wrote:
> sum(sequence[0] + [1/element for element in sequence[1:]])
>
> I think that should work.
That won't work, because it misses the x*y part of the expression
(x[n]*x[n+1] + 1/x[n+1], for people who haven't immediately read the
grandparent).
Personally, I think demanding that it b
On Sat, 02 Jul 2005 20:26:31 -0700, Devan L wrote:
> Claiming that sum etc. do the same job is the whimper of
> someone who doesn't want to openly disagree with Guido.
>
> Could you give an example where sum cannot do the job(besides the
> previously mentioned product situation?
There is an inf
sum(sequence[0] + [1/element for element in sequence[1:]])
I think that should work.
--
http://mail.python.org/mailman/listinfo/python-list
Terry Hancock wrote:
> On Saturday 02 July 2005 08:53 pm, Dennis Lee Bieber wrote:
> And for that matter, some of the posters here have *been* 14.
Terry, almost every single one of the posters here have been 14.
At some time. :-)
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> On Fri, 01 Jul 2005 13:42:10 -0400, Mike Meyer wrote:
>>No, he wants Python to be Pythonic. TMTOWTDI is not Pythonic.
>
> Too Many T--- Only Way To Do It?
>
> There Might Tangle One Way To Do It?
>
> T--- M--- Two Obvious Ways To Do It?
>
> Nope, sorry, still not gettin
My general attitude towards IDEs and editors has been
extremely conservative, but today I decided to see what
this "folding" business was all about.
I see that vim (and gvim, which is what I actually use)
has this feature, and it is fairly nice, but at present it's
very manual --- and frankly it
Claiming that sum etc. do the same job is the whimper of
someone who doesn't want to openly disagree with Guido.
Could you give an example where sum cannot do the job(besides the
previously mentioned product situation?
Also, map is easily replaced.
map(f1, sequence) == [f1(element) for element i
On Sun, 03 Jul 2005 02:22:23 +0200, Fredrik Johansson wrote:
> On 7/3/05, Tom Anderson <[EMAIL PROTECTED]> wrote:
>> That's one way. I'd do:
>>
>> root = value ** 0.5
>>
>> Does that mean we can expect Guido to drop math.sqrt in py3k? :)
>
> I'd rather like to see a well implemented math.nthroo
On Saturday 02 July 2005 08:53 pm, Dennis Lee Bieber wrote:
> On Sat, 2 Jul 2005 18:49:20 -0400, Christopher Kang
> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
> > I've been doing the epsilon comparisons, i had just hoped that to be a
> > temporary solution.
> >
> Consid
On Saturday 02 July 2005 04:26 pm, phil wrote:
> > A rather object-oriented system for managing and serving web
> > applications and data (using object inheritance for common behavior,
> > etc.) This makes Zope a toolkit, not an end application itself.
>
> So that would make it Apache, with a Pyth
On Sat, 02 Jul 2005 14:17:32 -0400, Peter Hansen <[EMAIL PROTECTED]> wrote:
>Bengt Richter wrote:
>> BTW, there's something about referring to type(self) by its not
>> always dependably bound (though usually global) name that bothers me.
>>
>> I wonder if the above common use of super could be im
I've needed to do something similar in the past and used free ntp
servers. Of course you need an internet connection:
http://ntp.isc.org/bin/view/Servers/NTPPoolServers
http://www.nightsong.com/phr/python/setclock.py
You could also have a startup script spawn a thread that stores the
time persiste
Steven D'Aprano wrote:
> On Fri, 01 Jul 2005 12:24:44 -0700, Devan L wrote:
>
>
>>With the exception of reduce(lambda x,y:x*y, sequence), reduce can be
>>replaced with sum, and Guido wants to add a product function.
>
>
> How do you replace:
>
> reduce(lambda x,y: x*y-1/y, sequence)
>
> with
On 2005-07-03, Darkfalz <[EMAIL PROTECTED]> wrote:
> I find this amusing even when they have the most cockney, ghetto
> English accent, Americans still find it "sophisticated".
No they don't. Americans have pretty much the same stereotypes
about regional English accents that the average Brit doe
On Sat, 02 Jul 2005 00:25:00 -0600, Nathan Pinno wrote:
>
>
> Hi all.
>
> How do I make the computer generate 4 random numbers for the guess? I want
> to know because I'm writing a computer program in Python like the game
> MasterMind.
First you get the computer to generate one random numb
Christos "TZOTZIOY" Georgiou <[EMAIL PROTECTED]> writes:
> On Thu, 30 Jun 2005 20:55:20 -0400, rumours say that Mike Meyer
> <[EMAIL PROTECTED]> might have written:
>
>>Actually, I was thinking of pre-K&R Unix compilers.
>
> There must be something I am missing here, cause I don't understand what
On Fri, 01 Jul 2005 19:15:46 -0700, Erik Max Francis wrote:
> Sean McIlroy wrote:
>
>> if that's the case then list
>> comprehensions and/or "first class functions" are likely to be the next
>> target.
>
> Slippery slope arguments are logical fallacies, you know.
Not if you are actually standin
"Bengt Richter" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I wonder if the above common use of super could be implemented as a
> property of object,
> so you'd normally inherit it and be able to write
>self.super.__init__(*args, **kwargs) # (maybe spell it
> self.__super
On Fri, 01 Jul 2005 13:42:10 -0400, Mike Meyer wrote:
> "iK" <[EMAIL PROTECTED]> writes:
>
>> Seems like he wants python programmers to solve their problems all in the
>> same way. While that is great for corporate slaves it is terrible for the
>> creative programmer.
>
> No, he wants Python t
On Fri, 01 Jul 2005 12:59:20 -0400, François Pinard wrote:
> [Peter Hansen]
>> Mike Meyer wrote:
>> > Yes. I once grabbed an old program that did assignments to None. But
>> > that's always been a bad idea.
>
>> What was the use case!?
>
> People used to assign None to itself as a keyword argume
On Fri, 01 Jul 2005 09:13:58 -0700, mcherm wrote:
> Lambda serves a very specific purpose: declaring small, in-place
> functions which are no bigger than a single expression. I do this often
> enough that I DO want special syntax for it. But I'll admit that I
> wish "lambda" were about 5 or 6 cha
On Fri, 01 Jul 2005 12:24:44 -0700, Devan L wrote:
> With the exception of reduce(lambda x,y:x*y, sequence), reduce can be
> replaced with sum, and Guido wants to add a product function.
How do you replace:
reduce(lambda x,y: x*y-1/y, sequence)
with sum?
Inquiring minds want to know.
--
S
muldoon wrote:
> Americans consider having a "British accent" a sign of sophistication
> and high intelligence. Many companies hire salespersons from Britain to
> represent their products,etc. Question: When the British hear an
> "American accent," does it sound unsophisticated and dumb?
>
> Be blu
Bengt Richter wrote:
> I wonder if the above common use of super could be implemented as a property
> of object,
> so you'd normally inherit it and be able to write
> self.super.__init__(*args, **kwargs) # (maybe spell it
> self.__super__.__init__(...) I suppose)
>
> I.e., self.__super__ wo
John Machin wrote:
> Nathan Pinno wrote:
>> guess = input("Guess a number: ")
>
>
> "guess" will refer to a string e.g. "42" which will *not* compare equal
> to the integer 42. Also you should use raw_input, not input.
>
> so do this:
>
> guess = int(raw_input("Guess a number: "))
>
A
On 7/3/05, Tom Anderson <[EMAIL PROTECTED]> wrote:
> That's one way. I'd do:
>
> root = value ** 0.5
>
> Does that mean we can expect Guido to drop math.sqrt in py3k? :)
I'd rather like to see a well implemented math.nthroot. 64**(1/3.0)
gives 3.9996, and this error could be avoided.
Roy Smith wrote:
> Peter Hansen <[EMAIL PROTECTED]> wrote:
>
>>I guess as long as the NTP client is set up to ensure the time
>>adjustments are smaller than some value X, it would be acceptable.
>
>
> NTP is generally capable of keeping the various system clocks on a LAN
> within a few ms of e
You might want to be a little more explicit. Do you know that
this = "this"
that = "that"
or do you mean
this = `the part before the \D*`
that = `the part after the \D*`
If you mean the former, then the previously proposed
py> import re
py> line = 'see this man with that woman holding this do
On Sat, 2 Jul 2005, Tom Brown wrote:
> On Saturday 02 July 2005 10:55, Nathan Pinno wrote:
>
>> Brief question for anyone who knows the answer, because I don't. Is
>> there anyway to make Python calculate square roots?
>
> from math import sqrt
That's one way. I'd do:
root = value ** 0.5
Does
Nathan Pinno wrote:
> Hi all,
>
> What's wrong with the following code? It says there is name error, that
> random is not defined. How do I fix it?
Others have already answered that question. This posting is a
pre-emptive strike to head off the next half-a-dozen questions.
>
> # Plays th
On Saturday 02 July 2005 10:55, Nathan Pinno wrote:
> Brief question for anyone who knows the answer, because I don't. Is
> there anyway to make Python calculate square roots?
from math import sqrt
--
http://mail.python.org/mailman/listinfo/python-list
[Peter Hansen]
> Hmmm... not only that, but at least under XP the return value of
> time.time() _is_ UTC. At least, it's entirely unaffected by the
> daylight savings time change, or (apparently) by changes in time zone.
On all platforms, time.time() returns the number of seconds "since the
epoch
Roy Smith wrote:
> Peter Hansen <[EMAIL PROTECTED]> wrote:
>>Using time.time() doesn't appear to be suitable, since time might jump
>>forwards or backwards at the user's whim, if the system clock is reset,
>>or when a daylight savings time change occurs.
>
> If you get the UTC time, daylight sav
"Nathan Pinno" <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> What's wrong with the following code? It says there is name error, that
>random is not defined. How do I fix it?
>
> # Plays the guessing game higher or lower.
> # Originally written by Josh Cogliati, improved first by Quique, then by
>N
Christos TZOTZIOY Georgiou wrote:
> On Fri, 01 Jul 2005 23:45:57 +1000, rumours say that John Machin
> <[EMAIL PROTECTED]> might have written:
>
>
>>Simon Brunning wrote:
>>
>>>On 7/1/05, Peter Maas <[EMAIL PROTECTED]> wrote:
>>>
>>>
Simon Brunning schrieb:
> Sibylle Koczian n
Roy Smith wrote:
> Peter Hansen <[EMAIL PROTECTED]> wrote:
>>I'll have to look into how to set up Windows XP to prevent users from
>>changing the time on their own, assuming that's possible.
>
> On a single-user system like Windows, you pretty much have to assume the
> user can do anything. The
Thanx all for responding.
I've been doing the epsilon comparisons, i had just hoped that to be a
temporary solution.
anyway, thanx for the responses
--
http://mail.python.org/mailman/listinfo/python-list
Yes, I knew that copying it to my root was a kludge. But between that
and not having it work, I chose the former. (As you might be able to
tell from my posts, I tried multiple things and was frustrated.) I
tried putting quotes around "c:\program files\python24". It still
didn't work.
I chose to in
On Saturday 02 July 2005 05:04 am, Ralf W. Grosse-Kunstleve wrote:
> I often find myself writing::
>
> class grouping:
>
> def __init__(self, x, y, z):
> self.x = x
> self.y = y
> self.z = z
> # real code, finally
Fortunately, you don't
If you're looking for a leight weight web development enviroment acting
as a front end for a database take a look at http://www.cherrypy.org
--
http://mail.python.org/mailman/listinfo/python-list
On Saturday 02 July 2005 10:55 am, phil wrote:
> Zope is like that to me. I ask what is it and the answer
> sounds like "Oh, it's oierbv for the zxcvioupo of 7cvn^djh'.
>
> Now understand, I know what very well what Python, Apache, PhP,
> MySQL, IE and javascript do. I just don't know what Zope
Christos "TZOTZIOY" Georgiou <[EMAIL PROTECTED]> wrote:
> Were there other Unix C compilers before K&R wrote one?
Considering that K&R (along with T) invented both Unix and C, I would say
that the answer to the above has to be "No".
--
http://mail.python.org/mailman/listinfo/python-list
Peter Hansen <[EMAIL PROTECTED]> wrote:
> I guess as long as the NTP client is set up to ensure the time
> adjustments are smaller than some value X, it would be acceptable.
NTP is generally capable of keeping the various system clocks on a LAN
within a few ms of each other, and within a few 10'
On Friday 01 July 2005 04:40 pm, Andreas Kostyrka wrote:
> It's even worse: shelve is basically a class that wraps a dictionary. It
> provides a dictionary string -> pickable object based on a dictioary
> string -> string. bsddb, gdbm etc. probably access files via lowlevel
> calls that are not int
> either... It sits under...
Well that's a relief, cause ...sits on top of
was confusing.
> A rather object-oriented system for managing and serving web
> applications and data (using object inheritance for common behavior,
> etc.) This makes Zope a toolkit, not an end application itself.
On Thu, 30 Jun 2005 20:55:20 -0400, rumours say that Mike Meyer
<[EMAIL PROTECTED]> might have written:
>Actually, I was thinking of pre-K&R Unix compilers.
There must be something I am missing here, cause I don't understand what
you mean; what is the earliest K&R C compiler ("Unix" compiler) you
On Thu, 30 Jun 2005 18:29:56 +0100, rumours say that Tom Anderson
<[EMAIL PROTECTED]> might have written:
>On Thu, 30 Jun 2005, Benji York wrote:
>
>> python-needs-more-duct-tape'ly yours,
>
>You're in luck: Python 3000 will replace duck typing with duct taping.
I would bet that somewhere in the
On 28 Jun 2005 13:24:42 -0700, rumours say that "muldoon"
<[EMAIL PROTECTED]> might have written:
> Now, what forum would you recommend? Any help would be appreciated.
alt.usage.english?
alt.languages.english?
alt.english.usage?
uk.culture.language.english?
--
TZOTZIOY, I speak England very be
On Friday 01 July 2005 11:13 pm, John Machin wrote:
> x BETWEEN y AND z
Ah, even better, thank you.
>The python equivalent would be to write it out as:
> >
> > if a > b-epsilon and a < b+epsilon:
> > print "a~=b"
>
> Try this:
>
> if b-epsilon < a < b+epsilon:
This I knew, but I
Ralf W. Grosse-Kunstleve wrote:
...
>class grouping:
>
>def __init__(self, x, y, z):
>self.x = x
>self.y = y
>self.z = z
># real code, finally
>
>This becomes a serious nuisance in complex applications with long
>argument lists, especiall
Roy Smith wrote:
> Peter Hansen <[EMAIL PROTECTED]> wrote:
> If you get the UTC time, daylight savings time doesn't enter the equation.
Of course... I didn't think of that approach. I don't actually care
about absolute time, so this should work fine for at least the DST case.
> If you care ab
Exactly what I'm looking for! Thanks
--
http://mail.python.org/mailman/listinfo/python-list
Peter Hansen <[EMAIL PROTECTED]> wrote:
> I would like to determine the "actual" elapsed time of an operation
> which could take place during a time change, in a platform-independent
> manner (at least across Linux/Windows machines).
>
> Using time.time() doesn't appear to be suitable, since tim
I would like to determine the "actual" elapsed time of an operation
which could take place during a time change, in a platform-independent
manner (at least across Linux/Windows machines).
Using time.time() doesn't appear to be suitable, since time might jump
forwards or backwards at the user's
flamesrock wrote:
> I looked at PyCrust, and while its given me a few cool ideas, I may
> have described the problem incorrectly. What I really need is not
> something that takes input, but merely redirects the 'print' statements
> to something like a terminal window.
>
> Is this even possible wi
Ralf W. Grosse-Kunstleve wrote:
> A shorter alternative (my personal favorite since minimally redundant)::
>
> class grouping:
>
> def __init__(self, .keep_this, .and_this, but_not_this,
> .but_this_again):
> # real code right here
There is also the variant which I proposed on p
Thanks much for your response.
I looked at PyCrust, and while its given me a few cool ideas, I may
have described the problem incorrectly. What I really need is not
something that takes input, but merely redirects the 'print' statements
to something like a terminal window.
Is this even possible
"Nathan Pinno" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>Brief question for anyone who knows the answer, because I don't.
> Is there anyway to make Python calculate square roots?
Python can calculate any calculable function of the objects it has to work
with. So the answer
"Colin J. Williams" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>Isn't this where the discussion should start? There should be some
>general policy guiding the types of modules which should be in the
>standard library.
A couple of times, Guido has given his general policy as gen
Bengt Richter wrote:
> On Thu, 30 Jun 2005 08:54:31 -0700, Scott David Daniels <[EMAIL PROTECTED]>
> wrote:
>>Or, perhaps:
>>class foo(object):
>>def __init__(self, *args, **kwargs):
>>super(foo, self).__init__(self, *args, **kwargs)
>>...
>>
>
> Doesn't super(
Patrick Rutkowski said unto the world upon 02/07/2005 09:25:
> On 7/2/05, Brian van den Broek <[EMAIL PROTECTED]> wrote:
>
>>Patrick Rutkowski said unto the world upon 02/07/2005 00:12:
>>
>>>That's... annoying, to say the least. And my number 4/5 was a rational
>>>number too; I can understand how
In article <[EMAIL PROTECTED]>,
"Walter Brunswick" <[EMAIL PROTECTED]> wrote:
> Why not just update the local dictionary?
>
> class Grouping:
> def __init__(self,x,y,z):
> self.__dict__.update(locals())
That's pretty clever. The only minor annoyance is that it creates a
self.self
Ralf W. Grosse-Kunstleve wrote:
> class grouping:
>
> def __init__(self, .x, .y, .z):
> # real code right here
The way this would work seems a bit inconsistent to me. Args normally
create local variables that receive references to the objects passed to
them.
In this c
Bengt Richter wrote:
> BTW, there's something about referring to type(self) by its not
> always dependably bound (though usually global) name that bothers me.
>
> I wonder if the above common use of super could be implemented as a property
> of object,
> so you'd normally inherit it and be able t
Florian Lindner wrote:
> Peter Hansen wrote:
>>[Zope] doesn't include
>>database interfaces other than to its own ZODB.
>
> That's not correct. Zope2 includes DB interfaces to MySQL, PostGre, ODBC and
> many others.
It actually *includes* them? I thought those were all add-in modules,
not one
On Thu, 30 Jun 2005 08:54:31 -0700, Scott David Daniels <[EMAIL PROTECTED]>
wrote:
>Sion Arrowsmith wrote:
>> ... And if you were to do so, surely:
>> class foo(object):
>> def __init__(self, *args, **kwargs):
>> super(foo, self).__init__(self)
>>
>> would be the preferred way to go?
>>
Vittorio wrote:
> print"""mailto:%s";>""" %(campovalore.encode('iso-8859-1'))
> print campovalore.encode('iso-8859-1')
> print ""
>
> campovalore is an email address with special (italian) characters.
> [snip]
> Any suggestion is welcome,
It might help if you showed us the output of "repr(x)
Nathan Pinno wrote:
>
> Hi all,
>
> Brief question for anyone who knows the answer, because I don't. Is
> there anyway to make Python calculate square roots?
http://docs.python.org/
There is a search facility.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the
Why not just update the local dictionary?
class Grouping:
def __init__(self,x,y,z):
self.__dict__.update(locals())
--
http://mail.python.org/mailman/listinfo/python-list
Scott David Daniels <[EMAIL PROTECTED]> writes:
> Rocco Moretti wrote:
>> Joseph Garvin wrote:
>>
>> I'm not aware of a language that allows it, but recently I've found
>> myself wanting the ability to transparently replace objects
>> I mainly look for it in the "object replaces self" form, bu
Hi all,
Brief question for anyone who knows the answer, because I don't. Is there
anyway to make Python calculate square roots?
Thanks,
Nathan Pinnohttp://www.npinnowebsite.ca/
--
http://mail.python.org/mailman/listinfo/python-list
Nathan Pinno wrote:
> Hi all,
>
> What's wrong with the following code? It says there is name error, that
> random is not defined. How do I fix it?
You need to import random.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allow
Nathan Pinno a écrit :
> Hi all,
>
> What's wrong with the following code? It says there is name error, that
> random is not defined. How do I fix it?
Add "import random" at the top of your file
Cheers,
SB
> # Plays the guessing game higher or lower.
> # Originally written by Josh Cogli
Hi all,
What's wrong with the following code? It says there is name error, that
random is not defined. How do I fix it?
# Plays the guessing game higher or lower.
# Originally written by Josh Cogliati, improved first by Quique, then by
Nathan Pinno.
print "Higher or Lower"
print
nu
Hi,
I have one problem ( I am a python beginner) in a cgi:
print"""mailto:%s";>""" %(campovalore.encode('iso-8859-1'))
print campovalore.encode('iso-8859-1')
print ""
campovalore is an email address with special (italian) characters.
>From IE6 everything is fine and the link launches my p
Robert Kern wrote:
> David Pratt wrote:
>
>> I have string text with language text records that looks like this:
>>
>> 'en' | 'the brown cow' | 'fr' | 'la vache brun'
> translations = [x.strip(" '") for x in line.split('|')]
> d = dict(zip(translations[::2], translations[1::2]))
One caevat is th
Jamey Cribbs <[EMAIL PROTECTED]> writes:
> Code blocks allow you to wrap up any Ruby code and pass it to a method
> and have it executed within that method. It is more powerful than
> lambda, because you can have multiple statements in the code block and
> you can do assignment within the code blo
Scanning quickly through the various response, I noticed that at least
one person suggested rur-ple (rur-ple.sf.net), hence Python. I would
second that ;-) ... but then, I am biased as the author of rur-ple!
rur-ple is intended to be a complete learning environment for learning
programming and P
Peter Hansen wrote:
> godwin wrote:
>
>> I wanna thank Martin for helping out with my ignorance concerning
>>execution of stored procedure with python. Now i have decided to write
>>a web app that googles into my companies proprietary database.
>>
>
> Just checking... do you really mean "g
Am Samstag, den 02.07.2005, 15:11 +0100 schrieb Tom Anderson:
> On Fri, 1 Jul 2005, Andreas Kostyrka wrote:
>
> > Am Freitag, den 01.07.2005, 08:25 -0700 schrieb George Sakkis:
> >
> >>> Again, how? Is there a way to force that an external user of my lib can
> >>> not use my internal data/methods/
Tom Anderson wrote:
> So, if you're a pythonista who loves map and lambda, and disagrees with
> Guido, what's your background? Functional or not?
I have no functional language background. Until recently, I had no use
for programming "expression to be evaluated later" or "deferred
expressions"
Peter Hansen wrote:
> godwin wrote:
>> I wanna thank Martin for helping out with my ignorance concerning
>> execution of stored procedure with python. Now i have decided to write
>> a web app that googles into my companies proprietary database.
>
> Just checking... do you really mean "googl
"Andrew Koenig" <[EMAIL PROTECTED]> wrote:
> In Python, unlike many other languages, the names of formal parameters are
> part of a function's interface. For example:
>
> def f(x, y):
> return x-y
>
> Now f(3, 4) is -1 and f(y=3,x=4) is 1.
>
> The names of instance variables are gen
1 - 100 of 136 matches
Mail list logo