Re: [Tutor] while loop problem

2009-03-08 Thread Lie Ryan
mustafa akkoc wrote: hello i have syntax problem in this program After correcting the indentations, and putting a missing parentheses in line 24 (the last line), I don't see any Syntax Error. #!/usr/bin/python # Filename: while.py number = 23 running = True while running : guess= i

Re: [Tutor] probelm pyhton shell doesnt open help please

2009-03-08 Thread Martin Walsh
mustafa akkoc wrote: > > it gives this message socket error > IDLE's subprocess didn't make a connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection. IIRC, this was once a known issue with IDLE when combined with the windows firewall service,

Re: [Tutor] probelm pyhton shell doesnt open help please

2009-03-08 Thread W W
On Sun, Mar 8, 2009 at 3:32 PM, mustafa akkoc wrote: > > it gives this message socket error That's not terribly descriptive... what type of python shell? IDLE? Interactive prompt? Ipython? Certainly you don't mean this? u...@system:~$ python socket error u...@system:~$ -Wayne _

Re: [Tutor] Long list error

2009-03-08 Thread Kent Johnson
On Sun, Mar 8, 2009 at 8:27 PM, William Stephens wrote: > Hello, > > I was working on a sieve of eratosthenes and ran into an error I don't > understand. > size = 10 000 000 000 l = [0,1]*(size/2) > Traceback (most recent call last): >  File "", line 1, in > OverflowError: cannot fit 'l

Re: [Tutor] UNSUBSCRIPTABLE?

2009-03-08 Thread WM.
Well, Mr. Wilkins takes the biscuit. He found where I did not enter a pair of parens.() ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Long list error

2009-03-08 Thread William Stephens
Hello, I was working on a sieve of eratosthenes and ran into an error I don't understand. >>> size = 100 >>> l = [0,1]*(size/2) Traceback (most recent call last): File "", line 1, in OverflowError: cannot fit 'long' into an index-sized integer Is there a type or something that I ca

Re: [Tutor] UNSUBSCRIPTABLE?

2009-03-08 Thread David
WM. wrote: I am using Python 26 on a Windows XP OK, here are the three lines mentioned following the error message. Traceback (most recent call last): File "C:\Python26\TicTacToeD.py", line 165, in main() File "C:\Python26\TicTacToeD.py", line 150, in main DisplayBoard(board) Fil

Re: [Tutor] UNSUBSCRIPTABLE?

2009-03-08 Thread Brett Wilkins
Your problem: def main(): DisplayInstruct() puter, human = Pieces() turn = X board = NewBoard<<<--This line DisplayBoard(board) if you read my email before, I described this to you :) put brackets on the end of NewBoard (so NewBoard() ) and this should work. Cheers WM.

Re: [Tutor] UNSUBSCRIPTABLE?

2009-03-08 Thread WM.
I am using Python 26 on a Windows XP OK, here are the three lines mentioned following the error message. Traceback (most recent call last): File "C:\Python26\TicTacToeD.py", line 165, in main() File "C:\Python26\TicTacToeD.py", line 150, in main DisplayBoard(board) File "C:\Python

Re: [Tutor] UNSUBSCRIPTABLE?

2009-03-08 Thread David
bob gailer wrote: Kapsicum wrote: On Mon, Mar 9, 2009 at 1:18 AM, WM. > wrote: Traceback (most recent call last): File "C:\Python26\TicTacToeD.py", line 165, in main() File "C:\Python26\TicTacToeD.py", line 150, in main DisplayBoar

Re: [Tutor] UNSUBSCRIPTABLE?

2009-03-08 Thread Brett Wilkins
Found this book at the local library... If you're doing the TicTacToe game in chapter 6, then have a look at the main function (def main: ) and find the line that says board = new_board() This is likely where your troubles lie... Cheers --Brett John Fouhy wrote: 2009/3/9 WM. : Th

Re: [Tutor] UNSUBSCRIPTABLE?

2009-03-08 Thread John Fouhy
2009/3/9 WM. : > Thank you for your remarks. Too bad they fell into my acres of ignorance. > One thing is certain, Dawson used brackets [] not parens (). When I spoke of > typi (plural of typo) I meant ; for : or \ for /, not line after line of > error. > My only alternative now seems to be 'get ou

Re: [Tutor] UNSUBSCRIPTABLE?

2009-03-08 Thread WM.
Brett Wilkins wrote: Given that board is a function then I believe that it is likely you're either (a) doing something wrong beforehand, or (b) if board is a function that generates the Tic Tac Toe board, then the syntax you more likely need is board()[number] , but I can't be completely certai

Re: [Tutor] UNSUBSCRIPTABLE?

2009-03-08 Thread bob gailer
Kapsicum wrote: On Mon, Mar 9, 2009 at 1:18 AM, WM. > wrote: Traceback (most recent call last): File "C:\Python26\TicTacToeD.py", line 165, in main() File "C:\Python26\TicTacToeD.py", line 150, in main DisplayBoard(board) File

Re: [Tutor] UNSUBSCRIPTABLE?

2009-03-08 Thread Brett Wilkins
Given that board is a function then I believe that it is likely you're either (a) doing something wrong beforehand, or (b) if board is a function that generates the Tic Tac Toe board, then the syntax you more likely need is board()[number] , but I can't be completely certain. when I say doing

Re: [Tutor] UNSUBSCRIPTABLE?

2009-03-08 Thread John Fouhy
2009/3/9 WM. : >  File "C:\Python26\TicTacToeD.py", line 68, in DisplayBoard >    print "\n\t", board[1], "|", board[2], "|", board[3] > TypeError: 'function' object is unsubscriptable > > I am fooling around with Dawson's "...for the Absolute Beginner". The > tic-tac-toe program will not run for m

[Tutor] probelm pyhton shell doesnt open help please

2009-03-08 Thread mustafa akkoc
it gives this message socket error -- Mustafa Akkoc ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] UNSUBSCRIPTABLE?

2009-03-08 Thread Kapsicum
On Mon, Mar 9, 2009 at 1:18 AM, WM. wrote: > Traceback (most recent call last): > File "C:\Python26\TicTacToeD.py", line 165, in >main() > File "C:\Python26\TicTacToeD.py", line 150, in main >DisplayBoard(board) > File "C:\Python26\TicTacToeD.py", line 68, in DisplayBoard >print "

[Tutor] UNSUBSCRIPTABLE?

2009-03-08 Thread WM.
Traceback (most recent call last): File "C:\Python26\TicTacToeD.py", line 165, in main() File "C:\Python26\TicTacToeD.py", line 150, in main DisplayBoard(board) File "C:\Python26\TicTacToeD.py", line 68, in DisplayBoard print "\n\t", board[1], "|", board[2], "|", board[3] TypeEr

Re: [Tutor] Misunderstanding the Entry Widget

2009-03-08 Thread Alan Gauld
"Alan Gauld" wrote I think Tkinter needs an update too, there seem to be quite a few new Tk widgets that are not available in Tkinter... or is it just that they are not documented? I must have a poke around in v2.5... I spoke too soon, its just the documentation needs an update the newer wi

Re: [Tutor] Misunderstanding the Entry Widget

2009-03-08 Thread Wayne Watson
Sounds like the O'Reilly book might be worth it. I have an interlibrary loan request out for a highly recommended Tk/Tcl book. I tried Cygwin about 5 years ago, and it just didn't cut it. Odd problems. It may be worth a shot again when I can free up some time. Alan Gauld wrote: "Wayne Watson"

Re: [Tutor] while loop problem

2009-03-08 Thread Alan Gauld
"mustafa akkoc" wrote hello i have syntax problem in this program #!/usr/bin/python # Filename: while.py number = 23 running = True while running : guess= input('Enter an integer : ') # it give a syntax error this line can you me ? Always post the full text of error messages please. It h

Re: [Tutor] Misunderstanding the Entry Widget

2009-03-08 Thread Alan Gauld
"Alan Gauld" wrote Yep, when I bowed of programming long ago, I had Ousterhout's It was a good book in its day but is now well overdue an update. And lo and behold, listed on Amazon is the 2nd edition due in August 2009! How's that for service :-) BTW I also noticed that there is also

[Tutor] while loop problem

2009-03-08 Thread mustafa akkoc
hello i have syntax problem in this program #!/usr/bin/python # Filename: while.py number = 23 running = True while running : guess= input('Enter an integer : ') # it give a syntax error this line can you me ? if guess == number: print('Congratulations, you guessed it.') running = False # this c

Re: [Tutor] Misunderstanding the Entry Widget

2009-03-08 Thread Alan Gauld
"Wayne Watson" wrote Yep, when I bowed of programming long ago, I had Ousterhout's (something like that) book, and finally sold it on Amazom 5 years ago It was a good book in its day but is now well overdue an update. The book I'd recommend getting is Tcl/Tk in a Nutshell from O'Reilly Its

Re: [Tutor] Misunderstanding the Entry Widget

2009-03-08 Thread Wayne Watson
Title: Signature.html Thanks. Your statement is reassuring. Without trying to give my self a pat on the back, exactly written as I figured. It seems so very obvious, but the lack of attention to using that style makes one wonder why it isn't commonly found anywhere in the discussion of more com

Re: [Tutor] Pyusb: get data via USB sent from mouse

2009-03-08 Thread W W
On Sat, Mar 7, 2009 at 9:35 AM, andré palma wrote: > Hi folks, I'm new on pyusb programming and to learn how to get data i'm > trying  to get  data  sent  from  my mouse. > I've download a program called usbview( http://www.kroah.com/linux/usb/ ) to > display the device descriptors of any USB devi

Re: [Tutor] could someone explain why this happens to me.

2009-03-08 Thread Lie Ryan
Sander Sweers wrote: 2009/3/7 Alan Gauld : mycopy = original[:] Returns a slice of the original list. In this case it so happens the slice is the full list. mycopy = list(original) Use the list type constructor to make a list out of its argument. It just so happens the argument in this case

Re: [Tutor] Misunderstanding the Entry Widget

2009-03-08 Thread Alan Gauld
"Wayne Watson" wrote Signature.htmlAnother thought occurred to me about this situation. Suppose I have a dialog with two Entry objects in a dialog object called TwoEntries: entry1 = Entry(master, width=10).grid(row=4, column=1) entry2 = Entry(master, width=10).grid(row=5, column=1) and