Roy Smith r...@panix.com writes:
I'm still searching for as nice a font to use on Linux.
Envy Code R is a lookalike, so maybe worth considering. I haven't
tried actual Monaco on Linux, but apparently it's possible.
Personally, I use -lfp-gamow-medium-r-*-*-7-*-*-*-*-*-*-* in Linux
(Emacs).
--
I really enjoyed it when I put the MacOsx font on my Ubuntu or any other.
Anssi Saari a...@sci.fi wrote:
Roy Smith r...@panix.com writes:
I'm still searching for as nice a font to use on Linux.
Envy Code R is a lookalike, so maybe worth considering. I haven't
tried actual Monaco on Linux,
On 2010-11-14, Roy Smith r...@panix.com wrote:
Then, there are people who try to program in proportional
fonts. The mind boggles. For a (thankfully short) while some
years ago, people were publishing programming books with the
code samples in proportional fonts. Blech.
I kinda like it, but
Hello Pythonistas!
I'm trying to get floating point division to work; I'm using Python
2.6.5. When I enter 'from _future_ import division' at the command
line, I get the ImportError, no module named _future_. How can I
rectify this?
Sorry for this basic question, but I don't know where else to
From the error, you are importing wrong module which actually does not
exists
try importing something from maths
On Sun, Nov 14, 2010 at 8:21 PM, otenki scott.stephen...@gmail.com wrote:
Hello Pythonistas!
I'm trying to get floating point division to work; I'm using Python
2.6.5. When I
On 14/11/2010 3:00 PM, Nitin Pawar wrote:
I'm trying to get floating point division to work; I'm using Python
2.6.5. When I enter 'from _future_ import division' at the command
line, I get the ImportError, no module named _future_. How can I
rectify this?
That should be two underscores, not
otenki wrote:
Hello Pythonistas!
I'm trying to get floating point division to work; I'm using Python
2.6.5. When I enter 'from _future_ import division' at the command
line, I get the ImportError, no module named _future_. How can I
rectify this?
You need two leading/trailing underscores,
On 15/11/2010, otenki scott.stephen...@gmail.com wrote:
When I enter 'from _future_ import division' at the command
line, I get the ImportError, no module named _future_.
The module name is __future__
Notice that there are 2 underscore characters before the word future
and 2 after it. This is
On Nov 14, 10:09 am, David bouncingc...@gmail.com wrote:
On 15/11/2010, otenki scott.stephen...@gmail.com wrote:
When I enter 'from _future_ import division' at the command
line, I get the ImportError, no module named _future_.
The module name is __future__
Notice that there are 2
In article mailman.986.1289747396.2218.python-l...@python.org,
David bouncingc...@gmail.com wrote:
On 15/11/2010, otenki scott.stephen...@gmail.com wrote:
When I enter 'from _future_ import division' at the command
line, I get the ImportError, no module named _future_.
The module name is
On 14/11/2010 16:40, Roy Smith wrote:
In articlemailman.986.1289747396.2218.python-l...@python.org,
Davidbouncingc...@gmail.com wrote:
On 15/11/2010, otenkiscott.stephen...@gmail.com wrote:
When I enter 'from _future_ import division' at the command
line, I get the ImportError, no module
James Stroud schrieb:
Yes, and finding ways to have employees pointlessly waste time is equal
to simply removing them.
Not as long as they are paid for the wasted time.
--
http://mail.python.org/mailman/listinfo/python-list
James wrote:
Hello,
I work in this annoying company where I have to autheticate myself to
the company firewall every 30-50 minutes in order to access the
internet. (I think it's a checkpoint fw).
I have to run telnet what.ever.ip.address 259 then it prompts me
with userid, then
Tina I wrote:
James wrote:
Hello,
I work in this annoying company where I have to autheticate myself to
the company firewall every 30-50 minutes in order to access the
internet. (I think it's a checkpoint fw).
I have to run telnet what.ever.ip.address 259 then it prompts me
with userid,
James Stroud wrote:
Tina I wrote:
James wrote:
Hello,
I work in this annoying company where I have to autheticate myself to
the company firewall every 30-50 minutes in order to access the
internet. (I think it's a checkpoint fw).
I have to run telnet what.ever.ip.address 259 then it
Hello,
I work in this annoying company where I have to autheticate myself to
the company firewall every 30-50 minutes in order to access the
internet. (I think it's a checkpoint fw).
I have to run telnet what.ever.ip.address 259 then it prompts me
with userid, then password, then I have to
James wrote:
Hello,
I work in this annoying company where I have to autheticate myself to
the company firewall every 30-50 minutes in order to access the
internet. (I think it's a checkpoint fw).
I have to run telnet what.ever.ip.address 259 then it prompts me
with userid, then
James wrote:
Hello,
I work in this annoying company where I have to autheticate myself to
the company firewall every 30-50 minutes in order to access the
internet. (I think it's a checkpoint fw).
I have to run telnet what.ever.ip.address 259 then it prompts me
with userid, then
why should I use *args,
as in my ignorance,
making use of a list (or tupple) works just as well,
and is more flexible in it's calling.
So the simple conclusion might be: never use *args,
or am I overlooking something ?
# method 1
def execute (self, *args):
for i in range ( len(args)
stef wrote:
why should I use *args,
as in my ignorance,
making use of a list (or tupple) works just as well,
and is more flexible in it's calling.
So the simple conclusion might be: never use *args,
or am I overlooking something ?
Yup. For example decorators, that wrap functions. If you
stef a écrit :
why should I use *args,
as in my ignorance,
making use of a list (or tupple) works just as well,
and is more flexible in it's calling.
Err... How so ?
So the simple conclusion might be: never use *args,
or am I overlooking something ?
Try writing generic higher order
On Jan 31, 5:41 am, stef [EMAIL PROTECTED] wrote:
why should I use *args,
as in my ignorance,
making use of a list (or tupple) works just as well,
and is more flexible in it's calling.
Others have mentioned the instances in which it's actually useful -
for catch-all arguments. But you also
It's bad practice to use built-ins like 'list' as a regular variable
name.
ok, but it was just an example (in practice, I always use very long
names ;-)
# calling method 1:
execute (S[0], S[4] )
# calling method 2:
execute ( ( S[0], S[4] ) )
Let's take a look at those
stef wrote:
# method 2
def chunk_plot(self, list):
for i in range ( len(list) ):
do something
And one note more. Just to be more pythonic you shouldn't use form
range(len(blabla)). Instead use:
for i in list:
blabla...
--
Sincerely,
Eugene Antimirov
Eugene Antimirov wrote:
stef wrote:
# method 2
def chunk_plot(self, list):
for i in range ( len(list) ):
do something
And one note more. Just to be more pythonic you shouldn't use form
range(len(blabla)). Instead use:
for i in list:
blabla...
I
stef wrote:
And one note more. Just to be more pythonic you shouldn't use form
range(len(blabla)). Instead use:
for i in list:
blabla...
I would love that,
but please tell me how (I need an integer counter for something else too):
for index, item in enumerate(args):
...
In [EMAIL PROTECTED], stef wrote:
Eugene Antimirov wrote:
And one note more. Just to be more pythonic you shouldn't use form
range(len(blabla)). Instead use:
for i in list:
blabla...
I would love that,
but please tell me how (I need an integer counter for something else too):
I would love that,
but please tell me how (I need an integer counter for something else too):
def chunk_plot(*args):
if len(args) == 1: list = args[0]
else: list = args
color = ['g','r','b','y','m']
plot ( list[0], color[0])
hold (True)
for i in range
Mary Jane Boholst a écrit :
Hello everyone,
I have a question that google couldnt answer for me and thought that the
brains on here might be able to help.
I am trying to upload a file to a database
What do you mean upload a file to a database ? I know how to uplaod a
file (from a web form to
Hello everyone,
I have a question that google couldnt answer for me and thought that the
brains on here might be able to help.
I am trying to upload a file to a database using a (cgi) form and am
having trouble doing this. I think that I need some way of escaping the
file contents or making it so
Lots of smart, patient people here, but they can't help you until you
provide a lot more information and the actual error messages you are
getting and whether they are spawned by Python or MySQL, if that is
indeed the db you are using. Where did you get the idea that Python
might be involved?
Mary Jane Boholst wrote:
I am trying to upload a file to a database using a (cgi) form and am
having trouble doing this. I think that I need some way of escaping the
file contents or making it so that mysql/python (not sure which) will
ignore the files actual contents and store it in the db
Antoon Pardon [EMAIL PROTECTED] writes:
Op 2005-12-11, Steven D'Aprano schreef [EMAIL PROTECTED]:
On Sat, 10 Dec 2005 15:46:35 +, Antoon Pardon wrote:
Do you really think that my class and some other class written by
another person will have the same API?
If both writers try to implement
Op 2005-12-11, Steven D'Aprano schreef [EMAIL PROTECTED]:
On Sat, 10 Dec 2005 15:46:35 +, Antoon Pardon wrote:
But I *want* other classes to poke around inside my implementation.
That's a virtue, not a vice. My API says:
In addition to the full set of methods which operate on the
On Mon, 12 Dec 2005 12:12:46 +, Antoon Pardon wrote:
And maybe it isn't a Coordinate class at all, hmmm?
Indeed it isn't. It is usually a Point class.
An ordinary, Cartesian, real-valued Coordinate is a pair of ordinates, an
X and Y ordinates. That's what it *is* -- a coordinate class
Op 2005-12-12, Steven D'Aprano schreef [EMAIL PROTECTED]:
On Mon, 12 Dec 2005 12:12:46 +, Antoon Pardon wrote:
And maybe it isn't a Coordinate class at all, hmmm?
Indeed it isn't. It is usually a Point class.
An ordinary, Cartesian, real-valued Coordinate is a pair of ordinates, an
X
Mike Meyer wrote:
[EMAIL PROTECTED] (Alex Martelli) writes:
Mike Meyer [EMAIL PROTECTED] wrote:
In addition to the full set of methods which operate on the coordinate
as
a whole, you can operate on the individual ordinates via instance.x and
instance.y which are floats.
That's
Steve Holden [EMAIL PROTECTED] writes:
[...]
The Law of Demeter isn't about *how* you access objects, it's about
what interfaces to objects you can legally manipulate without undue
instability across refactoring. In other words, it's about semantics,
not syntax. And it's led a lot of Java
Paul Rubin wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
The fact that sys is a module and not a class is a red herring. If the
Law of Demeter makes sense for classes, it makes just as much sense for
modules as well -- it is about reducing coupling between pieces of code,
not something
Mike Meyer [EMAIL PROTECTED] wrote:
...
It's not my cherished example - it actually came from someone
You picked it to (try and fail to) show that there is DIFFICULTY, which
I showed there isn't.
else. That you can change the requirements so that there is no extra
work is immaterial - all
Mike Meyer [EMAIL PROTECTED] wrote:
...
Claim: doing X makes Y hard.
Harder, not hard.
The specific wording you used was MORE DIFFICULT.
Here is an example of doing X where Y is easy
Y is very easy in any case. Making it incrementally harder doesn't
make it hard - it's still very
[EMAIL PROTECTED] (Alex Martelli) writes:
Mike Meyer [EMAIL PROTECTED] wrote:
...
It's not my cherished example - it actually came from someone
You picked it to (try and fail to) show that there is DIFFICULTY, which
I showed there isn't.
No, you showed you could change the example so
Mike Meyer [EMAIL PROTECTED] wrote:
...
Except you haven't shown that the API was badly designed. You can't
show that it's badly designed, because you don't know the requirements
that the API is meeting.
I can show that an API is badly designed *whatever requirements it might
be intended
[EMAIL PROTECTED] (Alex Martelli) writes:
Mike Meyer [EMAIL PROTECTED] wrote:
...
Except you haven't shown that the API was badly designed. You can't
show that it's badly designed, because you don't know the requirements
that the API is meeting.
I can show that an API is badly designed
Mike Meyer wrote:
And you've once again missed the point. The reason you don't
manipulate the attributes directly is because it violates
encapsulation, and tightens the coupling between your class and the
classes it uses. It means you see the implementation details of the
classes you are
On Sat, 10 Dec 2005 01:28:52 -0500, Mike Meyer wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
On Thu, 08 Dec 2005 20:46:33 -0500, Mike Meyer wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
Paul Rubin wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
Yes. Reaching through objects to do
On 2005-12-10, Steven D'Aprano [EMAIL PROTECTED] wrote:
On Sat, 10 Dec 2005 01:28:52 -0500, Mike Meyer wrote:
The not-so-wise programmer takes abstraction as an end itself, and
consequently spends more time and effort defending against events which
almost certainly will never happen than it
Mike Meyer [EMAIL PROTECTED] wrote:
...
it. Nothing you do with zim.foo or zim.foo.bar can change the state of
zim. The only invariants you need to check are bar's, which you do at
the exit to it's baz method.
So foo's class is not allowed to have as its invariant any formula
Steven D'Aprano [EMAIL PROTECTED] writes:
In particular,
you can get most of your meaningless methods out of a properly
designed Coordinate API. For example, add/sub_x/y_ord can all be
handled with move(delta_x = 0, delta_y = 0).
Here is my example again:
[quote]
Then, somewhere in my
[EMAIL PROTECTED] (Alex Martelli) writes:
Mike Meyer [EMAIL PROTECTED] wrote:
...
it. Nothing you do with zim.foo or zim.foo.bar can change the state of
zim. The only invariants you need to check are bar's, which you do at
the exit to it's baz method.
So foo's class is not allowed to
Mike Meyer [EMAIL PROTECTED] wrote:
...
Well, the hard-core solution is to note that your class doesn't really
deal with the type Bar, but deals with a subtype of Bar for which x
23 in all cases. Since types are represented by classes, you should
subclass Bar so you have a class that
Mike Meyer [EMAIL PROTECTED] wrote:
In addition to the full set of methods which operate on the coordinate as
a whole, you can operate on the individual ordinates via instance.x and
instance.y which are floats.
That's an API which makes changing the object more difficult. It may
be the
[EMAIL PROTECTED] (Alex Martelli) writes:
Mike Meyer [EMAIL PROTECTED] wrote:
...
Well, the hard-core solution is to note that your class doesn't really
deal with the type Bar, but deals with a subtype of Bar for which x
23 in all cases. Since types are represented by classes, you should
[EMAIL PROTECTED] (Alex Martelli) writes:
Mike Meyer [EMAIL PROTECTED] wrote:
In addition to the full set of methods which operate on the coordinate as
a whole, you can operate on the individual ordinates via instance.x and
instance.y which are floats.
That's an API which makes changing
[EMAIL PROTECTED] (Alex Martelli) writes:
You could make a case for a 2D coordinate class being sufficiently
primitive to have immutable instances, of course (by analogy with
numbers and strings) -- in that design, you would provide no mutators,
and therefore neither would you provide setters
[EMAIL PROTECTED] (Alex Martelli) writes:
You could make a case for a 2D coordinate class being sufficiently
primitive to have immutable instances, of course (by analogy with
numbers and strings) -- in that design, you would provide no mutators,
and therefore neither would you provide setters
Mike Meyer [EMAIL PROTECTED] wrote:
...
Take our much-abused coordinate example, and assume you've exposed the
x and y coordinates as attributes.
Now we have a changing requirement - we want to get to make the polar
coordinates available. To keep the API consistent, they should be
Paul Rubin http://[EMAIL PROTECTED] wrote:
...
I could imagine using Python's built-in complex numbers to represent
2D points. They're immutable, last I checked. I don't see a big
conflict.
No big conflict at all -- as I recall, last I checked, computation on
complex numbers was optimized
Bernhard Herzog [EMAIL PROTECTED] wrote:
...
and y, obviously. However, a framework for 2D geometry entirely based
on immutable-instance classes would probably be unwieldy
Skencil's basic objects for 2d geometry, points and transformations, are
immutable. It works fine. Immutable
[EMAIL PROTECTED] (Alex Martelli) writes:
I could imagine using Python's built-in complex numbers to represent
2D points. They're immutable, last I checked. I don't see a big
conflict.
No big conflict at all -- as I recall, last I checked, computation on
complex numbers was optimized
Paul Rubin http://[EMAIL PROTECTED] wrote:
...
Right, you could use properties to make point.x get the real part of
an internal complex number. But now you're back to point.x being an
accessor function; you've just set things up so you can call it
without parentheses, like in Perl. E.g.
Paul Rubin wrote:
Right, you could use properties to make point.x get the real part of
an internal complex number. But now you're back to point.x being an
accessor function; you've just set things up so you can call it
without parentheses, like in Perl. E.g.
a = point.x
b =
[EMAIL PROTECTED] (Alex Martelli) writes:
def setRho(self, rho):
c = self.fromPolar(rho, self.getTheta())
self.x, self.y = c.x, c.y
def setTheta(self, theta):
c = self.fromPolar(self.getRho(), theta)
self.x, self.y = c.x, c.y
That's the maximum
On Sat, 10 Dec 2005 13:33:25 -0500, Mike Meyer wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
In particular,
you can get most of your meaningless methods out of a properly
designed Coordinate API. For example, add/sub_x/y_ord can all be
handled with move(delta_x = 0, delta_y = 0).
Here
Mike Meyer [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] (Alex Martelli) writes:
def setRho(self, rho):
c = self.fromPolar(rho, self.getTheta())
self.x, self.y = c.x, c.y
def setTheta(self, theta):
c = self.fromPolar(self.getRho(), theta)
self.x,
On Sat, 10 Dec 2005 22:56:12 -0500, Mike Meyer wrote:
[snip]
Really, I don't think this makes a good poster child for your attribute
mutators make life more difficult campaign...;-)
The claim is that there exists cases where that's true. This cases
demonstrates the existence of such cases.
On Sat, 10 Dec 2005 15:46:35 +, Antoon Pardon wrote:
Do you lie awake at nights worrying that in Python 2.6 sys.stdout will be
renamed to sys.standard_output, and that it will no longer have a write()
method? According to the law of Demeter, you should, and the writers of
the sys module
Steven D'Aprano [EMAIL PROTECTED] writes:
The fact that sys is a module and not a class is a red herring. If the
Law of Demeter makes sense for classes, it makes just as much sense for
modules as well -- it is about reducing coupling between pieces of code,
not something specific to classes.
Steven D'Aprano [EMAIL PROTECTED] writes:
On Sat, 10 Dec 2005 13:33:25 -0500, Mike Meyer wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
In particular,
you can get most of your meaningless methods out of a properly
designed Coordinate API. For example, add/sub_x/y_ord can all be
handled
[EMAIL PROTECTED] (Alex Martelli) writes:
Mike Meyer [EMAIL PROTECTED] wrote:
Really, I don't think this makes a good poster child for your attribute
mutators make life more difficult campaign...;-)
The claim is that there exists cases where that's true. This cases
demonstrates the
Steven D'Aprano [EMAIL PROTECTED] writes:
On Sat, 10 Dec 2005 22:56:12 -0500, Mike Meyer wrote:
Really, I don't think this makes a good poster child for your attribute
mutators make life more difficult campaign...;-)
The claim is that there exists cases where that's true. This cases
http://en.wikipedia.org/wiki/Law_of_Demeter
That was fun. Thanks, Kent.
rd
--
http://mail.python.org/mailman/listinfo/python-list
Mike Meyer [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] (Alex Martelli) writes:
Mike Meyer [EMAIL PROTECTED] wrote:
My standard object interface is modeled after Meyer's presentation in
OOSC: an objects state is manipulated with methods and examined with
attributes; manipulating attributes
[EMAIL PROTECTED] (Alex Martelli) writes:
Mike Meyer [EMAIL PROTECTED] wrote:
for an object, and methods are the knobs/dials/etc. This also ties in
with the compiler having facilities to check class invariants. If you
allow assignments to attributes in other classes, the assignments have
to
Mike Meyer [EMAIL PROTECTED] wrote:
...
What classes' invariants do you have to check in those cases? E.g.,
consider zim.foo.bar.baz() -- you do have to check the invariants of
bar, foo AND zim, right?
Nope, just bar. Attributes display state, they don't let you change
it. Nothing
[EMAIL PROTECTED] (Alex Martelli) writes:
Mike Meyer [EMAIL PROTECTED] wrote:
What classes' invariants do you have to check in those cases? E.g.,
consider zim.foo.bar.baz() -- you do have to check the invariants of
bar, foo AND zim, right?
Nope, just bar. Attributes display state, they
On Thu, 08 Dec 2005 20:46:33 -0500, Mike Meyer wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
Paul Rubin wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
Yes. Reaching through objects to do things is usually a bad idea.
I don't necessarily disagree, but I don't understand why you say this.
Steven D'Aprano [EMAIL PROTECTED] writes:
On Thu, 08 Dec 2005 20:46:33 -0500, Mike Meyer wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
Paul Rubin wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
Yes. Reaching through objects to do things is usually a bad idea.
I don't necessarily disagree,
I think that's supposed to be [(i + j) % 2] for the index to the
(green,red) tuple
(since i*8 is always even).
[EMAIL PROTECTED] wrote:
Mike,
Thanks for your insight. It has been a big help.
I guess I was trying to learn too much with my original code. Trying to
implement inheritance,
On Wed, 07 Dec 2005 23:58:02 -0500, Mike Meyer wrote:
solaris_1234 [EMAIL PROTECTED] writes:
1) The stmt board.Blist[10].DrawQueen(board.Blist[10].b1) seems
awkward. Is there another way (cleaner, more intuitive) to get the
same thing done?
Yes. Reaching through objects to do things is
Steven D'Aprano wrote:
On Wed, 07 Dec 2005 23:58:02 -0500, Mike Meyer wrote:
1) The stmt board.Blist[10].DrawQueen(board.Blist[10].b1) seems
awkward. Is there another way (cleaner, more intuitive) to get the
same thing done?
Yes. Reaching through objects to do things is usually a bad idea.
Steven D'Aprano [EMAIL PROTECTED] writes:
On Wed, 07 Dec 2005 23:58:02 -0500, Mike Meyer wrote:
solaris_1234 [EMAIL PROTECTED] writes:
1) The stmt board.Blist[10].DrawQueen(board.Blist[10].b1) seems
awkward. Is there another way (cleaner, more intuitive) to get the
same thing done?
Yes.
Steven D'Aprano [EMAIL PROTECTED] writes:
Yes. Reaching through objects to do things is usually a bad idea.
I don't necessarily disagree, but I don't understand why you say this. Why
it is bad?
The traditional OOP spirit is to encapsulate the object's entire
behavior in the class definition.
[EMAIL PROTECTED] a écrit :
I'm off to study the code. (Hmm.. how does python parse (green,
red)[(i * 8 + j) % 2] command ...
(green, red)[0] == green
(green, red)[1] == red
(i * 8 + j) is somewhat trivial (just take care of precedence order),
and will return an integer
% is the modulo
Paul Rubin wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
Yes. Reaching through objects to do things is usually a bad idea.
I don't necessarily disagree, but I don't understand why you say this. Why
it is bad?
The traditional OOP spirit is to encapsulate the object's entire
behavior
Steven D'Aprano [EMAIL PROTECTED] writes:
Paul Rubin wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
Yes. Reaching through objects to do things is usually a bad idea.
I don't necessarily disagree, but I don't understand why you say this. Why
it is bad?
The traditional OOP spirit is to
Mike Meyer [EMAIL PROTECTED] wrote:
My standard object interface is modeled after Meyer's presentation in
OOSC: an objects state is manipulated with methods and examined with
attributes; manipulating attributes doesn't change the internal state
of the object. This makes it possible to change
[EMAIL PROTECTED] (Alex Martelli) writes:
Mike Meyer [EMAIL PROTECTED] wrote:
My standard object interface is modeled after Meyer's presentation in
OOSC: an objects state is manipulated with methods and examined with
attributes; manipulating attributes doesn't change the internal state
of the
I am a python newbie and have been trying to learn python. To this
end, I have coded the following program creates:
a 8 by 8 checker board
Places two checkers on the board
Checks the board and prints out which squares has a checker on them.
It works. But I have a one question:
1) The stmt
solaris_1234 [EMAIL PROTECTED] writes:
1) The stmt board.Blist[10].DrawQueen(board.Blist[10].b1) seems
awkward. Is there another way (cleaner, more intuitive) to get the
same thing done?
Yes. Reaching through objects to do things is usually a bad idea. Some
languages don't allow you to do
Mike,
Thanks for your insight. It has been a big help.
I guess I was trying to learn too much with my original code. Trying to
implement inheritance, object creation, calling methods via inheritance
made the code harder than it needed to be.
I'm off to study the code. (Hmm.. how does python
Nathan Pinno wrote:
Hi all,
How do I make Python get a def? Is it the get function, or something
else? I need to know so that I can get a def for that computer
MasterMind(tm) game that I'm writing.
BTW, I took your advice, and wrote some definitions for my Giant
Calculator program.
Hi all,
How do I make Python get a def? Is it the get function, or something
else? I need to know so that I can get a def for that computer
MasterMind(tm) game that I'm writing.
BTW, I took your advice, and wrote some definitions for my Giant
Calculator program. Might make the code
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.
Thanks.
--
Nathan Pinno
http://www.npinnowebsite.ca/
--
Nathan Pinno said unto the world upon 02/07/2005 02:25:
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.
Thanks.
--
Nathan Pinno
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 number.
96 matches
Mail list logo