[Tutor] How to test a function which runs a passed in function twice?

2016-10-02 Thread boB Stepp
edge cases for this function. Something exploring the limits of Python's functionality? -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Testing print

2016-10-01 Thread boB Stepp
On Sat, Oct 1, 2016 at 7:19 PM, Alan Gauld via Tutor <tutor@python.org> wrote: > On 01/10/16 23:08, boB Stepp wrote: >> On Sat, Oct 1, 2016 at 11:35 AM, Alan Gauld via Tutor <tutor@python.org> >> wrote: >> >>> ... Personally I don't like functions that

Re: [Tutor] Testing print

2016-10-01 Thread boB Stepp
hings the same way I have been doing them. -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Testing print

2016-10-01 Thread boB Stepp
n nicely with the other thread ([Tutor] Passing functions as arguments to other functions) I started in parallel with this one. A practical example of passing a function to another function... -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or cha

Re: [Tutor] Testing print

2016-10-01 Thread boB Stepp
On Sat, Oct 1, 2016 at 2:02 AM, Alan Gauld via Tutor <tutor@python.org> wrote: > On 01/10/16 05:24, boB Stepp wrote: > >> === >> '''Exerise 3.1 from "Think Python 2" by Allen Downey. &g

Re: [Tutor] Testing print

2016-09-30 Thread boB Stepp
On Sat, Oct 1, 2016 at 12:12 AM, Richard Doksa <richarddo...@yahoo.com> wrote: > unsubscibe please If you wish to unsubscribe, go to the bottom of this page and follow its instructions: https://mail.python.org/mailman/listinfo/tutor boB

Re: [Tutor] Passing functions as arguments to other functions

2016-09-30 Thread boB Stepp
On Fri, Sep 30, 2016 at 6:55 AM, Steven D'Aprano <st...@pearwood.info> wrote: > On Thu, Sep 29, 2016 at 09:43:57PM -0500, boB Stepp wrote: >> But why does Python require >> separating the function object from its parameters when it is being >> passed as an argument to a

Re: [Tutor] Passing functions as arguments to other functions

2016-09-30 Thread boB Stepp
On Fri, Sep 30, 2016 at 3:43 AM, Alan Gauld via Tutor <tutor@python.org> wrote: > On 30/09/16 03:43, boB Stepp wrote: > >> Also, I note that if I just type a function name without the >> parentheses in the interpreter, I will get something like this: >> >>>&g

Re: [Tutor] Testing print

2016-09-30 Thread boB Stepp
On Fri, Sep 30, 2016 at 5:07 AM, Steven D'Aprano <st...@pearwood.info> wrote: > On Thu, Sep 29, 2016 at 09:24:51PM -0500, boB Stepp wrote: >> Second, it seems that prints are often intermingled with the main >> logic of a function and only serve to pass on a message to th

[Tutor] Passing functions as arguments to other functions

2016-09-29 Thread boB Stepp
this. But noob boB initially want to do instead: def f(g(*args)): g(*args) def g(*args): # Do somenthing. do_things = f(g(*args)) which, of course, will give me a syntax error. Also, I note that if I just type a function name without the parentheses in the interpreter, I will get

[Tutor] Testing print

2016-09-29 Thread boB Stepp
nly way to capture the output of a print is to redirect the stdout to something I can capture and compare against. Googling brings up some people doing something with mock objects, some redirecting to a string buffer, some to a file, some to other things. What

Re: [Tutor] Questions as to how to run the same unit test multiple times on varying input data.

2016-09-24 Thread boB Stepp
On Sat, Sep 24, 2016 at 11:05 PM, Steven D'Aprano <st...@pearwood.info> wrote: > On Sat, Sep 24, 2016 at 12:55:28AM -0500, boB Stepp wrote: >> def right_justify(a_string): >> '''This fucntion will take the string, "a_string", and left justify it by > &g

Re: [Tutor] Questions as to how to run the same unit test multiple times on varying input data.

2016-09-24 Thread boB Stepp
On Sat, Sep 24, 2016 at 2:04 AM, Ben Finney <ben+pyt...@benfinney.id.au> wrote: > Bob, you may want to also subscribe to the specific forum for testing in > Python <URL:http://lists.idyll.org/listinfo/testing-in-python>. You're > beyond the beginner material that's usually di

Re: [Tutor] Questions as to how to run the same unit test multiple times on varying input data.

2016-09-24 Thread boB Stepp
I wanted to add a clarification as to what I was hoping to achieve. On Sat, Sep 24, 2016 at 12:55 AM, boB Stepp <robertvst...@gmail.com> wrote: > > Of course, this code passed its test when the string was "Monty > Python", so I next wanted to run the same test with diff

[Tutor] Questions as to how to run the same unit test multiple times on varying input data.

2016-09-23 Thread boB Stepp
this without using subTest? Question #3: In "with self.subTest(test_string = test_string):" why is "test_string = test_string" necessary? Is it that using "with" sets up a new local namespace within this context manager? I think with these long Python layoffs I am losing knowledge faster than I am gaining it! Cheers! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Help with Max Number and Min number script

2016-09-17 Thread Bob Gailer
On Sep 17, 2016 4:55 PM, "Sharon Wallace" wrote: > > Would you please help me with the last piece of this assignment? > > > > This is my code: > > > > largest = None > > smallest = None > > > > while True: > > num = raw_input("Enter a number: ") > >

Re: [Tutor] Help with Max Number and Min number script

2016-09-16 Thread Bob Gailer
On Sep 16, 2016 8:12 PM, "Sharon Wallace" wrote: > In addition to showing us your code , Please show us whatever Trace back you got when you ran the code. I would guess you are either getting an indentation error or syntax error in the vicinity of line that begins if

Re: [Tutor] pip says no downloads for PyMedia

2016-09-13 Thread boB Stepp
On Tue, Sep 13, 2016 at 2:17 PM, Jim Byrnes <jf_byr...@comcast.net> wrote: > On 09/12/2016 07:59 PM, Jim Byrnes wrote: >> >> On 09/12/2016 06:06 PM, boB Stepp wrote: >>> >>> On Sep 10, 2016 7:20 PM, "Jim Byrnes" <jf_byr...@comcast.net&

Re: [Tutor] pip says no downloads for PyMedia

2016-09-12 Thread boB Stepp
004. The "latest" news entry is February 1, 2006. So this looks to be from the Python 2 only days. boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Fwd: Re: need help

2016-08-12 Thread boB Stepp
Pallab, please reply to the Tutor list. -- Forwarded message -- From: "Pallab Amway" <pallabam...@gmail.com> Date: Aug 12, 2016 1:05 AM Subject: Re: [Tutor] need help To: "boB Stepp" <robertvst...@gmail.com> Cc: > Respected sir,lots of th

Re: [Tutor] need help

2016-08-11 Thread boB Stepp
ks of code? If not, then you need to research this. Also, you say you're using Python 2.7. Python 2.x uses print *statements* => no parentheses, while Python 3.x uses print *functions*. Something else to read up on. Hope this gives you enough hints to work through your current p

Re: [Tutor] Python Assignment

2016-08-02 Thread Bob Gailer
On Aug 2, 2016 4:42 AM, "Justin Korn via Tutor" wrote: > > To whom it may concern, > > I need help on this assignment: > > > Create a new class, SMS_store. The class will instantiate SMS_store objects, similar to an inbox or outbox on a cellphone: > my_inbox = SMS_store() > This

Re: [Tutor] Help me out please

2016-07-19 Thread Bob Gailer
On Jul 19, 2016 9:24 AM, "Marc Sànchez Quibus" wrote: > > Hi, > First of all I'm gonan introduce myself. My name is Marc and I'm a student > and also a python's programmer begginer. I've been studying/learning python > and now I need some help to finish my project. > I

Re: [Tutor] help with exercise 15 of zed shaw's LPTHW

2016-07-05 Thread boB Stepp
*in* your email body, so that everyone can follow along. Cheers! boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] iterators

2016-07-04 Thread boB Stepp
: event.Skip()This is the error message. Traceback (most recent call last): File "/home/colby/Calculator/Calculator_betaV3.py", line 110, in OnKeyPress elif keycode in (27): TypeError: argument of type 'int' is not iterable I believe that for (27) to be a tuple, you must insert a comma: (

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-07-03 Thread boB Stepp
On 07/03/2016 02:32 PM, Ries Rommens wrote: Hello boB, On the latter I was surprised that Thunderbird did not support conversation views out of the box. After opening Thunderbird you will see a listing of your emails. Clicking on the header of the very first column of the listing will give

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-07-02 Thread boB Stepp
that will probably distract me from Python studies for a while. Again, thanks for all of the help you've collectively given! boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread boB Stepp
On Thu, Jun 30, 2016 at 12:09 AM, Alan Gauld via Tutor <tutor@python.org> wrote: > On 29/06/16 23:58, boB Stepp wrote: > >> One point I just discovered for those new to this and Linux: tkinter >> does *not* come pre-installed with the Python distributions; it will

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread boB Stepp
on guides I read, but not all, so I actually was going to look into this more deeply. Thanks for saving me some research! Alan Gauld said: > If you really want to see what's on offer open the > > Menu->Administration->Software Manager tool > &

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread boB Stepp
On Wed, Jun 29, 2016 at 7:56 PM, boB Stepp <robertvst...@gmail.com> wrote: > Now I can get into BIOS. BIOS sees my USB flash drive as "UEFI: Lexar > USB Flash Drive 1100", but it silently refuses to boot to the iso > image installed on it. Something new to puzzle out!

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread boB Stepp
On Wed, Jun 29, 2016 at 1:12 PM, David Rock <da...@graniteweb.com> wrote: > >> On Jun 29, 2016, at 12:32, boB Stepp <robertvst...@gmail.com> wrote: >> >> On Wed, Jun 29, 2016 at 12:02 PM, David Rock <da...@graniteweb.com> wrote: >>> >>>>

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread boB Stepp
On Wed, Jun 29, 2016 at 12:02 PM, David Rock <da...@graniteweb.com> wrote: > >> On Jun 29, 2016, at 11:20, boB Stepp <robertvst...@gmail.com> wrote: >> >> My Christmas present of a Corsair mechanical gaming keyboard was not >> _seen_ during the boot up se

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-29 Thread boB Stepp
On Tue, Jun 28, 2016 at 6:34 PM, David Rock <da...@graniteweb.com> wrote: > >> On Jun 28, 2016, at 18:16, boB Stepp <robertvst...@gmail.com> wrote: >> >> On Mon, Jun 27, 2016 at 10:48 PM, Steven D'Aprano <st...@pearwood.info> >> wrote: >>>

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-28 Thread boB Stepp
On Mon, Jun 27, 2016 at 10:48 PM, Steven D'Aprano <st...@pearwood.info> wrote: > On Mon, Jun 27, 2016 at 09:52:50PM -0500, boB Stepp wrote: >> My eyes are glazing over from hours and hours of Googling on this. I >> cannot come to a rational conclusion. Perhaps someone can he

Re: [Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-28 Thread boB Stepp
On Mon, Jun 27, 2016 at 9:52 PM, boB Stepp <robertvst...@gmail.com> wrote: [...] > 10) ... I forgot one concern last night: 11) My current graphics adapter is made by NVIDIA. Their drivers are proprietary. Is this going to be a deal breaker for Linux? 12) And what about

[Tutor] OT: Recommendations for a Linux distribution to dual-boot with Win7-64 bit

2016-06-27 Thread boB Stepp
ces in line endings? Am I going to have to be constantly converting back and forth? I guess that is most of it. It will be interesting to hear your thoughts! Thanks in advance! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or cha

Re: [Tutor] My code isn't working properly

2016-06-20 Thread boB Stepp
e did. Otherwise, it does look like a lack of indentation for his statements that are part of the while loop are his problem. boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] ASCII-Art circles, was Re: Why are expressions not allowed as parameters in function definition statements?

2016-06-20 Thread boB Stepp
give me (two) good examples demonstrating an implementation of MVC, which was the main point of the thread. I am content (For a moment at least!). Thanks! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Correct use of model-view-controller design pattern

2016-06-18 Thread boB Stepp
On Sat, Jun 18, 2016 at 11:18 PM, boB Stepp <robertvst...@gmail.com> wrote: > On Sun, May 29, 2016 at 9:28 AM, Peter Otten <__pete...@web.de> wrote: > >> Here's a commandline example with two views (the circle-drawing routine has >> to be fixed)... > > I have t

Re: [Tutor] Correct use of model-view-controller design pattern

2016-06-18 Thread boB Stepp
your code. I still do not fully get decorators. In your code I get the impression that you are trying to be more formal in how you are writing your classes so as to have getter and setter methods, as well as having more explicit separation between model, view and controller. A

Re: [Tutor] Why are expressions not allowed as parameters in function definition statements?

2016-06-18 Thread boB Stepp
On Sat, Jun 18, 2016 at 9:10 PM, Steven D'Aprano <st...@pearwood.info> wrote: > On Sat, Jun 18, 2016 at 02:04:46PM -0500, boB Stepp wrote: > Can you explain what you expected > > def d(row, col/2) > > to mean? I have literally no idea. You know Steve, as I was typing

Re: [Tutor] Why are expressions not allowed as parameters in function definition statements?

2016-06-18 Thread boB Stepp
On Sat, Jun 18, 2016 at 3:14 PM, Joel Goldstick <joel.goldst...@gmail.com> wrote: > On Sat, Jun 18, 2016 at 3:04 PM, boB Stepp <robertvst...@gmail.com> wrote: >> Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 >> 64 bit (AMD64)] on win32 >> T

[Tutor] Why are expressions not allowed as parameters in function definition statements?

2016-06-18 Thread boB Stepp
Python's syntax it will allow one to insert almost any kind of object or expression. TIA! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Best way to do FTP login?

2016-06-17 Thread boB Stepp
! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Py 2.4.4: Inheriting from ftplib.FTP()

2016-06-17 Thread boB Stepp
as possible with what I am forced to in Python 2.4 at work where I have no choices as to Python version.). On Fri, Jun 17, 2016 at 10:31 AM, Steven D'Aprano <st...@pearwood.info> wrote: > Some futher thoughts: > > On Thu, Jun 16, 2016 at 10:38:13AM -0500, boB Stepp wrote: >> class

Re: [Tutor] Py 2.4.4: Inheriting from ftplib.FTP()

2016-06-17 Thread boB Stepp
On Thu, Jun 16, 2016 at 11:40 AM, Alan Gauld via Tutor <tutor@python.org> wrote: > On 16/06/16 16:38, boB Stepp wrote: > >> class FTPFiles(FTP, object): >> """FTP files to Windows server location(s).""" > > OK, First comment. You de

[Tutor] Py 2.4.4: Inheriting from ftplib.FTP()

2016-06-16 Thread boB Stepp
r. Is there a better way to check for connection success? 4) As this class stuff is mostly treading new ground for me, am I doing anything that I should not be doing or should do in a more preferred way? Keep in mind that I am just starting on this code today. As always, many thanks in advance! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] rock paper scissor lizard spock help

2016-06-14 Thread Bob Gailer
On Jun 14, 2016 4:05 PM, "Katelyn O'Malley" wrote: > > Hi I am just getting into python and I am trying to create a rock paper > scissor lizard spock game for 3 people and I cannot figure out the scoring > of the players I attached the code below, any help/ideas is much >

Re: [Tutor] Practice Exercises for Beginner ?

2016-06-02 Thread boB Stepp
programming skills along the way! Good luck on your journeys! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Correct use of model-view-controller design pattern

2016-05-30 Thread boB Stepp
logy is unfamiliar to me. Googling suggests registered views is referring to a dynamically generated presentation, perhaps in the sense of a db view. I suspect I have an idea of what is being meant here, but instead of potentially guessing, would you care to elaborate? Thanks! boB __

Re: [Tutor] Correct use of model-view-controller design pattern

2016-05-30 Thread boB Stepp
On Mon, May 30, 2016 at 11:30 AM, Alan Gauld via Tutor <tutor@python.org> wrote: > On 29/05/16 05:33, boB Stepp wrote: >> 1) If I were to add code to filter user inputs, which file is the >> logical place to place such code? My current impression is that it >> should

Re: [Tutor] Correct use of model-view-controller design pattern

2016-05-30 Thread boB Stepp
On Sun, May 29, 2016 at 9:10 AM, Alan Gauld via Tutor <tutor@python.org> wrote: > On 29/05/16 05:33, boB Stepp wrote: >> My current understanding is that the model contains program logic and >> the data which the program logic manipulates. > > Correct, all the

Re: [Tutor] Learning Regular Expressions

2016-05-30 Thread boB Stepp
On Mon, May 30, 2016 at 12:13 PM, dirkjso...@gmail.com <dirkjso...@gmail.com> wrote: > Hi bob, > > I had used the wrong email address when I wrote to python tutor on this, and > evidently it > took a while for the monitors to let it go ahead and be entered in the l

Re: [Tutor] Study Tips

2016-05-30 Thread boB Stepp
tor archives. As you might imagine, your questions have been asked often before. Alan Gauld has an online tutorial that has a link to it in any of his posts to Tutor. He also has recently released a book himself for learning Python centered around a projects approach. I have done way to much typ

[Tutor] Correct use of model-view-controller design pattern

2016-05-28 Thread boB Stepp
ses as things seemed simple enough that functions seemed more appropriate and straightforward to me. If that is a bad choice, please let me know! TIA! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: ht

Re: [Tutor] Learning Regular Expressions

2016-05-24 Thread boB Stepp
rmation. >>> print ''' \tTab character!!! ''' Tab character!!! >>> Note: I had to simulate with spaces what I see in IDLE as my Gmail refuses to accurately copy my IDLE result. I suspect that your multiple backslash instances are generating

Re: [Tutor] How to make object disappear?

2016-05-09 Thread boB Stepp
On Mon, May 9, 2016 at 11:34 AM, Alan Gauld via Tutor <tutor@python.org> wrote: > On 09/05/16 16:55, boB Stepp wrote: Did not! Lisa Hasler Waters (and her students?) wrote the code!! [Snipped her code and Alan's comments.] boB ___ Tutor

Re: [Tutor] How to make object disappear?

2016-05-09 Thread boB Stepp
There are various stylistic issues. You and your students might want to glance through the portions of PEP 8 similar to the Python that you are currently coding: https://www.python.org/dev/peps/pep-0008/ PEP 8 is the Python style-guide, which many if not most Python coders strive to emulate. Good luck! boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to make object disappear?

2016-05-09 Thread Bob Gailer
On May 9, 2016 8:01 AM, "Lisa Hasler Waters" wrote: > > Dear Tutor, > > My students and I are creating a maze game in tkinter. We are trying to > make the ball disappear when it hits the wall (black lines). We are not > having much luck. The following code has run the best,

Re: [Tutor] Practice python

2016-05-08 Thread boB Stepp
tanford also has some courses, but the last time I went looking there I was checking out Java. Anyway, one MIT link is: http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-201

Re: [Tutor] Python Homework CORRECTION rules -> tools (programs)

2016-05-04 Thread Bob Gailer
On May 3, 2016 2:38 PM, "Katie Tuite" wrote: > > So I know what a color gradient is, I don't know how to compute it though. As far as programs, they told us we should use matplotlib, NumPy, and SciPy to display graphs. Thanks. Always reply to the list as well as me.

Re: [Tutor] Python Homework CORRECTION rules -> tools (programs)

2016-05-03 Thread bob gailer
On May 3, 2016 3:04 AM, "Katie Tuite" > wrote: > > So the question is: > > "a contour plot is a graphic representation of the relationships among three numeric variables in two dimensions. Two variables are for X and Y axes, and a third

Re: [Tutor] Dictionary Question

2016-05-02 Thread Bob Gailer
On May 2, 2016 5:27 PM, "Jason N. via Tutor" wrote: > > Hello, > Wanted to ask if its possible to have a dictionary that can be looked up by either values? > For example, > mydic = {"A: "Apple", "B": "Banana"}When user inputs "A" I want "Apple" to come. But if the user enter

Re: [Tutor] int(1.99...99) = 1 and can = 2

2016-05-01 Thread boB Stepp
On Sun, May 1, 2016 at 5:43 AM, Steven D'Aprano <st...@pearwood.info> wrote: > On Sun, May 01, 2016 at 01:02:50AM -0500, boB Stepp wrote: >> Life has kept me from Python studies since March, but now I resume. >> Playing around in the interpreter I tried: >> >> py3:

Re: [Tutor] Python Homework

2016-05-01 Thread Bob Gailer
On May 1, 2016 4:33 AM, "Katie Tuite" wrote: > > I'm trying to do a python homework question and cannot figure out how to > start at all. > > This is the question > > [image: pasted1] As you can see attachments don't work. Include the code in your post. >

Re: [Tutor] Issues converting a script to a functioin (or something)

2016-05-01 Thread Bob Gailer
On May 1, 2016 8:04 AM, "Olaoluwa Thomas" wrote: > > The novice Python programmer is back. Welcome back. We are here to help you when you are stuck. Telling us something is broken is not adequate. Tell us-what you are expecting the program to do and what results you're

Re: [Tutor] META: Moderation and subscription to the tutor list

2016-05-01 Thread boB Stepp
to me a subjectly large number of very short threads with a > question from someone, a couple of responses from list members, and no > further reply. > Finally, I would like to see digest simply not offered. They are a disaster. > They break subject lines, threading and bury responses in noise. + infinity! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] int(1.99...99) = 1 and can = 2

2016-05-01 Thread boB Stepp
case of 15 nines the final bit is "0", but with 16 nines it is "1". Would someone clarify this for me, please? -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] "List" object is not callable

2016-04-30 Thread bob gailer
On 4/30/2016 3:27 PM, Alex Kleider wrote: On 2016-04-30 11:51, Jason N. via Tutor wrote: Hello, I found this simple script online but when I execute it I get the following error: "TypeError: 'list' object is not callable" Here is the code sample:import subprocess ls_output=

Re: [Tutor] Best tool for programming interactive games in Python

2016-03-29 Thread Bob Gailer
On Mar 29, 2016 2:03 PM, "Lisa Hasler Waters" wrote: > > I continually get this error: > > > Traceback (most recent call last): > File "/Users/lwaters/Desktop/pygameTest.py", line 1, in > import pygame, sys > File >

Re: [Tutor] How to test function using random.randint()?

2016-03-20 Thread boB Stepp
On Sun, Mar 20, 2016 at 8:44 PM, Ben Finney <ben+pyt...@benfinney.id.au> wrote: > boB Stepp <robertvst...@gmail.com> writes: >> Can I not use: >> >> if rng is None: >> rng = random.Random() > > That will work. > > It unfortunately creates

Re: [Tutor] How to test function using random.randint()?

2016-03-20 Thread boB Stepp
f rng is None: > rng = random._inst > > which is the default RNG instance in the module. Can I not use: if rng is None: rng = random.Random() ? When I tested it int the interpreter to see if I could use randint: py3: rng = random.Random() py3: rng.randint(1, 6) 4 Am

Re: [Tutor] How to test function using random.randint()?

2016-03-19 Thread boB Stepp
= rng(1, num_sides). Otherwise you're > trying to call random.randint.randint. And then this statement would be correct as Ben wrote it. Ben, please chime in if I have got it wrong. boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Advice on multi-dimensional data storage

2016-03-19 Thread Bob Gailer
On Mar 16, 2016 5:59 AM, "Matt Williams" wrote: > > Dear Tutors, > > I am looking for some advice. I have some data that has three dimensions to > it. I would like to store it such that one could manipulate (query/ update/ > etc.) by dimension - so it would be

[Tutor] How to test function using random.randint()?

2016-03-18 Thread boB Stepp
, etc. Of course I don't know that I care about testing for this for what will be used in a game for fun. Am I on the right track with this? The actual function will be more complicated in that it will generate a result for multiple dice with potentially a variety of sides, e

Re: [Tutor] Changing the interpreter prompt symbol from ">>>" to ???

2016-03-15 Thread boB Stepp
On Tue, Mar 15, 2016 at 7:35 PM, boB Stepp <robertvst...@gmail.com> wrote: > Is the following result in PowerShell related to what Eryk has been > discussing? > > Windows PowerShell > Copyright (C) 2009 Microsoft Corporation. All rights reserved. > > PS C:\Windows\

Re: [Tutor] Changing the interpreter prompt symbol from ">>>" to ???

2016-03-15 Thread boB Stepp
It does not happen in the IDLE Python shell. This is bizarre. What's up? boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Pmw/Tkinter question

2016-03-13 Thread boB Stepp
t makes me feel quite a bit better as I wash the egg off my face from my earlier erroneous efforts. I think I have it right now. boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Pmw/Tkinter question

2016-03-13 Thread boB Stepp
On Sun, Mar 13, 2016 at 6:06 PM, boB Stepp <robertvst...@gmail.com> wrote: > On Sun, Mar 13, 2016 at 11:01 AM, Albert-Jan Roskam > <sjeik_ap...@hotmail.com> wrote: >> > >> Thanks! However, if you replace 'broccol

Re: [Tutor] Pmw/Tkinter question

2016-03-13 Thread boB Stepp
I add back in your long "broccoli-..." option. I will send you a png image of what I am seeing on my PC privately. -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Pmw/Tkinter question

2016-03-12 Thread boB Stepp
by not having the proper case for these, but then, I wasn't doing classes. boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Pmw/Tkinter question

2016-03-12 Thread boB Stepp
; if it is WN, the label is placed at the top of the left-hand side; if it is WS, the label is placed at the bottom of the left-hand side. I presume the second letter possibilities are referring to vertical spacing. Hope this helps! boB ___ Tutor maill

Re: [Tutor] OT: (Continuous) integration testing: Can a solo developer with very limited resources truly do this?

2016-03-12 Thread boB Stepp
On Sat, Mar 12, 2016 at 2:02 PM, Alan Gauld <alan.ga...@btinternet.com> wrote: > On 12/03/16 18:10, boB Stepp wrote: > Virtual machines, eg VirtualBox. > You can install all of the required OS on a single physical machine > (assuming the same hardware of course). For example,

[Tutor] OT: (Continuous) integration testing: Can a solo developer with very limited resources truly do this?

2016-03-12 Thread boB Stepp
h using some complex combination of virtual environments to test all relevant OS's (Assuming I could even afford copies WinXP, WinVista, Win7, Win10, etc., with all their many permutations.), how can automated, continuous integration testing be accomplished *in practice* for the severely re

Re: [Tutor] Changing the interpreter prompt symbol from ">>>" to ???

2016-03-12 Thread boB Stepp
On Sat, Mar 12, 2016 at 2:14 AM, Cameron Simpson <c...@zip.com.au> wrote: > On 12Mar2016 00:46, boB Stepp <robertvst...@gmail.com> wrote: >> Additionally, one must set the font for cmd.exe and PowerShell to >> "Lucida Console" or the above will not work. >

Re: [Tutor] Changing the interpreter prompt symbol from ">>>" to ???

2016-03-11 Thread boB Stepp
re? All of this works fine with utf-8 there. boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Changing the interpreter prompt symbol from ">>>" to ???

2016-03-11 Thread boB Stepp
On Fri, Mar 11, 2016 at 11:02 PM, Cameron Simpson <c...@zip.com.au> wrote: > On 11Mar2016 21:31, boB Stepp <robertvst...@gmail.com> wrote: >> >> I must be bored tonight. I have to confess that when copying and >> pasting from the interpreter into a plain text em

Re: [Tutor] Changing the interpreter prompt symbol from ">>>" to ???

2016-03-11 Thread boB Stepp
On Fri, Mar 11, 2016 at 9:31 PM, boB Stepp <robertvst...@gmail.com> wrote: > Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 > 64 bit (AMD64)] on win32 > Type "help", "copyright", "credits" or "license" for more infor

[Tutor] Changing the interpreter prompt symbol from ">>>" to ???

2016-03-11 Thread boB Stepp
this as well, but haven't found the right search query yet. I also poked into some of the idlelib files, but so far the only ">>>" I've found have been in specialized displays like IDLE debug. TIA! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Surprised that print("a" "b") gives "ab"

2016-03-05 Thread boB Stepp
On Sun, Mar 6, 2016 at 12:37 AM, Ben Finney <ben+pyt...@benfinney.id.au> wrote: > boB Stepp <robertvst...@gmail.com> writes: > >> […] why was this feature implemented? > > You've been asking that a lot lately :-) This forum is unlikely to be > able to g

Re: [Tutor] Why does 01 give a syntax error, but 00 (or 00...0) does not?

2016-03-05 Thread boB Stepp
On Sat, Mar 5, 2016 at 11:32 PM, Steven D'Aprano <st...@pearwood.info> wrote: > On Sat, Mar 05, 2016 at 05:20:21PM -0600, boB Stepp wrote: > >> Why do zeros not give a syntax error, but other numbers with a leading >> zero do give a syntax error? An online search rev

[Tutor] Surprised that print("a" "b") gives "ab"

2016-03-05 Thread boB Stepp
ugh (So far!) on my New Year's resolution to persistently work through some Python books. I've knocked off "Python Crash Course", which I think is a fine beginner's book. Now I am starting "Think Python, 2nd ed.", which is an intro to C.Sc.-type book. So I imagine I may

Re: [Tutor] Help with an error

2016-03-05 Thread boB Stepp
on and have no special need for Python 2, then you should work on learning Python 3. -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Why does 01 give a syntax error, but 00 (or 00...0) does not?

2016-03-05 Thread boB Stepp
0 starts an octal number, but this was changed in Python 3. But then why is 00...0 valid, that is, does not give a syntax error? TIA! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need help with two similar test cases that I have written. One works and the other fails

2016-02-06 Thread boB Stepp
self.assertGreater(value_to_test, 103.0)) ? If my understanding is indeed correct, then I will leave it to you to figure out which logic operator ("and" or "or") makes sense here! ~(:>)) -- boB ___ Tutor maillist - Tuto

Re: [Tutor] Need help with two similar test cases that I have written. One works and the other fails

2016-02-06 Thread boB Stepp
On Sat, Feb 6, 2016 at 3:54 PM, boB Stepp <robertvst...@gmail.com> wrote: > On Sat, Feb 6, 2016 at 10:07 AM, Anubhav Yadav <anubhav1...@gmail.com> wrote: Just read Danny's reply after sending mine, which means that the answer to my question: > If my understanding is inde

Re: [Tutor] Code Regress

2016-02-01 Thread boB Stepp
g='gold') elif t == 60: your_label.config(bg='firebrick') . . . HTH! boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Noob: nested if-clauses

2016-01-29 Thread boB Stepp
bed window. If you go to the "Keys" tab, you can see (and edit) the key bindings IDLE uses as well as available pre-configured key binding styles. Hopefully I'm answering the question(s) you are really asking and have not gone off on a tangent! -- boB ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How do I test file operations (Such as opening, reading, writing, etc.)?

2016-01-28 Thread boB Stepp
nient, my > opinion is that it misses the forest for the trees. What I think > OOP's heart is beating is in the ability to parameterize behavior.) In response to your aside, do you have a favorite text that teaches OOP the way you feel it should be t

Re: [Tutor] How do I test file operations (Such as opening, reading, writing, etc.)?

2016-01-28 Thread boB Stepp
ue? > So for our own unit tests, now we should be able to say something like this: > > ## > def test_foobar(self): > fs = FakeFileSystem() > fs.filecontents['classifiers.txt'] = """ > something her

<    1   2   3   4   5   6   7   8   9   10   >