Using code objects?
===
As an OO exercise I have a factory pattern that returns class objects that
each have an "action" method. ClassObj.action() in turn returns a code
object in my recursive process loop.
I create the code objects as a one time step outside my factory pattern
Don Parris said unto the world upon 20/06/2005 14:10:
> On Mon, 20 Jun 2005 09:11:53 +0100
> "Alan G" <[EMAIL PROTECTED]> wrote:
>>for m in menu.keys():
>> print "%s\t%s" % (m,menu[m][0])
>>
>
> I am curious what the "%" by itself is doing.
> Don
Hi Don,
it is indicating that the tuple
On Mon, 20 Jun 2005 09:11:53 +0100
"Alan G" <[EMAIL PROTECTED]> wrote:
> > "raw_input", but I get "H is not defined" when I run the script.
> > Essentially, I'd like the user to enter a number for most items,
> > but use letters for "Help", "Quit", and "Back to Main".
>
> Are you sure? That ki
lawrence wang wrote:
> How do I refresh the interpreter environment without restarting it, if
> possible? For example, I'm using the interpreter to test a class I'm
> writing; importing and instantiating it reveals a typo; I go and fix
> the typo. Now, is there any way to reload the class afresh? S
How do I refresh the interpreter environment without restarting it, if
possible? For example, I'm using the interpreter to test a class I'm
writing; importing and instantiating it reveals a typo; I go and fix
the typo. Now, is there any way to reload the class afresh? Simply
importing again doesn't
Quoting János Juhász <[EMAIL PROTECTED]>:
> That I don't know is the asterisk in zip(*[labels] + rows)
> I wasn't able to find in the python reference what it means.
> May you help me in that ?
You can find it in the language reference: http://docs.python.org/ref/calls.html
Basically, suppose yo
Quoting Andre Engels <[EMAIL PROTECTED]>:
> Is it possible to call a web browser from Python, opening a certain
> page? Preferably the user's standard web browser.
Check the webbrowser module :-)
--
John.
___
Tutor maillist - Tutor@python.org
http:/
On Mon, 20 Jun 2005, Shuying Wang wrote:
> Can anyone recommend a library that will let me call perl functions from
> python? I have a python dictionary that I would like to convert to a
> perl hash for some function.
Hi Shuying,
Sure! You may want to look at the PyPerl project:
http://w
Andre Engels said unto the world upon 20/06/2005 04:26:
> Is it possible to call a web browser from Python, opening a certain
> page? Preferably the user's standard web browser.
>
> Andre Engels
> ___
> Tutor maillist - Tutor@python.org
> http://mail.p
Is it possible to call a web browser from Python, opening a certain
page? Preferably the user's standard web browser.
Andre Engels
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
JOhn,
> This is probably it:
> >>> arr = range(20)
> >>> arr[::2]
You are probably right, I forgot that slicing now
had a 3rd element... :-)
Alan G.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> What would be the most Pythonic way
THats always going to be subjective but...
> of printing (or extracting) every
> other element of a list?
I'd probably use range with a step of 2.
for index in range(0,len(mylist),2):
ptint mylist[index]
Alan G
Author of the Learn to Program web tuto
> "raw_input", but I get "H is not defined" when I run the script.
> Essentially, I'd like the user to enter a number for most items,
> but use letters for "Help", "Quit", and "Back to Main".
Are you sure? That kind of inconsistent input is one of the
big no-nos of user interface design. It us
-
def menu(y):
main.grid_remove ()
root.update()
if y ==1:
menu1()
etc/...
def menu1():
X=Canvas(root, width=200, height=200, bg="blue")
X.grid(row=0,column=0)
but2=Button(X,text="back",command=mainmenu)
but2.grid()
def menu2():...
def menu3():...
root=
Hi,
Can anyone recommend a library that will let me call perl functions
from python? I have a python dictionary that I would like to convert
to a perl hash for some function.
cheers,
Shuying
___
Tutor maillist - Tutor@python.org
http://mail.python.org
Dear Alan,
similar :)
I have scripted a small sql e-mail reporting simplified from
# written by Mike Brown
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/148061
import string
def TableStr(labels, rows, delim=' | '):
columns = zip(*[labels] + rows)
# get the maximum of ea
16 matches
Mail list logo