In Dave Angel
writes:
> > The problem is that change() isn't being executed here; instead it's being
> > executed from within root.mainloop(), whenever the user presses button-1.
> >
> > And within root.mainloop(), there is no variable called isWhite.
> >
> Actually that's irrelevant. Whether
On 06/24/2013 04:12 PM, John Gordon wrote:
In
pablobarhamal...@gmail.com writes:
isWhite = True
def change(event):
if event.x > x1 and event.x < x2 and event.y > y1 and event.y < y2:
if isWhite:
w.itemconfig(rect, fill="blue")
isWhite = False
On 24 June 2013 21:19, wrote:
> Thank's to you all!
>
> Setting isWhite as global worked fine.
> I'll probably be back soon with another silly question, see you then :)
By the way, it's normally bad to use globals like this. When you're
learning it's something you just do, though; it's fine for
On 24 June 2013 21:12, John Gordon wrote:
> Since you're new to programming, this might be a bit tricky to explain,
> but I'll do my best. :-)
>
> The problem is that change() isn't being executed here; instead it's being
> executed from within root.mainloop(), whenever the user presses button-1.
Here's a little test to make sure you understand (this is one of the
most confusing parts of Python's closures in my opinion):
foo = "I'm foo!"
def working():
print(foo)
def broken():
print(foo)
if False: # There's no way this could cause a problem!
foo = "This will *never*
Thank's to you all!
Setting isWhite as global worked fine.
I'll probably be back soon with another silly question, see you then :)
--
http://mail.python.org/mailman/listinfo/python-list
In
pablobarhamal...@gmail.com writes:
> isWhite = True
>
> def change(event):
> if event.x > x1 and event.x < x2 and event.y > y1 and event.y < y2:
> if isWhite:
> w.itemconfig(rect, fill="blue")
> isWhite = False
> else:
> w.itemc
Op 24-06-13 21:47, pablobarhamal...@gmail.com schreef:
Hi there! I'm quite new to programming, even newer in python (this is actually
the first thing I try on it), and every other topic I've seen on forums about
my problem doesn't seem to help.
So, the following lines are intended to draw a wh
pablobarhamal...@gmail.com wrote:
> Hi there! I'm quite new to programming, even newer in python (this is
> actually the first thing I try on it), and every other topic I've seen on
> forums about my problem doesn't seem to help.
>
> So, the following lines are intended to draw a white square (wh
Just before anyone says, the reason I bind to the Canvas instead of binding
directly to the rectangle is because I plan to add more squares in the future.
Cheers.
--
http://mail.python.org/mailman/listinfo/python-list
Hi there! I'm quite new to programming, even newer in python (this is actually
the first thing I try on it), and every other topic I've seen on forums about
my problem doesn't seem to help.
So, the following lines are intended to draw a white square (which it does),
turn it to blue when you cl
Le 08/06/2010 10:03, ch1zra a écrit :
import os, time, re, pyodbc, Image, sys
from datetime import datetime, date, time
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm
from reportlab.pdfgen import canvas
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttf
ch1zra a écrit :
On Jun 8, 10:59 am, Bryan wrote:
Python doesn't have one global namespace. Each module (file) has its
own namespace, which is a Python dict, and 'global' means defined in
the containing module's dict. Put the import:
from reportlab.pdfgen import canvas
in the mkTable.py fil
Peter Otten wrote:
> Chris Rebert wrote:
[...]
> > The only global variable defined in mkTable.py is the "mkTable"
> > function (partly since you don't import anything). So the reference to
> > the global variable "canvas" on the right-hand side of this expression
> > is completely undefined, resul
Chris Rebert wrote:
> On Tue, Jun 8, 2010 at 2:00 AM, ch1zra wrote:
>> On Jun 8, 10:29 am, Richard Thomas wrote:
>>> On Jun 8, 9:03 am, ch1zra wrote:
>>> > I have following code :
>>>
>>> > import os, time, re, pyodbc, Image, sys
>>> > from datetime import datetime, date, time
>>> > from report
On Jun 8, 10:59 am, Bryan wrote:
> ch1zra wrote:
> > I have following code :
>
> > import os, time, re, pyodbc, Image, sys
> > from datetime import datetime, date, time
> > from reportlab.lib.pagesizes import A4
> > from reportlab.lib.units import cm
> > from reportlab.pdfgen import canvas
> > fro
On Tue, Jun 8, 2010 at 2:00 AM, ch1zra wrote:
> On Jun 8, 10:29 am, Richard Thomas wrote:
>> On Jun 8, 9:03 am, ch1zra wrote:
>> > I have following code :
>>
>> > import os, time, re, pyodbc, Image, sys
>> > from datetime import datetime, date, time
>> > from reportlab.lib.pagesizes import A4
>>
On Jun 8, 10:29 am, Richard Thomas wrote:
> On Jun 8, 9:03 am, ch1zra wrote:
>
>
>
>
>
> > I have following code :
>
> > import os, time, re, pyodbc, Image, sys
> > from datetime import datetime, date, time
> > from reportlab.lib.pagesizes import A4
> > from reportlab.lib.units import cm
> > from
ch1zra wrote:
> I have following code :
>
> import os, time, re, pyodbc, Image, sys
> from datetime import datetime, date, time
> from reportlab.lib.pagesizes import A4
> from reportlab.lib.units import cm
> from reportlab.pdfgen import canvas
> from reportlab.pdfbase import pdfmetrics
> from repor
On Jun 8, 9:03 am, ch1zra wrote:
> I have following code :
>
> import os, time, re, pyodbc, Image, sys
> from datetime import datetime, date, time
> from reportlab.lib.pagesizes import A4
> from reportlab.lib.units import cm
> from reportlab.pdfgen import canvas
> from reportlab.pdfbase import pdf
I have following code :
import os, time, re, pyodbc, Image, sys
from datetime import datetime, date, time
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm
from reportlab.pdfgen import canvas
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTF
21 matches
Mail list logo