On 9/5/2011 3:04 PM, Jean-Michel Pichavant wrote:
William Gill wrote:
Not to split hairs, but syntactically f(x) is a function in many
programming paradigms.
As I understand it functional programming places specific requirements
on functions, i.e.referential transparency. So f(x) may or may
On 9/3/2011 12:25 PM, Steven D'Aprano wrote:
William Gill wrote:
Are they suggesting that any function that takes an object as an
argument should always be a method of that object?
Yes.
I can think of times when a special application, such as a converter,
would take an object
On 9/4/2011 9:13 AM, rusi wrote:
On Sep 3, 9:15 pm, William Gill wrote:
During some recent research, and re-familiarization with Python, I came
across documentation that suggests that programming using functions, and
programming using objects were somehow opposing techniques.
Staying with
On 9/4/2011 7:41 PM, Steven D'Aprano wrote:
William Gill wrote:
The source of my error is "Functional Programming HOWTO
(/python-3.1.3-docs-html/howto/functional.html)"
For those who don't have access to William's local file system, I expect
he's looking at
On 9/4/2011 2:32 PM, Terry Reedy wrote:
On 9/4/2011 4:13 AM, tinn...@isbd.co.uk wrote:
Ian Kelly wrote:
Functional programming is about using functions in the *mathematical*
sense. A mathematical function maps one value (or tuple of values) to
another value. The mapped value never varies; if
On 9/3/2011 9:51 PM, Terry Reedy wrote:
It is possible that our doc was less than crystal clear. We are
constantly improving it where we can see fixable faults. If you run
across whatever it was and it still seems a bit muddy, post something
again.
Will do.
Thanks.
--
http://mail.python.org/m
On 9/3/2011 5:39 PM, Ben Finney wrote:
William Gill writes:
On 9/3/2011 3:15 PM, Terry Reedy wrote:
William Gill wrote:
During some recent research, and re-familiarization with Python, I
came across documentation
Ours, or someone else's?
Python.
Can you show exactly where i
On 9/3/2011 3:15 PM, Terry Reedy wrote:
William Gill wrote:
During some recent research, and re-familiarization with Python, I came
across documentation
Ours, or someone else's?
Python.
Since in Python, everything is an object, that would mean that every
function has to be a m
On 9/3/2011 2:50 PM, Ian Kelly wrote:
I think you may be confusing "functional programming" and "programming
using functions". These are not the same thing.
I think you may be right, Ian. It didn't make much sense
--
http://mail.python.org/mailman/listinfo/python-list
On 9/3/2011 12:29 PM, MRAB wrote:
I think you mean "complementary". :-)
How polite of you to point out my spelling deficiency. I guess
shouldn't be watching football while typing (I'm sure the beer didn't
help either).
I think that it's all about "state".
In functional programming, there's
During some recent research, and re-familiarization with Python, I came
across documentation that suggests that programming using functions, and
programming using objects were somehow opposing techniques.
It seems to me that they are complimentary. It makes sense to create
objects and have so
On 9/1/2011 1:58 PM, JT wrote:
On Monday, August 29, 2011 1:21:48 PM UTC-5, William Gill wrote:
I have a text file with XML like records that I need to parse. By XML
like I mean records have proper opening and closing tags. but fields
don't have closing tags (they rely on line ends). No
On 8/29/2011 2:31 PM, Philip Semanchuk wrote:
If the syntax really is close to XML, would it be all that difficult to convert
it to proper XML? Then you have nice libraries like ElementTree to use for
parsing.
Possibly, but I would still need the same search algorithms to find the
opening
I haven't done much with Python for a couple years, bouncing around
between other languages and scripts as needs suggest, so I have some
minor difficulty keeping Python functionality Python functionality in my
head, but I can overcome that as the cobwebs clear. Though I do seem to
keep trippin
Thanks everyone. These references will help greatly. I was about to
take some javascript examples and rewrite them in Python.
--
http://mail.python.org/mailman/listinfo/python-list
I am teaching an 11 year old who wants to learn programming. I chose
Python, and it is working well. I seem to remember lots of simple
script games, like quizzes, number games etc. that would be good for his
tutorial. However, now all I can find is more complex games using
Pygame. Can anyon
Before I spend the next couple weeks researching and testing, can anyone
tell me if what I want to do is possible, and possibly point me in the
right direction to get started.
I want to forward any email addressed to [EMAIL PROTECTED] to a python
script that will forward it to all the other su
Dave Borne wrote:
>> I have a (web) development computer w/o an SMTP server and want to test
>> form generated e-mail using a dummy SMTP server that delivers the mail
>> message to a file, or better yet, to a text editor instead of actually
>> sending it.
>
> Here's a quick and dirty script I us
I have a (web) development computer w/o an SMTP server and want to test
form generated e-mail using a dummy SMTP server that delivers the mail
message to a file, or better yet, to a text editor instead of actually
sending it. Is it possible to extend the DebuggingServer class,and
override the
>yscroll = Tkinter.Scrollbar( , orient=Tkinter.VERTICAL)
>yscroll.grid( ... )
>yscroll['command'] = canvas.yview
>canvas['yscrollcommand'] = yscroll.set
>
Probably, not needed now that I have re-thought the situation, but I do
have several occasio
Thanks everyone. I will explore all the suggestions, but it looks like
SPE is the immediate answer.
Bill
William Gill wrote:
> Being somewhat new to Python, and having a tendency to over complicate
> things in my class design, I was wondering if anyone can suggest a
> simple gra
I need to display a couple of labels and a checkbox from each entry in
my database. Simple enough, but there are several hundred records, and
I only want to display 5 or 10 at a time. Can this be accomplished by
putting everything in a Frame(), using width, height, grid_propagate(0)
, and a s
On first glance Doxygen doesn't look like the ticket, but the screen
shots of Eric3 look VERY promising. I have already downloaded it, and
will try it.
Thanks,
Bill
tooper wrote:
> You may want to use Doxygen, which generates nice diagrams. It's
> normally only for C++, but there are nice filt
loring, thanks.
Bill
>
> http://www.python.org/doc/2.0.1/lib/module-pyclbr.html
>
> William Gill wrote:
>
>>Being somewhat new to Python, and having a tendency to over complicate
>>things in my class design, I was wondering if anyone can suggest a
>>simple graphica
Being somewhat new to Python, and having a tendency to over complicate
things in my class design, I was wondering if anyone can suggest a
simple graphical or flowcharting tool that they use to organize their
class and program design? Because of a 55 mph head-on accident a few
years back, I ha
OK I'm tired, I've got a cold, and my brain isn't working very well. I
have a result set ( a tuple of tuples) from a db. Each element has two
elements; classification number, and classification heading. i.e.
result=((001,'heading one'),(002,'heading two'),...)
classification numbers may not
Eric Brunel wrote:
> On Wed, 24 Aug 2005 15:07:27 GMT, William Gill <[EMAIL PROTECTED]> wrote:
>
>> Working with tkinter, I have a createWidgets() method in a class.
>> Within createWidgets() I create several StringVars() and
>> assign them to the textvari
I am creating several tkinter widgets. In my classes they each have a
change() method that is a callback to various IntVar, and StringVar
objects. Everything works fine, but don't really want to trigger the
callback when I am initializing each widget/control variable. I can
use a "flag" like se
Eric Brunel wrote:
> On Wed, 24 Aug 2005 15:07:27 GMT, William Gill <[EMAIL PROTECTED]> wrote:
>
>> Working with tkinter, I have a createWidgets() method in a class.
>> Within createWidgets() I create several StringVars() and
>> assign them to the textvari
Working with tkinter, I have a createWidgets() method in a class.
Within createWidgets() I create several StringVars() and
assign them to the textvariable option of several widgets.
Effectively my code structure is:
def createWidgets(self):
...
var = StringVar()
Entry(master,textvar
The tkinter text widget uses indexes to identify row:column offsets
within the text, but it seems counter intuitive to have to convert row
and column integers to a string like "0.1'. It's great that index can
take a string, but what about looping through rows and columns? Am I
missing a way t
rafi wrote:
> William Gill wrote:
>
>> The tkinter text widget uses indexes to identify row:column offsets
>> within the text, but it seems counter intuitive to have to convert row
>> and column integers to a string like "0.1'. It's great that inde
Dennis Lee Bieber wrote:
> On Sun, 14 Aug 2005 19:28:04 GMT, William Gill <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
>
>>I have been trying to pass parameters as indicated in the api.
>>when I use:
>>
>> sql= 's
Steve Holden wrote:
> William Gill wrote:
>
>> I have been testing and it seems that:
>>
>> 1- Cursor.execute does not like '?' as a placeholder in sql
>>
> The particular format required by each DBI-compatible module should be
> available as t
rks.
Between your comments re: column names and table names , and the notes
in cursor.py, I was able to figure it out.
FYI I wanted to create a tableHandler class that could be extended for
individual tables. That's why the query needs to accept variables for
tablename.
Thanks.
Bill
S
I have been trying to pass parameters as indicated in the api.
when I use:
sql= 'select * from %s where cusid = %s ' % name,recID)
Cursor.execute(sql)
it works fine, but when I try :
sql= 'select * from %s where cusid like %s '
Cursor.execute(sql,(name,recID))
or
sql= 'select *
:
class MyWidget(Frame):
def __init__(self, master, columns,rows, trace_write=None):
Frame.__init__(self,master)
...
...
...
Bill
P.S. I haven't been working on this since my last post. I had to quit
to go see my oldest graduate.
William Gill wrote:
> I h
rface it looks like I'm not passing the
correct master reference to my frame.
Bill
William Gill wrote:
> I have created a widget that extends Frame() and contains labels,
> checkboxes, and entrys. I am trying to use tkSimpleDialog.Dialog to
> create a modal display of this widget,
I have created a widget that extends Frame() and contains labels,
checkboxes, and entrys. I am trying to use tkSimpleDialog.Dialog to
create a modal display of this widget, but am running into some
(addressing) problems. My widget displays in the parent widget, not the
tkSimpleDialog.Dialog?
handy.
Thanks,
Bill
[EMAIL PROTECTED] wrote:
> Here's some code that gives a cut-copy-paste pop-up window on all Entry
> widgets
> in an application.
>
> This code is released into the public domain.
>
> Jeff Epler
> #
>
>> Is there a simple way to cut and paste from a tkinter text widget to
>> an entry widget? I know I could create a mouse button event that
>> triggers a popup (message widget) prompting for cut/paste in each of
>> the widgets using a temp variable to hold the text, but I don't wnat
>> to re
Is there a simple way to cut and paste from a tkinter text widget to an
entry widget? I know I could create a mouse button event that triggers
a popup (message widget) prompting for cut/paste in each of the widgets
using a temp variable to hold the text, but I don't wnat to reinvent the
wheel
ometing in
baseclass.__init() not taking place, but the recursion loop didn't give
me a clue. Any idea why failing to init the base class caused the loop?
Bill
Christopher Subich wrote:
> William Gill wrote:
>
>> O.K. I tried from scratch, and the following snippet produces
It also seems to operate the same with or without " app.mainloop()". Is
an explicit call to mainloop needed?
William Gill wrote:
> O.K. I tried from scratch, and the following snippet produces an
> infinite loop saying:
>
> File "C:\Python24\lib\lib-tk\Tkinter.py&
lf.var ('1')
import os
from Tkinter import *
class MyApp(Tk):
var=1
def __init__(self):
pass
def getval(self):
return self.var
app = MyApp()
app.title("An App")
print app.getval()
app.mainloop()
Eric Brunel wrote:
> On Mon, 18 Jul 2005 16:57:51 GM
repeat of the original problem I will post the code and the
exact error message, but at least now I know It SHOULD work.
Thanks
Bill,
Eric Brunel wrote:
> On Mon, 18 Jul 2005 16:57:51 GMT, William Gill <[EMAIL PROTECTED]> wrote:
>
>> A short while ago someone posted that(unl
A short while ago someone posted that(unlike the examples) you should
use Tk as the base for your main window in tkinter apps, not Frame. Thus :
class MyMain(Frame):
def __init__(self, master):
self.root = master
self.master=master
self
Excuse me for intruding, but I followed examples and ended up with a
similar architecture:
from Tkinter import *
class MyMain(Frame):
def __init__(self, master):
self.root = master
self.master=master
root = Tk()
app = MyMain(root)
app.ma
initialize as no choice
...
will be clearer.
Thanks again!
Bill
Peter Otten wrote:
> William Gill wrote:
>
>
>>Also, does 'row == var.get() for var in self.variables' perform the
>>comparison row == var.get() for each item in self.variables? I would
>>have h
Radiogrid doesn't initialize w/row 1 selected, and
accomodates cases where nothing is selected in any column.
Bill
Peter Otten wrote:
> William Gill wrote:
>
>
>>I thought the problem was practical, not philosophical, but what do I
>>know I'm the one asking for help.
or var in self.variables' perform the
comparison row == var.get() for each item in self.variables? I would
have had to write:
for var in self.variables:
return row == var.get()
Again, thanks.
Bill
Peter Otten wrote:
> William Gill wrote:
>
>
>>I thought the problem w
e column information (intVar values) to row
information.
Bill
Peter Otten wrote:
> William Gill wrote:
>
>
>>The radiobutton widget knows if it is selected or unselected, or it
>>wouldn't be able to display correctly, but based on what I'm seeing,
>>that
different intVar to each 'column', but I can't figure out how to
'slice' them horizontally w/o breaking their vertical relationships.
Bill
Peter Otten wrote:
> William Gill wrote:
>
>
>>I am placing radiobuttons in a 4 X 4 matrix (using loops) and kee
d have to loop through all four intVars four times to
determine which radiobuttons are selected in each row. That's what I
mean by messy.
Bill
Eric Brunel wrote:
> On Sat, 25 Jun 2005 19:34:50 GMT, William Gill <[EMAIL PROTECTED]> wrote:
>
>> I am placing radiob
I am placing radiobuttons in a 4 X 4 matrix (using loops) and keep
references to them in a 2 dimensional list ( rBtns[r][c] ). It works
fine, and I can even make it so only one button per column can be
selected, by assigning each column to an intVar. In many languages a
radiobutton has a prop
I have a Tkinter (frame) widget that contains several other frame
widgets, each containing entry widgets. In the parent frame I have a
'save' button that is initially disabled. As it is now, each widget has
a hasChanged property that I can poll to see if updates to the source
data need to be
Kent Johnson wrote:
> William Gill wrote:
>
>> I know a major problem I am having is that I am finding lots of
>> Tkinter information in 'fragments' of various , sometimes conflicting
>> vintages. For example the python reference I was using didn't sho
I know a major problem I am having is that I am finding lots of Tkinter
information in 'fragments' of various , sometimes conflicting vintages.
For example the python reference I was using didn't show the '%%' as
an escape sequence, I posted asking how to escape the '%' and after
several help
I am trying to create a Python UI in Tkinter and have several (frame)
widgets that display various data fields. I am trying to create a
'changed' event that each widget can trigger when they have been edited.
I see lots of references that suggest that 'custom' events can be
created, but have
Kent Johnson wrote:
> William Gill wrote:
>
>> Kent Johnson wrote:
>>
>> If I change the area code in one record only the phonenumber table
>> needs to be updated, but since areaCode is a child of phones,
>> phones.hasChanged needs to be set to True by th
Kent Johnson wrote:
> William Gill wrote:
>
>> I am trying to get & set the properties of a widget's parent widget.
>> What I have works, but seems like a long way around the block. First
>> I get the widget name using w.winfo_parent(), then i convert
Kent Johnson wrote:
> William Gill wrote:
>
>> I am trying to get & set the properties of a widget's parent widget.
>> What I have works, but seems like a long way around the block. First
>> I get the widget name using w.winfo_parent(), then i convert
Kent Johnson wrote:
> William Gill wrote:
>
>> I am trying to get & set the properties of a widget's parent widget.
>> What I have works, but seems like a long way around the block. First
>> I get the widget name using w.winfo_parent(), then i convert
I am trying to get & set the properties of a widget's parent widget.
What I have works, but seems like a long way around the block. First I
get the widget name using w.winfo_parent(), then i convert the name to a
reference using nametowidget().
self.nametowidget(event.widget.winfo_parent())
Dan Sommers wrote:
> On Mon, 13 Jun 2005 15:12:54 GMT,
> William Gill <[EMAIL PROTECTED]> wrote:
>
>
>>I am using the % operator to create queries for a db app. It works fine
>>when exact strings, or numbers are used, but some queries need partial
>>matching
I am using the % operator to create queries for a db app. It works fine
when exact strings, or numbers are used, but some queries need partial
matching that use the '%' as a wildcards. So for example the resultant
string should be 'WHERE name LIKE %smith%' (would match silversmith,
smithy, an
Jonathan Ellis wrote:
> William Gill wrote:
>
>>I am trying to make a simple data editor in Tkinter where each data
>>element has a corresponding Entry widget. I have tried to use the
>>FocusIn/FocusOut events to set a 'hasChanged' flag (if a record has
I am trying to make a simple data editor in Tkinter where each data
element has a corresponding Entry widget. I have tried to use the
FocusIn/FocusOut events to set a 'hasChanged' flag (if a record has not
changed, the db doesn’t need updating). This seems to work fine except
that when the
68 matches
Mail list logo