[Tutor] IndentationError:

2011-11-15 Thread lina
Why it keeps on complaining: $ python plot-pathway.py File "plot-pathway.py", line 35 if list1[i][j]<=42: ^ IndentationError: unindent does not match any outer indentation level def PlotPathway(list1): for i in range(len(list1)): for j in range(len(list1[i

Re: [Tutor] optimize a plot

2011-11-15 Thread lina
>>> g.nodes() [u'1', u'2', u'34', u'59', u'57'] >>> for node in g.nodes(): print node Traceback (most recent call last): File "", line 2, in print node File "/usr/lib/python2.6/idlelib/rpc.py", line 597, in __call__ value = self.sockio.remotecall(self.oid, self.name,

Re: [Tutor] Clock in tkinter?

2011-11-15 Thread Asokan Pichai
> On Wed, Nov 16, 2011 at 1:30 AM, Mic wrote: > Hi! > I am new to programming WELCOME! >and I hop this question isn’t stupid. A teacher of mine said, "The only stupid question is the one you thought of asking but did not ask!" Happy learning Asokan Pichai __

Re: [Tutor] list of objects?

2011-11-15 Thread bob gailer
On 11/15/2011 8:40 AM, Elwin Estle wrote: I am attempting to write a text based spider solitaire game. What are the rules of your version of Spider? The only spiders I know have 10 dealt piles and 1 draw pile. I think you have greatly complicated things by using classes. Consider: deck = ra

Re: [Tutor] Trouble installing Python on Win7 (not a valid Win 32 app)

2011-11-15 Thread Wayne Watson
Thanks. I took a look at active state once. Too much of a learning curve for me at the time. I'm not a frequent user of Python. I was on a small project that depended on 2.5.2. There were some issues with numpy, and other libs that needed to stay put. Project is pretty well gone. If not, I

Re: [Tutor] Trouble installing Python on Win7 (not a valid Win 32 app)

2011-11-15 Thread Wayne Watson
It was the default action before with the right-click. I don't care about double-click. I just looked on my XP, and that's the way it's done on 2.5.2 there. I have no idea how this got onto double-click. Let's not worry about it in any case. We can quibble some more, but I'm done with this e

Re: [Tutor] Trouble installing Python on Win7 (not a valid Win 32 app)

2011-11-15 Thread Alan Gauld
On 15/11/11 23:55, Wayne Watson wrote: I think we've exhausted ourselves. Time to ditch 2.5.2 and find a better version of Python to work on. There is nothiong wrong with Python 2.5.2, I used it for several years on Windows. But the default installation should not be setting up idle as the i

Re: [Tutor] Trouble installing Python on Win7 (not a valid Win 32 app)

2011-11-15 Thread Marc Tompkins
On Tue, Nov 15, 2011 at 3:55 PM, Wayne Watson wrote: > ... > > With fingers crossed ... > >> >> I'm going to try one last time before I give up: >> >> - Go to Control Panel\Programs\Default Programs\Set Associations. DONE >> - Highlight the line for ".py" DONE >> - Click "Change program..." DONE

Re: [Tutor] Trouble installing Python on Win7 (not a valid Win 32 app)

2011-11-15 Thread Wayne Watson
... With fingers crossed ... I'm going to try one last time before I give up: - Go to Control Panel\Programs\Default Programs\Set Associations. DONE - Highlight the line for ".py" DONE - Click "Change program..." DONE - In the "Open with" dialog, click the "Browse..." button. DONE - In the

Re: [Tutor] Trouble installing Python on Win7 (not a valid Win 32 app)

2011-11-15 Thread Marc Tompkins
On Tue, Nov 15, 2011 at 12:19 PM, Wayne Watson wrote: > > For py, I found \Python25\Lib\idlelib\idle.**pyw. >>> >>> Does no good to specify yet another .py file as the executable. You >> must specify a .EXE file (or .BAT, or .CMD, or very rarely, a .COM file). >> > In py land I only have py, p

Re: [Tutor] Clock in tkinter?

2011-11-15 Thread Wayne Werner
On Tue, Nov 15, 2011 at 2:00 PM, Mic wrote: > Hi! > I am new to programming and I hop this question isn’t stupid. > Welcome! > I am making a small GUI program. It is supposed to have a button and a > clock in it that displays the same time as it is according to the computer. > So as far as

Re: [Tutor] Trouble installing Python on Win7 (not a valid Win 32 app)

2011-11-15 Thread Wayne Watson
For py, I found \Python25\Lib\idlelib\idle.pyw. Does no good to specify yet another .py file as the executable. You must specify a .EXE file (or .BAT, or .CMD, or very rarely, a .COM file). In py land I only have py, pyc, pyw, and pyo. I've now done py and pyc as default. Still have the same

Re: [Tutor] Trouble installing Python on Win7 (not a valid Win 32 app)

2011-11-15 Thread Wayne Watson
... Now I believe I see your problem... Your "usual error message" was, I believe , that (x) is not a valid Win32 app.  Python scripts are NOT Win32 apps - and IDLE itself is a Python script.  You need to tell Window

[Tutor] Clock in tkinter?

2011-11-15 Thread Mic
Hi! I am new to programming and I hop this question isn’t stupid. I am making a small GUI program. It is supposed to have a button and a clock in it that displays the same time as it is according to the computer. So as far as I am concerned both the clock and the are supposed to be widgets? So

Re: [Tutor] Trouble installing Python on Win7 (not a valid Win 32 app)

2011-11-15 Thread Dave Angel
On 11/15/2011 10:47 AM, Wayne Watson wrote: > Highlight the line for ".py". Click the button (yes, the one that says "Change > program..."). You'll Yes, did that. > get another dialog box, and in that one there will be a button labeled > "Browse". Click it. This will open up an "Open with.

Re: [Tutor] run excel macro from python

2011-11-15 Thread Alan Gauld
On 15/11/11 16:07, Pirritano, Matthew wrote: Pythonistas, I am running an excel macro from python with the following code: There are some Excel/Python users here so you might get a good reply, but you might also like to try a Python Windows mailing list/forum, where are more likely to be exp

Re: [Tutor] optimize a plot

2011-11-15 Thread Alan Gauld
On 15/11/11 14:34, lina wrote: Sorry for some not mature questions asked before, fixed now by: def PlotPathway(list1): for i in range(len(list1)): for j in range(len(list1[i])-1): if list1[i][j] != list1[i][j+1]: if ((int(list1[i][j])

[Tutor] run excel macro from python

2011-11-15 Thread Pirritano, Matthew
Pythonistas, I am running an excel macro from python with the following code: The problem I'm having is that when I try to run this function I get a dialog window that pops up titled: "Update Values: Personal.xls" When I try to cancel out of it I get directed to a type mismatch in the excel

Re: [Tutor] Trouble installing Python on Win7 (not a valid Win 32 app)

2011-11-15 Thread Wayne Watson
Before reading my response below, let me note how things look on my XP laptop--for what it's worth.  I happen to be using 2.4 there.   When I look at a folder of py programs there, the icon is something like a lizard for each program. If I right-click on a py file, a list

[Tutor] Fwd: Re: [python-win32] Handling a Unicode Return using Pyodbc

2011-11-15 Thread Tim Golden
[cc-ing back to the *correct* list in case other readers find it helpful...] On 15/11/2011 15:16, Tony Pelletier wrote: Thanks, Tim! This is working brilliantly Slow, but working..:) I can go from here and see if there's a way to speed it up. Well you've got a few options, although an am

Re: [Tutor] optimize a plot

2011-11-15 Thread lina
Sorry for some not mature questions asked before, fixed now by: def PlotPathway(list1): for i in range(len(list1)): for j in range(len(list1[i])-1): if list1[i][j] != list1[i][j+1]: if ((int(list1[i][j])) < 43 and (int(list1[i][j-1])) <

Re: [Tutor] list of objects?

2011-11-15 Thread James Reynolds
On Tue, Nov 15, 2011 at 8:40 AM, Elwin Estle wrote: > I am attempting to write a text based spider solitaire game. I have a > pretty simple card class, and a deck class, which has a list of card > objects, which are shuffled, then individual elements are put into > self.dealt, which is a 'list o

Re: [Tutor] list of objects?

2011-11-15 Thread Walter Prins
Hi Elwin, On 15 November 2011 13:40, Elwin Estle wrote: > I am attempting to write a text based spider solitaire game. I have a > pretty simple card class, and a deck class, which has a list of card > objects, which are shuffled, then individual elements are put into > self.dealt, which is a '

[Tutor] list of objects?

2011-11-15 Thread Elwin Estle
I am attempting to write a text based spider solitaire game.  I have  a pretty simple card class, and a deck class, which has a list of card objects, which are shuffled, then individual elements are put into self.dealt, which is a 'list of lists' when the cards are dealt. I am trying to control

Re: [Tutor] Trouble installing Python on Win7 (not a valid Win 32 app)

2011-11-15 Thread Marc Tompkins
On Mon, Nov 14, 2011 at 7:09 PM, Wayne Watson wrote: > > On 11/14/2011 6:17 PM, Marc Tompkins wrote: > > On Mon, Nov 14, 2011 at 4:55 PM, Wayne Watson < > sierra_mtnv...@sbcglobal.net> wrote: > >> >> On 11/14/2011 4:04 PM, Marc Tompkins wrote: >> >> On Mon, Nov 14, 2011 at 4:00 PM, Wayne Watson <

Re: [Tutor] Cython vs Python-C API

2011-11-15 Thread Dario Lopez-Kästen
On Tue, Nov 15, 2011 at 10:26 AM, Stefan Behnel wrote: > Dario Lopez-Kästen, 15.11.2011 09:33: > >> On Tue, Nov 15, 2011 at 9:09 AM, Stefan Behnel wrote: >> >> cubic spline interpolation >>> >> > No, I didn't. > > Stefan > > Oops, apologies. My reply was meant for Jaidev (OP), but I got the quo

Re: [Tutor] Cython vs Python-C API

2011-11-15 Thread Stefan Behnel
Dario Lopez-Kästen, 15.11.2011 09:33: On Tue, Nov 15, 2011 at 9:09 AM, Stefan Behnel wrote: cubic spline interpolation No, I didn't. Stefan ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.o

Re: [Tutor] Handling a Unicode Return using Pyodbc

2011-11-15 Thread Tim Golden
On 14/11/2011 21:43, Tony Pelletier wrote: Good Afternoon, I'm writing a program that is essentially connecting to MS SQL Server and dumping all the contents of the tables to separate csv's. I'm almost complete, but now I'm running into a Unicode issue and I'm not sure how to resolve it. I hav

Re: [Tutor] Cython vs Python-C API

2011-11-15 Thread Dario Lopez-Kästen
Hi, just a thought - have you looked at NumPy/SciPy? Perhaps there already is an API in C that does what you need, sufficiently well/fast? http://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html It is part of the NumPy/SciPy package(s). http://www.scipy.org/ /dario On Tue, Nov 15,

Re: [Tutor] Cython vs Python-C API

2011-11-15 Thread Stefan Behnel
Jaidev Deshpande, 14.11.2011 21:30: I need to perform cubic spline interpolation over a range of points, and I have written the code for the same in C and in Python. The interpolation is part of a bigger project. I want to front end for the project to be Python. Ideally I want Python only to dea