[Tutor] Databases in Python

2010-08-24 Thread aug dawg
The other day, I wrote a little database just to fiddle around, but when I try to run it it says that it has an unexpected indent. From what I can tell, it doesn't. Here's the code. I'm using SPE. database = [] datafile = open('/home/~/the-db/data') for line in datafile: database.append(line)

Re: [Tutor] Databases in Python

2010-08-24 Thread aug dawg
It says that it's on line 25, on the print(Bye!). Forgot to say that. On Tue, Aug 24, 2010 at 12:44 PM, aug dawg augdaw...@gmail.com wrote: The other day, I wrote a little database just to fiddle around, but when I try to run it it says that it has an unexpected indent. From what I can tell,

Re: [Tutor] Databases in Python

2010-08-24 Thread Walter Prins
On 24 August 2010 17:47, aug dawg augdaw...@gmail.com wrote: if searcher in database: # Figure this out. if exit database in command: print Bye! sys.exit() The first thing that caught my eye was the #figure me out line -- python is expecting a statement there, a comment doesn't count.

Re: [Tutor] Databases in Python

2010-08-24 Thread Che M
The other day, I wrote a little database just to fiddle around, but when I try to run it it says that it has an unexpected indent. From what I can tell, it doesn't. Here's the code. I'm using SPE. In the future, you should copy/paste error message you get into your email. This way it

Re: [Tutor] Databases in Python

2010-08-24 Thread Marc Tompkins
On Tue, Aug 24, 2010 at 12:44 PM, aug dawg augdaw...@gmail.com wrote: if searcher in database: # Figure this out. You need some sort of actual Python statement there as a placeholder - even just print(). -- www.fsrtechnologies.com ___ Tutor

Re: [Tutor] Databases in Python

2010-08-24 Thread aug dawg
Oh yeah. That was just a comment that I forgot to take out. On Tue, Aug 24, 2010 at 1:01 PM, Walter Prins wpr...@gmail.com wrote: On 24 August 2010 17:47, aug dawg augdaw...@gmail.com wrote: if searcher in database: # Figure this out. if exit database in command: print Bye!

Re: [Tutor] Databases in Python

2010-08-24 Thread aug dawg
It's not catching that, but I haven't gotten there with the bugs yet. One more thing I can't figure out. line 11 select-db = raw_input(Which database to add to? ) SyntaxError: can't assign to operator I think it might be the at the end, but when I try it in the Python interpreter, it works

Re: [Tutor] Databases in Python

2010-08-24 Thread christopher . henk
aug dawg wrote on 08/24/2010 01:13:01 PM: It's not catching that, but I haven't gotten there with the bugs yet. One more thing I can't figure out. line 11 select-db = raw_input(Which database to add to? ) SyntaxError: can't assign to operator I think it might be the at the end,

Re: [Tutor] Databases in Python

2010-08-24 Thread aug dawg
Now it says that the variable adder is not defined. Does anyone know about this? On Tue, Aug 24, 2010 at 1:40 PM, christopher.h...@allisontransmission.comwrote: aug dawg wrote on 08/24/2010 01:13:01 PM: It's not catching that, but I haven't gotten there with the bugs yet. One more thing

Re: [Tutor] Databases in Python

2010-08-24 Thread Alan Gauld
aug dawg augdaw...@gmail.com wrote select-db = raw_input(Which database to add to? ) SyntaxError: can't assign to operator I think it might be the at the end, but when I try it in the Python interpreter, it works fine. You have a minus sign in your variable name - at least thats how

Re: [Tutor] Databases in Python

2010-08-24 Thread christopher . henk
aug dawg augdaw...@gmail.com wrote on 08/24/2010 01:55:14 PM: Now it says that the variable adder is not defined. Does anyone know about this? It is best if you send the full error message, it helps pinpoint the problem. my copy of your code was: database = [] datafile =

Re: [Tutor] Databases in Python

2010-08-24 Thread aug dawg
Oh, stupid me forgot the error message. Well, for some odd reason it works now, but there are still some issues. When I tried it just a few minutes ago, it worked fine, it seemed to me. If anyone have any tips, please let me know. Thanks everyone for the tips. On Tue, Aug 24, 2010 at 2:24 PM,