Sorry for the unnecessary post with no response -- inadvertent click
on "Send" button which was too near Gmail's "..." button to expand
content.
On Mon, Apr 17, 2017 at 6:13 PM, Phil wrote:
> Thank you for reading this.
>
> How do I reference the_canvas from my solve()
On Mon, Apr 17, 2017 at 6:13 PM, Phil wrote:
> Thank you for reading this.
>
> How do I reference the_canvas from my solve() method? Despite hours of
> searching I haven't been able to solve this or find a similar example. All
> that I've gained is a headache.
>
>
I made one more diagnostic change to your script, changing the
FillWithStars function to this:
def FillWithStars():
with sqlite3.connect("stars.db") as connection:
connection.executescript("""
CREATE TABLE brightest(
name,
constellation,
On Mon, Apr 17, 2017 at 04:36:50PM -0700, Marilyn Davis wrote:
> #!/usr/bin/env python3
> """
> Hello Tutors,
>
> I can't figure out why the FillWithStars() function puts Canopus in the db
> twice.
Good question. And thank you for providing a really well-written,
simple, clear script that we
Ah, Peter, if only I could achieve your understanding and mastery!
On Mon, Apr 17, 2017 at 3:37 AM, Peter Otten <__pete...@web.de> wrote:
> Perhaps it becomes clearer if we build our own class discovery / method
> runner system. Given T as the baseclass for classes that provide foo_...()
>
On Sun, Apr 16, 2017 at 11:50 PM, Mats Wichmann wrote:
>
> You got me thinking as well, as I don't much care for unittest, at least
> partly because it forces you to use classes even when it doesn't feel
> all that natural.
I have looked into pytest multiple times, but have
Thank you for reading this.
How do I reference the_canvas from my solve() method? Despite hours of
searching I haven't been able to solve this or find a similar example. All that
I've gained is a headache.
Exception in Tkinter callback
Traceback (most recent call last):
File
This is an aliasing problem. Change the code to
super = []
sub = [""]*3
other = ["a","b","c","d"]
sub[0] = "hi"
sub[1] = "hello"
for item in other:
l = sub[:]
l[2] = item
super.append(l)
for item in super:
print item
regards,
Sarma.
On Tue, Apr 18, 2017 at 2:16 AM, Mats Wichmann
On 18/04/17 00:36, Marilyn Davis wrote:
> #!/usr/bin/env python3
> """
> Hello Tutors,
>
> I can't figure out why the FillWithStars() function puts Canopus in the db
> twice.
>
> What am I missing?
I don;t know but I converted your script into the more
conventional form and it worked. it was
>>
>> Is there anything wrong in this code or any feature of python?
>
> yeah, feature of Python. you could google for "deep copy".
>
the reference issue is involved here, but my explanation was off, I
confused myself, listen to Peter instead :) It's just the same list
four times.
#!/usr/bin/env python3
"""
Hello Tutors,
I can't figure out why the FillWithStars() function puts Canopus in the db
twice.
What am I missing?
Thank you for any help.
Marilyn Davis
p.s. That Reset(db_name) is in there so that you can run it over and over
if you want.
---
"""
import os,
On 04/17/2017 12:41 PM, Rasika Sapate via Tutor wrote:
> Dear Python group,
> I had written following code.
>
> super = []
> sub = [""]*3
> other = ["a","b","c","d"]
> sub[0] = "hi"
> sub[1] = "hello"
> for item in other:
> sub[2] = item
> super.append(sub)
> for item in super:
>
On 04/16/2017 11:24 AM, Chris Warrick wrote:
On 16 April 2017 at 18:16, Jim wrote:
On 04/16/2017 10:10 AM, Chris Warrick wrote:
On 16 April 2017 at 16:45, Jim wrote:
My system python is 2.7.12 so I created a virtual environment using venu
to
On 04/16/2017 02:18 PM, Mats Wichmann wrote:
On 04/16/2017 10:16 AM, Jim wrote:
On 04/16/2017 10:10 AM, Chris Warrick wrote:
On 16 April 2017 at 16:45, Jim wrote:
My system python is 2.7.12 so I created a virtual environment using
venu to
run 3.5.2. I put it in
Rasika Sapate via Tutor wrote:
> Dear Python group,
> I had written following code.
>
> super = []
> sub = [""]*3
> other = ["a","b","c","d"]
> sub[0] = "hi"
> sub[1] = "hello"
> for item in other:
> sub[2] = item
> super.append(sub)
> for item in super:
> print item
>
>
> Output :
Dear Python group,
I had written following code.
super = []
sub = [""]*3
other = ["a","b","c","d"]
sub[0] = "hi"
sub[1] = "hello"
for item in other:
sub[2] = item
super.append(sub)
for item in super:
print item
Output :
['hi', 'hello', 'd']
['hi', 'hello', 'd']
['hi', 'hello', 'd']
> coming to recursion well i currently use eval() so everything ok i don't
> have to worry about brackets but i want to write my own parser. a top down
> parser for expressions.
Do *not* use eval to parse expressions. It is an extremely bad idea to do this.
Instead, you can use ast.parse,
On Mon, Apr 17, 2017 at 12:00 AM, Alan Gauld via Tutor wrote:
> On 16/04/17 18:26, Tyler Seacrist wrote:
>
>> I need to draw a stack diagram for print_n
>> called with s = 'Hello' and n=2 and am unsure of how to do so.
Are you referring to this?
On 04/16/2017 04:57 PM, Sergio Rojas wrote:
On 04/14/2017 04:21 AM, Peter Otten wrote:
Stephen P. Molnar wrote:
However, what I want to do is multiply each element ob D by each element
of s and sum all of the products.
If you *really* want this:
sum_of_all_products = s.sum() * D.sum()
Peter Otten wrote:
> class M:
> def foo_one(self):
> print(self.__class__.__name__, "one")
> def foo_two(self):
> print(self.__class__.__name__, "one")
Oops, foo_two() should of course print "two", not "one".
___
Tutor
boB Stepp wrote:
> It is here that I am struggling. If the mixin class does not inherit
> from unittest.TestCase, then how is test_func ever seen?
Perhaps it becomes clearer if we build our own class discovery / method
runner system. Given T as the baseclass for classes that provide foo_...()
On 16/04/17 18:26, Tyler Seacrist wrote:
> I need to draw a stack diagram for print_n
> called with s = 'Hello' and n=2 and am unsure of how to do so.
Me too.
What is print_n?
Which stack?
One in your program or the interpreters internal stack?
We need a lot more detail.
--
Alan G
Author
-- Forwarded message --
From: "Palm Tree"
Date: 16 Apr 2017 10:07
Subject: Re: [Tutor] bracket issue
To: "Peter Otten" <__pete...@web.de>
Cc:
Ok thanks for the answers. Perfect.
Just to clarify why i wanted recursion was that well coming to compiler
Hello,
I need to draw a stack diagram for print_n called with s = 'Hello' and n=2 and
am unsure of how to do so.
Thanks,
Tyler
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
On 16 Apr 2017 10:01, "Palm Tree" wrote:
Sorry for late reply.
We usually organise python challenges.
Once we organise a gui calculator challenge.
You can view the submissions on my blog here:
https://abdurrahmaanjanhangeer.wordpress.com/gui-py-
On 04/16/2017 10:01 PM, boB Stepp wrote:
> OK, between Alan and Martin I think that I see how to make the code
> snippet actually test a *function* as the snippet seems to suggest.
> Recollect that my original question(s) started:
You got me thinking as well, as I don't much care for unittest,
On 17/04/17 05:01, boB Stepp wrote:
> Am I missing anything? If not, then why did the code snippet use the
> (I believe to be misleading.) class variable approach with "func =
> mySuperWhammyFunction" and "self.func(self.arg)"?
I suspect it was a slightly broken attempt at reuse in that
you can
27 matches
Mail list logo