Marcus Goldfish gmail.com> writes:
> Are there guidelines for when properties should be used vs. instance
> variables? For example, it often seems more convenient to directly
> use instance variables instead of properties, like MyClass2 listed
> below. Is one class more pythonic than the other?
> From: Alexis gmail.com>
> Hi people thanks to all of you for the suggestions, I am currently
> reading some programming books but it seems as if i can't findn a
> suitable one to get me started the way i want, i mean not only
> learning the basics but getting prepared for more complex programmin
Gooch, John echostar.com> writes:
> lst.sort(lambda m, n: cmp(m.get(field), n.get(field)))
> where field is either 'name' or 'size'.
> What is "n:" and what is "lambda m" ?
You could rewrite that in a more readable manner as follows:
def comparedict(dict1, dict2):
"Compares th
The reason you are looping forever is because you are not resetting
current_count to zero.
Let's step through your logic, assume that current_count = 2
- you enter into the if part of your logic
- prompt the user for a password
- user enters a password, let's assume it's not unicorn, and you stor
> We will not do your homework for you
[snip]
The slicing answer I posted is possibly the answer, but I assume that the
loop solution, which I didn't post (in Python), is what is actually
required. If slicing is what is wanted, then I apologise for giving an
answer! :)
=Tony.Meyer
_
> I have read about loops, strings, tuples. I am taking this
> class on distance education and I am lost with this
> assignment. I have read what Tony has wrote and that does me
> no good. I do not understand what he is talking about.
Which bits? The whole lot? I teach university students
for the slicing see: http://docs.python.org/lib/typesseq.html
for a longhand loop approach see:
http://docs.python.org/tut/node6.html#SECTION00620
On Apr 13, 2005, at 12:46 AM, Danny Yoo wrote:
-- Forwarded message --
Date: Tue, 12 Apr 2005 22:37:44 -0500
From: J
Hello Jim,
> I have read about loops, strings, tuples.
Can you show us an example of a loop? Can you show us the last program
that you've written?
It sounds like you've done a lot of reading. The problem with learning
how to program is that you can't just read it: you actually have to write
Gooch, John wrote:
I am working on a dictionary sorting problem just like the one in the email
thread at the bottom of this message. My question about their solution is:
In these lines:
lst.sort(lambda m, n: cmp(m.get(field), n.get(field)))
where field is either 'name' or 'size'.
Wh
-- Forwarded message --
Date: Tue, 12 Apr 2005 22:37:44 -0500
From: Jim and Laura Ahl <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Python backwards program
I have read about loops, strings, tuples. I am taking this class on distance
education and I
I'm trying to narrow down the detailed trials I need to go through in
selecting basic GUI module approaches (just getting started in this
Python "playground" - dev platform Mac OS X).
Maybe these old eyes are just missing it, but I can't seem to satisfy
my curiosity on the following:
1) Use o
On Wed, 13 Apr 2005, Tony Meyer wrote:
> > I am very new to programming and I have an assignment to have a
> > raw_input string that is inputted by the user and then is printed
> > backwards. Can anyone help me? I can get it to print regular but
> > backwards in not working.
>
> I guess that I
--- Marcus Goldfish <[EMAIL PROTECTED]> wrote:
> Are there guidelines for when properties should be used vs. instance
> variables? For example, it often seems more convenient to directly
> use instance variables instead of properties, like MyClass2 listed
> below. Is one class more pythonic than
> I am very new to programming and I have an assignment
> to have a raw_input string that is inputted by the user
> and then is printed backwards. Can anyone help me? I can
> get it to print regular but backwards in not working.
I guess that I shouldn't give code if this is for an assignment, bu
I am very new to programming and I have an assignment to have a raw_input
string that is inputted by the user and then is printed backwards.
Can anyone help me? I can get it to print regular but backwards in not
working.
Thank You
Jim
___
Tutor
Alexis wrote:
Hi, i would like to know if someone could recommend me some books to
get started not only the first book to read but if possible a few to
continue learning also.
If you have some programming background I recommend "Learning Python". "Python Cookbook" is an
excellent intermediate-leve
A couple of options...
You can pack a scrollbar on the right hand side of the containing frame and use
the yscrollcommand option to associate it with the frame --- see Fredrik Lundh's
Tkinter pages for an example.
Or you could grab Python MegaWidgets from http://pmw.sourceforge.com/ and use a
Pmw
On Tue, 12 Apr 2005, Marcus Goldfish wrote:
> Are there guidelines for when properties should be used vs. instance
> variables?
Hi Marcus,
In Python, it's easy to modify things so that things that look like
instance variable access are automatically shunted off to do programatic
stuff.
In Py
-- Forwarded message --
Date: Tue, 12 Apr 2005 17:16:18 -0300
From: Alexis <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Python starting books
Hi people thanks to all of you for the suggestions, I am currently
reading some programming books but it see
Are there guidelines for when properties should be used vs. instance
variables? For example, it often seems more convenient to directly
use instance variables instead of properties, like MyClass2 listed
below. Is one class more pythonic than the other?
# Example 1: class w/props vs. no-propt
cla
> The requested URL /hp/alan.gauld/ was not found on this server.
>
> Additionally, a 404 Not Found error was encountered while trying to use
> an ErrorDocument to handle the request.
Hi Alexis,
Odd! It might be that Alan's hosting service is doing something bonkers;
perhaps the service's virt
Alexis wrote:
Hi, i would like to know if someone could recommend me some books to
get started not only the first book to read but if possible a few to
continue learning also.
thnx in advance
___
Hi Alexis
Books I found really helpful were/are:
Magnus Lie
You can also check out How to Think Like a Computer Scientist at
http://www.ibiblio.org/obp/thinkCSpy/ .
Alan's page is up I checked it using Firefox.
Ara
"There is something to be learned from a rainstorm. When meeting with a
sudden shower, you try not to get wet and run quickly along the roa
Thnx for the info.
Unfortunately the site is unavailable
Not Found
The requested URL /hp/alan.gauld/ was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to
use an ErrorDocument to handle the request.
Will try searching for these documents later and tel
I've used http://www.freenetpages.co.uk/hp/alan.gauld/ Alan Gauld's both
for myself and to teach my students.
Ara
"There is something to be learned from a rainstorm. When meeting with a
sudden shower, you try not to get wet and run quickly along the road.
But doing such things as passing under
Hi, i would like to know if someone could recommend me some books to
get started not only the first book to read but if possible a few to
continue learning also.
thnx in advance
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listi
On Apr 12, 2005 12:20 PM, Gooch, John <[EMAIL PROTECTED]> wrote:
>
> I have a class named 'Dir' that I want to be put into another class
> 'DirList' ( essential a linked list of Dir objects ) using the 'insert()'
> method. The syntax is 'DirList.insert( Dir )' which works, but then I try to
> acc
Ben Markwell said unto the world upon 2005-04-12 12:56:
This is an exercise from "How to think like a Computer Scientist."
The following example shows how to use concatenation and a for loop to
generate an abecedarian series. "Abecedarian" refers to a series or list in
which the elements appear i
Ben Markwell writes:
This is an exercise from "How to think like a Computer Scientist."
The following example shows how to use concatenation and a for loop to
generate an abecedarian series. "Abecedarian" refers to a series or list in
which the elements appear in alphabetical order. For examp
This is an exercise from "How to think like a Computer Scientist."
The following example shows how to use concatenation and a for loop to generate an abecedarian series. "Abecedarian" refers
to a series or list in which the elements appear in alphabetical
order. For example, in Robert McCloskey
Brian van den Broek writes:
Joseph Quigley said unto the world upon 2005-04-11 20:23:
Well, now I've learned what def is good for. But what could I put in the
parenthesis of def foo():?
Of course self is always available, but what would maybe def
foo(number1): do? An error right? So I now repe
Title: Message
I have
a class named 'Dir' that I want to be put into another class 'DirList' (
essential a linked list of Dir objects ) using the 'insert()' method. The syntax
is 'DirList.insert( Dir )' which works, but then I try to access the 'getSize()'
function of the 'Dir' class from *i
Thanks C, John, Kent and Andrei.
I knew that someone had thought about this problem before :). But i couldnt
relize that the problem was this widespread and had so many names.
Thanks for pointing me in the right direction. The problem is a bit over my
head but its fun with some brain exercise :
Joseph Quigley said unto the world upon 2005-04-11 20:23:
Well, now I've learned what def is good for. But what could I put in the
parenthesis of def foo():?
Of course self is always available, but what would maybe def
foo(number1): do? An error right? So I now repeat my self, what else
besides
I am working on a dictionary sorting problem just like the one in the email
thread at the bottom of this message. My question about their solution is:
In these lines:
lst.sort(lambda m, n: cmp(m.get(field), n.get(field)))
where field is either 'name' or 'size'.
What is "n:" and wha
Joseph Quigley wrote:
Hi,
It seems that whenever I click the QUIT button the TK windows freezes,
then I have to CTRL-ALT-DEL to be able to shut it down. Here's the code
(its not mine though):
It works if you run from the command line instead of inside IDLE. I thought IDLE was supposed to be
able
Hi everyone
I don't know if anyone posted something similar but I'll shoot.
Is there anyway to Scroll over a Frame??
Let me put this under water. I made a 2D blueprint inside a frame. I'm creating labels dynamically depending on how many rows and columns I want. Suppose you have an 8x8 matriz of l
>>> def foo(x):
... print x
...
>>> foo('hi')
hi
What goes in the brackets is simply the arguments that foo() works with.
>>>def foo(a,b):
... return a + b
>>> sum = foo(5,10)
>>>print sum
15
>>> conjun = foo("Hi ", "Dave")
>>>print conjun
Hi Dave
Good luck,
Liam ClarkeOn Apr 12
Well, now I've learned what def
is good for. But what could I put in the parenthesis of
def foo():?
Of course self is always available, but what would maybe
def foo(number1): do? An error
right? So I now repeat my self, what else besides self could I put in
there?
Thanks,
Joseph
__
Hi,
It seems that whenever I click the QUIT button the TK windows freezes,
then I have to CTRL-ALT-DEL to be able to shut it down. Here's the code
(its not mine though):
from Tkinter import *
class App:
def __init__(self, master):
frame = Frame(master)
frame.pack()
Don't worry about it. No hard feelings. jeje ;-)
I notice about the == and != at the end after I posted it. Sorry about it.
And yes, your piece of code is more efficient and does the same so I think that's it for who asked, which I may say hasn't posted back.
Thanks for the reply
RegardsAlberto
G
Gregor Lingl wrote at 11:27 10/29/2004:
Hi Dick!
Accidentally I just was tinkering around with the new
decimal module of Python2.4. (By the way: it also works
with Python 2.3 - just copy it into /Python23/Lib)
The attached program uses a very elementary (and inefficient)
formula to calculate pi, na
Also you should try the MSDN documentation on Excel, since most
methods you are going to use are Excel related more than Python
related, that is, win32all is and wrapper for Excel methods. Hope I´m
not mistaken on this one :-)
On Apr 11, 2005 8:43 PM, Liam Clarke <[EMAIL PROTECTED]> wrote:
> PS
Michael Janssen wrote at 10:30 4/11/2005:
On Apr 10, 2005 7:18 AM, Dick Moores <[EMAIL PROTECTED]> wrote:
> I'm a newbie, but would this qualify as a contribution to
UselessPython 2.0?
Hello Dick,
don't be shy, or do you suspect it might be too usefull? ;-) I found
it funny, so it must be good en
44 matches
Mail list logo