Re: [Tutor] Running Python 3 on Linux Mint

2019-01-14 Thread Cranky Frankie
On Sun, Jan 13, 2019 at 2:04 PM Alan Gauld via Tutor 
wrote:

> "You don't say which Mint version but assuming its 17 or
> greater then you can just use the software manager
> (or Synaptic) and install the python3 packages."
>
> Thanks so much, I'm all set now.
-- 
Frank L. "Cranky Frankie" Palmeri, Risible Riding Raconteur & Writer
"If you have a garden and a library, you have everything you need." - Cicero
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Running Python 3 on Linux Mint

2019-01-14 Thread Mats Wichmann
On 1/14/19 4:08 PM, Cranky Frankie wrote:
> On Sun, Jan 13, 2019 at 2:04 PM Alan Gauld via Tutor 
> wrote:

>> "You don't say which Mint version but assuming its 17 or
>> greater then you can just use the software manager
>> (or Synaptic) and install the python3 packages."

> Thanks so much, I'm all set now.

Given the impending end of support for Python 2 - officially less than a
year now - distros have been surprisingly slow in switching to Python 3
being the default (meaning instead of having to specially ask for
python3, you would have to specially ask for python2). So don't feel bad
that this wasn't instantly obvious... Mint follows Ubuntu, which follows
Debian (mostly) so it's not exactly the Mint folks' problem, but even
they could have chosen to be proactive if they wanted to.


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Debugging a sort error.

2019-01-14 Thread Cameron Simpson

On 14Jan2019 09:29, mhysnm1...@gmail.com  wrote:
Once again thanks for all the suggestions. It was the input data after 
all. As I am importing three sheets into python. One of the sheets had 
one less column.


Semantic nit: "fewer". "less" is for continuous values.

I've had to deal with loosely defined spreadsheets in the past year, and 
ended up with some mapping classes for reading "heading based" CSV and 
Excel sheets, where the first column contains column headings. It reads 
the rows and constructs a namedtuple class for the rows with field names 
based on the headings and then fills in the fields for each subsequent 
row.


The advantage here is that then you can access the column data by name, 
eg:


 row.description

provided the column heading remains the same. See the xl_import function 
from the cs.csvutils module:


 https://pypi.org/project/cs.csvutils/

The code is here:

 https://bitbucket.org/cameron_simpson/css/src/tip/lib/python/cs/csvutils.py

Right at the bottom of that file is an example use of xl_import() for a 
worksheet where row 1 is a title and the column names are in row 2.


On and forward to start working on text pattern exercise which I always 
have struggled with. Last language I did this in was Perl and had all 
sorts of headaches. 😊 Python seems cleaner from the reading I have 
done thus far. Lets see what challenges wait in front of me.


I used to use Perl extensively. I put off moving to Python for too long.

Cheers,
Cameron Simpson 
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor