Sean Perry wrote:
yep. call 'Parent.__init__(this, that)' then do 'self.new = new'
def __init__(self, this, that, new):
Parent.__init__(this, that)
self.new = new
Thanks.
Though it should be:
def __init__(self, this, that, new):
Parent.__init__(self, this, that) #note self
self.new =
Sent only to Liam... Forwading..
Original Message
Subject: Re: [Tutor] Recursive Tkinter buttons
Date: Fri, 25 Feb 2005 05:45:00 -0200
From: Ismael Garrido <[EMAIL PROTECTED]>
To: Liam Clarke <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]> <[EMAIL PRO
>
> for i in range(0,10):
> print i
> buttonlabel = "field " +str(i)
> button[i].append = Button (text=buttonlabel)
> button[i].grid(column=3, row = i+3)
>
> The current
On Thu, 24 Feb 2005 21:26:29 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote:
> Adam Cripps wrote:
> > I'm trying to create recursive Tkinter buttons with:
> >
> > for i in range(0,10):
> > print i
> > buttonlabel = "field " +str(i)
> >
Ismael Garrido wrote:
Hello
My code is like this:
class Parent:
def __init__(self, bunch, of, variables):
self.bunch, self.of, self.variables = bunch, of, variables
class Son(Parent):
def __init__(self, bunch, of, variables, new):
self.bunch, self.of, self.variables, self.new = bu
Hello
My code is like this:
class Parent:
def __init__(self, bunch, of, variables):
self.bunch, self.of, self.variables = bunch, of, variables
class Son(Parent):
def __init__(self, bunch, of, variables, new):
self.bunch, self.of, self.variables, self.new = bunch, of,
variables, n
Adam Cripps wrote:
I'm trying to create recursive Tkinter buttons with:
for i in range(0,10):
print i
buttonlabel = "field " +str(i)
button[i] = Button (text=buttonlabel)
button[i].grid(c
Thanks for the tip.
John Purser
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Michael Dunn
Sent: Thursday, February 24, 2005 14:43
To: tutor@python.org
Subject: [Tutor] Reading Tutor with gmail: monospace fonts
Hi all,
This is slightly off topic, but
Quoting Danny Yoo <[EMAIL PROTECTED]>:
> I think that only widgets that are designated as "containers" can
> contain other widgets. A Frame is an example of a widget that can contain
> other widgets:
This is (I think) true; but the root can also contain widgets, and it is the
default if no other
On Thu, 24 Feb 2005, Adam Cripps wrote:
> I'm trying to create recursive Tkinter buttons with:
>
> for i in range(0,10):
> print i
> buttonlabel = "field " +str(i)
> button[i] = Button (text=buttonlabel)
>
Hi all,
This is slightly off topic, but I've noticed a lot of people are using
gmail accounts to post to tutor and I just wanted to share a useful
trick I just learned for making gmail display and edit mail with a
monospace rather than proportional font. I'm sure anyone who's tried
it agrees that
I'm trying to create recursive Tkinter buttons with:
for i in range(0,10):
print i
buttonlabel = "field " +str(i)
button[i] = Button (text=buttonlabel)
button[i].grid(column=3, row = i+3
Hi Luke,
> Is there a way to preserve the readability of the code and have
> printed text from indented blocks, say, nested conditionals, appear
> flush at left, not printed exactly where I've written them in the
> script?
you can use the textwrap module for this.
>>> from textwrap import dedent
Michael Lange wrote:
Ok, user input must be checked whether it's unicode or not and if necessary be
decoded to
unicode with system encoding. For internal operations I should then use only
unicode strings
and if I need to print something to stdout I must encode it again with system
encoding, righ
On Thu, 24 Feb 2005 07:51:04 -0500
Kent Johnson <[EMAIL PROTECTED]> wrote:
> Michael Lange wrote:
> > I *thought* I would have to convert the user input which might be any
> > encoding back into
> > byte string first
>
> How are you getting the user input? Is it from the console or from a GUI?
On Thu, 24 Feb 2005 14:23:28 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote:
> Bill Mill wrote:
> >>class foo:
> >>def bar(self):
> >
> >
> > Sorry, I forgot that if it's in the module, you should declare prompt1
> > as global by using "global prompt1" right here.
> >
> >
> >>print promp
Hi Friends,
Department of Information Technology, Madras Institute of Technology,
Anna University
is conducting a technical symposium, Samhita. As a part of samhita, an
Online Programming Contest is scheduled on Sunday, 27 Feb 2005.
This is the first Online Programming Contest in India to support
> > > > I'm writing a simple game (run in command line) in which narrative
> > > > text is printed in response to a user's decisions. The problem I'm
> > > > running into is that triple quotes used in an indented block
> > > > preserves the indentation when it prints.
[text cut]
> > > Why not j
Bill Mill wrote:
class foo:
def bar(self):
Sorry, I forgot that if it's in the module, you should declare prompt1
as global by using "global prompt1" right here.
print prompt1 % (var1, var2, var3)
No, you only need the global statement if you want to assign to a global variable. Read-on
On Wed, 23 Feb 2005, Jacob S. wrote:
> Say I put the code
>
> import psyco
> psyco.full()
>
> in sitecustomize.py and run a random file that I have already got an
> average execution time of. Then I run it again, with the above
> implemented. My execution time is has dropped. Which brings me to
On Thu, 24 Feb 2005, Smith, Jeff wrote:
> I notice that python only pre-compiles imported modules and not the main
> script. The only way I seem to be able to get this to happen is to run
>
> python -c "import mainscript"
Hi Jeff,
Python automatically tries to compile module code on an 'imp
Execllent.
Many Thanks,
Luke
On Thu, 24 Feb 2005 13:15:41 -0500, Bill Mill <[EMAIL PROTECTED]> wrote:
> On Thu, 24 Feb 2005 13:14:13 -0500, Bill Mill <[EMAIL PROTECTED]> wrote:
> > On Thu, 24 Feb 2005 10:02:44 -0800, Luke Jordan <[EMAIL PROTECTED]> wrote:
> > > Hi all,
> > >
>
On Thu, 24 Feb 2005 13:14:13 -0500, Bill Mill <[EMAIL PROTECTED]> wrote:
> On Thu, 24 Feb 2005 10:02:44 -0800, Luke Jordan <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > I've tried a lot of experimenting and searching through various
> > tutorials, and I haven't been able to come up with a solution
On Thu, 24 Feb 2005 10:02:44 -0800, Luke Jordan <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I've tried a lot of experimenting and searching through various
> tutorials, and I haven't been able to come up with a solution to this,
> ostensibly simple, problem.
>
> I'm writing a simple game (run in com
Hi all,
I've tried a lot of experimenting and searching through various
tutorials, and I haven't been able to come up with a solution to this,
ostensibly simple, problem.
I'm writing a simple game (run in command line) in which narrative
text is printed in response to a user's decisions. The prob
OK, as ignorant as I may be on threads, I have read a bit on Stackless
Python's tasklets. Suppossedly they require much less memory than
python's threads.
Information is at www.stackless.com
Hugo
Shitiz Bansal wrote:
Hi,
I am trying to build a traffic network simulator using
python, for my degre
I notice that python only pre-compiles imported modules and not the main
script. The only way I seem to be able to get this to happen is to run
python -c "import mainscript"
Am I missing something?
Thanks,
Jeff
___
Tutor maillist - Tutor@python.org
Michael Lange wrote:
I *thought* I would have to convert the user input which might be any encoding back into
byte string first
How are you getting the user input? Is it from the console or from a GUI?
I think the best strategy is to try to keep all your strings as Unicode. Unicode is the only
en
On Wed, 23 Feb 2005 23:16:20 -0500
Kent Johnson <[EMAIL PROTECTED]> wrote:
> How about
>n = self.nextfile
>if not isinstance(n, unicode):
> n = unicode(n, 'iso8859-1')
> ?
>
> > At least this might explain why "A\xe4" worked and "\xe4" not as I
> > mentioned in a previous post.
> >
29 matches
Mail list logo