Re: [Tutor] IDLE/phythonWin -- Who's On First? (Abbott and Costello)

2009-02-11 Thread Alan Gauld
"Wayne Watson" wrote Signature.htmlMy program in IDLE bombed with: == Exception in Tkinter callback Traceback (most recent call last): dialog = OperationalSettingsDialog( self.master, set_loc_dict ) tkSimpleDialog.Dialog.__init__(self, parent) self.wait_visibility() # wind

Re: [Tutor] IDLE

2009-02-11 Thread Alan Gauld
"WM." wrote Allen G.asked me how I made IDLE work. I did nothing on purpose. One can open Python into the IDLE window or into the program window. I assume you mean the editor window? Yes that will produce proper indentation, it is only the shell window that is broken because the >>> promp

Re: [Tutor] IDLE/phythonWin -- Who's On First? (Abbott and Costello)

2009-02-11 Thread Wayne Watson
Title: Signature.html I ran it w/o using either IDLE/pyWin, and it worked without any messages, as shown by the console window. Isn't this the same as using the console? Outside of the two, my guess is that some subtle was made to the code, accidentally, and one tolerates it and the other doe

Re: [Tutor] IDLE/phythonWin -- Who's On First? (Abbott and Costello)

2009-02-11 Thread Wayne Watson
Title: Signature.html Using WinMerge, I found a difference between the two that shouldn't have been, but it didn't solve the problem. dialog.rateVar.get() versus dialog.rateVar.get There was another like it with get(), but it wouldn't have been executed in my test run. I suspect something e

Re: [Tutor] Picking up citations

2009-02-11 Thread Kent Johnson
On Tue, Feb 10, 2009 at 5:54 PM, Kent Johnson wrote: > Another attempt attached, it recognizes the n. separator and gets the last > item. And here is the actual attachment. Kent # Parser for legal citations, PLY version # This version doesn't parse the names from ply import lex, yacc debug =

Re: [Tutor] Simple PassGen

2009-02-11 Thread Lie Ryan
On Wed, Feb 11, 2009 at 2:26 AM, wrote: > > > Are you sure it isn't python 3.x you're playing with? The reason why > simple print function "works" in python 2.x is because of a syntactical > coincidence, it is still a 100% statement. > > Yes, I'm sure :) I restarted IDLE and pasted my session out

Re: [Tutor] Simple PassGen

2009-02-11 Thread python
Lie, The import from __future__ print_function happens automatically in our environment and I took this for granted. Sorry about the confusion :) Regards, Malcolm - Original message - From: "Lie Ryan" To: pyt...@bdurham.com Cc: tutor@python.org Date: Wed, 11 Feb 2009 23:16:11 +1100 Subjec

[Tutor] Extracting information from an EXCEL/Matlab file to use in Python

2009-02-11 Thread Andres Sanchez
Fellows, I am trying to extract information from a spreadsheet to use it in Python. For instance, say I have the number 5.6 in cell A1 of Sheet1 in the file example.xls . Could anyone of you ladies and gentleman let me know what commands I need to type in Pyhton to open the file that contains t

Re: [Tutor] Extracting information from an EXCEL/Matlab file to use in Python

2009-02-11 Thread Shantanoo Mahajan (शंत नू महा जन)
On 12-Feb-09, at 1:31 AM, Andres Sanchez wrote: Fellows, I am trying to extract information from a spreadsheet to use it in Python. For instance, say I have the number 5.6 in cell A1 of Sheet1 in the file example.xls . Could anyone of you ladies and gentleman let me know what commands I n

Re: [Tutor] Extracting information from an EXCEL/Matlab file to use in Python

2009-02-11 Thread wesley chun
On Wed, Feb 11, 2009 at 12:16 PM, "Shantanoo Mahajan (शंतनू महाजन)" wrote: > On 12-Feb-09, at 1:31 AM, Andres Sanchez wrote: > >> I am trying to extract information from a spreadsheet to use it in Python. > > For reading .xls: http://pypi.python.org/pypi/xlrd/0.5.2 > For writing .xls: http://sourc

Re: [Tutor] Extracting information from an EXCEL/Matlab file to use in Python

2009-02-11 Thread wesley chun
>>> I am trying to extract information from a spreadsheet to use it in Python. >> For reading .xls: http://pypi.python.org/pypi/xlrd/0.5.2 i forgot to mention that xlrd is on version 0.6.1 now: http://pypi.python.org/pypi/xlrd -- wesley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

[Tutor] How to foreach over a dynamic number of levels

2009-02-11 Thread Isaac Eiland-Hall
I'm probably trying to go about this the wrong way - so I'm asking more for what direction to head in, at least. The group I'm working with has a python program (the Model Framework) that runs data through a number of models. For each possible step, there are multiple possible models. Each run

[Tutor] How to foreach over a dynamic number of levels

2009-02-11 Thread Isaac Eiland-Hall
I'm probably trying to go about this the wrong way - so I'm asking more for what direction to head in, at least. The group I'm working with has a python program (the Model Framework) that runs data through a number of models. For each possible step, there are multiple possible models. Each run

[Tutor] Program to report if file was modified today

2009-02-11 Thread David
Hi Everyone and thanks for the list and your help. In my adventure in learning Python (never programed before) I am attempting to findout if a file has been modified today given a search path. It is working somewhat. Here it is; #!/usr/bin/python import sys import os import time def Mod():

Re: [Tutor] How to foreach over a dynamic number of levels

2009-02-11 Thread Kent Johnson
On Wed, Feb 11, 2009 at 6:20 PM, Isaac Eiland-Hall wrote: > The group I'm working with has a python program (the Model Framework) that > runs data through a number of models. For each possible step, there are > multiple possible models. Each run also is for a single date. > > So the ini for Model

Re: [Tutor] Program to report if file was modified today

2009-02-11 Thread bob gailer
David wrote: Hi Everyone and thanks for the list and your help. In my adventure in learning Python (never programed before) I am attempting to findout if a file has been modified today given a search path. It is working somewhat. Here it is; #!/usr/bin/python import sys import os import time

Re: [Tutor] Program to report if file was modified today

2009-02-11 Thread Kent Johnson
On Wed, Feb 11, 2009 at 8:46 PM, bob gailer wrote: > 5) It is not necessary to convert times to strings. You can get midnight > today from int(time.localtime()) ?? In [1]: import time In [2]: time.localtime() Out[2]: time.struct_time(tm_year=2009, tm_mon=2, tm_mday=11, tm_hour=21, tm_min=20, tm

Re: [Tutor] Program to report if file was modified today

2009-02-11 Thread David
bob gailer wrote: 1) That can't be the entire program, as there is no call to Mod()! Yep, it was lost in my copy paste 2) Convention says function names start with lower case. Save initial caps for class names. Thanks for the reminder, I had forgotten :) 3) Get rid of latest - that is why yo

[Tutor] Keeping Dictonary Entries Ordered

2009-02-11 Thread Wayne Watson
Title: Signature.html I have a dictionary that looks like: config_names = {"start_time : '18:00:00', 'gray_scale' : True, "long": 120.00} If I iterate over it, the entries will appear in any order, as opposed to what I see above. However, in the config file, I'd like to keep them in the order

Re: [Tutor] [tutor] IDLE

2009-02-11 Thread WM.
At one time I could not run a skit in IDLE nor with the command line. IDLE gave error messages because (Alan G. says) of the 3 chevrons. The command opened into a wee square & issued only error messages. Then the command line opened into a 4x7 box and worked perfectly. IDLE also now works perfectl

Re: [Tutor] Keeping Dictonary Entries Ordered

2009-02-11 Thread Eric Dorsey
>>> config_names = {'start_time': '18:00:00', 'gray_scale': True, 'long': 120.0} >>> config_names {'start_time': '18:00:00', 'gray_scale': True, 'long': 120.0} >>> for i, x in config_names.items(): ... print i, x ... start_time 18:00:00 gray_scale True long 120.0 >>> On Wed, Feb 11, 2009 at 7

Re: [Tutor] Program to report if file was modified today

2009-02-11 Thread bob gailer
David wrote: I get this error with the int(time.localtime()) start_of_today = int(time.localtime()) TypeError: int() argument must be a string or a number, not 'time.struct_time' Should have been start_of_today = int(time.time()) -- Bob Gailer Chapel Hill NC 919-636-4239

Re: [Tutor] Keeping Dictonary Entries Ordered

2009-02-11 Thread Wayne Watson
Looks good. Thanks. Eric Dorsey wrote: >>> config_names = {'start_time': '18:00:00', 'gray_scale': True, 'long': 120.0} >>> config_names {'start_time': '18:00:00', 'gray_scale': True, 'long': 120.0} >>> for i, x in config_names.items(): ...     print i, x ... start_t

Re: [Tutor] Python & MySQL... Define port.

2009-02-11 Thread wormwood_3
Hello, You can specify the port of the instance you want to connect to simply by passing "port=NUM" in MySQLdb.connect(). Here is a formulation I have found generally useful: import MySQLdb def run_mysql(query, db, user, passwd, port=3306, socket="/var/run/mysqld/mysqld.sock", host="localhost

Re: [Tutor] IDLE/phythonWin -- Who's On First? (Abbott and Costello)

2009-02-11 Thread Wayne Watson
This appears to be an old problem. . However, the question remains. What to do about it? reboot? I killed about a dozen pythonwin.exe task, but to no avail. Wayne Watson wrote: Using WinMerge, I found a difference between the two that shouldn't have been, but it didn't solve the problem.