[Tutor] Is this the preferred way to change terminal screen color using curses?

2019-03-02 Thread boB Stepp
I wanted to be able to change the background screen color of a terminal window using curses. My weak Google-Foo did not turn up a clear example of how to do this despite much searching. The two _obvious_curses methods to attempt this seemed to be window.bkgdset(ch, attr) to initially set a window

Re: [Tutor] Is this the preferred way to change terminal screen color using curses?

2019-03-02 Thread boB Stepp
On Sat, Mar 2, 2019 at 4:28 PM Cameron Simpson wrote: > Is the painting of the screen with spaces actually required? I would > have thought not (again, untested). The main window (stdscr) should > start filled with spaces. I had read this along the way, but had forgotten it. > [Reads more close

Re: [Tutor] After virtualenv, how to use ide

2019-03-23 Thread boB Stepp
On Sat, Mar 23, 2019 at 12:50 PM anand warik wrote: > > I had installed Python on Ubuntu 14.04 using Anaconda package long back > after failing to install independently for a long time. I was quietly using > it's packaged ide Spyder and had no troubles, in fact I love spider more > then atom. I re

[Tutor] How to avoid "UnboundLocalError: local variable 'goal_year' referenced before assignment"?

2019-03-23 Thread boB Stepp
I have just written a small program earlier today to allow the user (me) to enter a date by which I wish to finish reading a book (= massive programming-related book) and calculate how many pages I need to read each day (starting today) in order to finish the book by the target date. Looking over

Re: [Tutor] How to avoid "UnboundLocalError: local variable 'goal_year' referenced before assignment"?

2019-03-23 Thread boB Stepp
n Sun, Mar 24, 2019 at 12:22 AM Cameron Simpson wrote: > > Discussion below your post here, since I feel I should quote it all: > > On 23Mar2019 22:15, boB Stepp wrote: > >Traceback (most recent call last): > > File "pages_per_day.py", line 250, in > >s

[Tutor] [OT] Problem with auto-complete package installation in Atom [Was: Re: After virtualenv, how to use ide]

2019-03-24 Thread boB Stepp
On Sun, Mar 24, 2019 at 2:45 AM anand warik wrote: > > I gave up on Spyder and shifted to Atom, which seems easy to port to > different versions of python created by virtual environments. But now facing > a new problem. I have installed a package named autocomplete-python on atom > but it doesn

Re: [Tutor] How to avoid "UnboundLocalError: local variable 'goal_year' referenced before assignment"?

2019-03-24 Thread boB Stepp
Oh, happy day! eval() has been expunged from my program!! I will now continue from where I left off earlier. On Sun, Mar 24, 2019 at 12:22 AM Cameron Simpson wrote: > > On 23Mar2019 22:15, boB Stepp wrote: > > The lambda is just a single line function definition, and doesn't

Re: [Tutor] [OT] Problem with auto-complete package installation in Atom [Was: Re: After virtualenv, how to use ide]

2019-03-24 Thread boB Stepp
On Sun, Mar 24, 2019 at 8:51 PM anand warik wrote: > > I am sorry for not sticking to my original question but editors are > complicated in itself. So many costimization instruction to read through just > to finally execute a simple .Py file which can be just executed using the > terminal. > >

[Tutor] Questions about the deprecation of standard library modules

2019-03-30 Thread boB Stepp
While reading in chapter 3 of "Learning Python, 5th ed." by Mark Lutz, I was playing around with reload() in the imp module. In the interpreter I did a "from imp import reload" and then help(reload). This had a warning that it was deprecated. After a search online I found that the entire imp libr

Re: [Tutor] Off-Topic: Tutor group specific to Java

2019-04-19 Thread boB Stepp
On Wed, Apr 17, 2019 at 11:09 AM Karthik Bhat wrote: > > Hello Guys, > This is kind of off-topic, but I would really appreciate it if > anyone could provide me with a tutor mailing list/group specific to Java. > I am a beginner, and it would be really helpful for me. Try Java Ranch: http

Re: [Tutor] Collating date data from a csv file

2019-05-08 Thread boB Stepp
On Wed, May 8, 2019 at 10:09 PM Cameron Simpson wrote: > > A defaultdict is a dict which magicly makes missing elements when they > get access, using a factory function you supply. Here we're using "int" > as that factory, as int() returns zero. Is int() guaranteed to always return zero as Python

Re: [Tutor] Collating date data from a csv file

2019-05-08 Thread boB Stepp
On Wed, May 8, 2019 at 10:29 PM boB Stepp wrote: > > On Wed, May 8, 2019 at 10:09 PM Cameron Simpson wrote: > > > > A defaultdict is a dict which magicly makes missing elements when they > > get access, using a factory function you supply. Here we're using &quo

Re: [Tutor] Local variable look up outside the function and method

2019-05-12 Thread boB Stepp
On Sun, May 12, 2019 at 8:05 AM Arup Rakshit wrote: > > In the following the function, x is reachable outside the scope of foo > function. > > In [1]: x = 10 > > In [2]: def foo(): >...: return x >...: > > In [3]: print(foo()) > 10 To what the others have said I wish to point out tha

Re: [Tutor] Looking for some direction

2019-05-12 Thread boB Stepp
On Sun, May 12, 2019 at 1:05 PM David L Neil wrote: > I'm using Gnome Terminal under Fedora (Linux). This allows multiple > terminals in tabs (and thus Ctrl-Tab rapid-switching). However, it > irritates me that whilst I can set "profiles" for particular purposes; > there does not seem to be a way

Re: [Tutor] Looking for some direction

2019-05-12 Thread boB Stepp
On Sun, May 12, 2019 at 5:19 PM boB Stepp wrote: > > On Sun, May 12, 2019 at 1:05 PM David L Neil > wrote: > > > I'm using Gnome Terminal under Fedora (Linux). This allows multiple > > terminals in tabs (and thus Ctrl-Tab rapid-switching). However, it > >

Re: [Tutor] Query about python recipies for practices

2019-05-27 Thread boB Stepp
On Sun, May 19, 2019 at 12:55 PM bijaya dalei <2212bij...@gmail.com> wrote: > > Hii, Good morning. I am a new user of python programming language. I have a > small query on "where to get python recepies for practices".plz > suggest.Thanks. It is not very clear to me what you are asking for, which

Re: [Tutor] Python 3.7 Grids

2019-06-29 Thread boB Stepp
On Sat, Jun 29, 2019 at 2:02 AM David Merrick wrote: > > Hi Looking for a way to use the determine the position of a card in a grid > using the mouse click event in Python. Code is attached. There are no > viruses. > > Unfortunately using Tinkter grids / frames can't determine between the two > de

[Tutor] Unit testing: Just the API or internal use only methods, too?

2019-07-16 Thread boB Stepp
Peter Otten, while responding to one of my questions in the past, mentioned something in passing that apparently has been mulling around in the back of my head. I don't recall his exact words, but he essentially said that I should be testing the public interface to my classes, but not the methods

[Tutor] Which is better in principle: to store (in file) calculated data or to re-calculate it upon restarting program?

2019-07-30 Thread boB Stepp
I have been using various iterations of a solitaire scorekeeper program to explore different programming thoughts. In my latest musings I am wondering about -- in general -- whether it is best to store calculated data values in a file and reload these values, or whether to recalculate such data up

Re: [Tutor] Which is better in principle: to store (in file) calculated data or to re-calculate it upon restarting program?

2019-07-30 Thread boB Stepp
On Tue, Jul 30, 2019 at 12:05 PM Zachary Ware wrote: > > On Tue, Jul 30, 2019 at 11:24 AM boB Stepp wrote: > > In this trivial example I cannot imagine there is any realistic > > difference between the two approaches, but I am trying to generalize > > my thoughts f

Re: [Tutor] Which is better in principle: to store (in file) calculated data or to re-calculate it upon restarting program?

2019-07-30 Thread boB Stepp
On Tue, Jul 30, 2019 at 7:05 PM Alan Gauld via Tutor wrote: > > On 30/07/2019 18:20, boB Stepp wrote: > > > What is the likelihood of file storage corruption? I have a vague > > sense that in earlier days of computing this was more likely to > > happen, but nowadays?

Re: [Tutor] Which is better in principle: to store (in file) calculated data or to re-calculate it upon restarting program?

2019-07-30 Thread boB Stepp
On Tue, Jul 30, 2019 at 7:26 PM Mats Wichmann wrote: > > On 7/30/19 5:58 PM, Alan Gauld via Tutor wrote: > > On 30/07/2019 17:21, boB Stepp wrote: > > > >> musings I am wondering about -- in general -- whether it is best to > >> store calculated data values i

<    2   3   4   5   6   7