[Tutor] date matching with python and sqlite3

2007-08-31 Thread Che M
I'm trying to allow users to select data from an sqlite database using Python by choosing either a date or a range of dates. I'm stuck at just allowing the to select data that entered the database "today" and return values from a column called duration. I have this mess at the moment: #assume

Re: [Tutor] problem resulting from installing 3.0

2007-08-31 Thread Dick Moores
At 05:25 PM 8/31/2007, Kent Johnson wrote: >Dick Moores wrote: >>XP, Python 2.5.1 >>I installed 3.0 alpha out of curiosity in a separate folder from >>2.5.1. Then I found that both 2.5.1's IDLE and my main Python >>editor Ulipad would no longer open. My first idea was that the >>installation of

Re: [Tutor] problem resulting from installing 3.0

2007-08-31 Thread Dick Moores
At 04:20 PM 8/31/2007, you wrote: >"Dick Moores" <[EMAIL PROTECTED]> wrote > > > and ulipad.pyw. How can I get back to where I was before, without > > that annoying console opening? > >Sorry, no idea - thats why I never install alpha software! :-) > > > PYTHONPATH: > > E:\Python25\;E:\PythonWork\;

Re: [Tutor] problem resulting from installing 3.0

2007-08-31 Thread Kent Johnson
Dick Moores wrote: > XP, Python 2.5.1 > > I installed 3.0 alpha out of curiosity in a separate folder from > 2.5.1. Then I found that both 2.5.1's IDLE and my main Python editor > Ulipad would no longer open. My first idea was that the installation > of 3.0 somehow changed my path. But it didn'

Re: [Tutor] Starting classes

2007-08-31 Thread Kent Johnson
Ara Kooser wrote: > def look(here): > "Look around the place you are in" > print here.description This is technicaly OK but conventionally the first argument to a method is 'self'. Since you are learning it would be good to keep to the convention. > outside1 = Area("Outside"

[Tutor] Python 3000 has just become less mythical

2007-08-31 Thread Terry Carroll
The first Alpha release of Python 3000 was released today: http://python.org/download/releases/3.0/ Guido's post: http://www.artima.com/weblogs/viewpost.jsp?thread=213583 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/l

Re: [Tutor] problem resulting from installing 3.0

2007-08-31 Thread Alan Gauld
"Dick Moores" <[EMAIL PROTECTED]> wrote > and ulipad.pyw. How can I get back to where I was before, without > that annoying console opening? Sorry, no idea - thats why I never install alpha software! :-) > PYTHONPATH: > E:\Python25\;E:\PythonWork\;E:\Programs\Ulipad3.7\ > > And another question

Re: [Tutor] Starting classes

2007-08-31 Thread Alan Gauld
<[EMAIL PROTECTED]> wrote > def look(here): >"Look around the place you are in" >print here.description > > Not sure if this works as is, I believe it depends on the > interpreter, but > it is customary to use the word self as the first parameter, It is just a custom and 'here'

Re: [Tutor] Starting classes

2007-08-31 Thread Ricardo Aráoz
Eric Brunson wrote: > Ara Kooser wrote: >> Hello, >> I read Alan Gauld's and How to Think Like a Computer Scientist >> section on classes. So I tried to write a simple room class. My goal >> is to write a short text adventure using classes. Here is the code: >> >> class Area: >> def _init_(se

Re: [Tutor] or synxtax in if statement

2007-08-31 Thread Brian Wisti
On 8/31/07, David Bear <[EMAIL PROTECTED]> wrote: > > I think I want to be lazy and express this > > if a == b | a = c > (if a equal b or a equals c) > using > > if a == b | c > > it seems to work.. but I'm not sure if it is correct -- and I haven't seen > any documentation on using this type of sy

[Tutor] Fw: Starting classes

2007-08-31 Thread christopher . henk
Oops, forgot to reply all. Chris Henk - Forwarded by Christopher Henk/US/ATD/GMC on 08/31/2007 04:55 PM - Christopher Henk/US/ATD/GMC 08/31/2007 04:13 PM To "Ara Kooser" <[EMAIL PROTECTED]> cc Subject Re: [Tutor] Starting classes The class definition will only have the methods and

[Tutor] problem resulting from installing 3.0

2007-08-31 Thread Dick Moores
XP, Python 2.5.1 I installed 3.0 alpha out of curiosity in a separate folder from 2.5.1. Then I found that both 2.5.1's IDLE and my main Python editor Ulipad would no longer open. My first idea was that the installation of 3.0 somehow changed my path. But it didn't. After uninstalling 3.0, and

Re: [Tutor] or synxtax in if statement

2007-08-31 Thread Eric Brunson
David Bear wrote: > I think I want to be lazy and express this > > if a == b | a = c > (if a equal b or a equals c) > using > > if a == b | c > > it seems to work.. but I'm not sure if it is correct -- and I haven't seen > any documentation on using this type of syntax. > > > The pipe is the "bi

Re: [Tutor] or synxtax in if statement

2007-08-31 Thread Smith, Jeff
That definitely won't work. How could the language possibly determine if you meant a == b | a == c as opposed to the literal a == b | c What this becomes is a == (b | c) Also be aware that | is a "bitwise or" and not a logical "or" which may not be what you want. So your original expressio

[Tutor] or synxtax in if statement

2007-08-31 Thread David Bear
I think I want to be lazy and express this if a == b | a = c (if a equal b or a equals c) using if a == b | c it seems to work.. but I'm not sure if it is correct -- and I haven't seen any documentation on using this type of syntax. -- -- David Bear College of Public Programs at Arizona State

Re: [Tutor] Starting classes

2007-08-31 Thread Eric Brunson
Ara Kooser wrote: > Hello, > I read Alan Gauld's and How to Think Like a Computer Scientist > section on classes. So I tried to write a simple room class. My goal > is to write a short text adventure using classes. Here is the code: > > class Area: > def _init_(self, name, description): >

[Tutor] Starting classes

2007-08-31 Thread Ara Kooser
Hello, I read Alan Gauld's and How to Think Like a Computer Scientist section on classes. So I tried to write a simple room class. My goal is to write a short text adventure using classes. Here is the code: class Area: def _init_(self, name, description): self.name = name def l

Re: [Tutor] Formatting output into columns

2007-08-31 Thread Scott Oertel
Luke Paireepinart wrote: > Scott Oertel wrote: >> Someone asked me this question the other day, and I couldn't think of >> any easy way of printing the output besides what I came up with pasted >> below. >> >> So what you have is a file with words in it as such: >> >> apple >> john >> bean >> joke