RE: Receiving a lot of double messages.

2017-01-06 Thread Deborah Swanson
Grant Edwards wrote, on January 06, 2017 1:56 PM > > On 2017-01-05, Antoon Pardon wrote: > > > Is there something going on with the mailinglist? Because I have > > receive a lot > > of double messages. One copy is fairly normal and is part > of the discussion > > thread, the other is complete

Namedtuples: TypeError: 'str' object is not callable

2017-01-06 Thread Deborah Swanson
I'm not sure what Python is complaining about here, or why. Here's the example from the Python docs: https://docs.python.org/3/library/collections.html#collections.namedtupl e EmployeeRecord = namedtuple('EmployeeRecord', 'name, age, title, department, paygrade') import csv for emp in map(Empl

RE: Namedtuples: TypeError: 'str' object is not callable

2017-01-06 Thread Deborah Swanson
Chris Angelico wrote, on January 06, 2017 8:05 PM > To: python-list@python.org > Subject: Re: Namedtuples: TypeError: 'str' object is not callable > > > On Sat, Jan 7, 2017 at 2:46 PM, Deborah Swanson > wrote: > > And here's the Traceback in PyCharm:

RE: Namedtuples: TypeError: 'str' object is not callable

2017-01-06 Thread Deborah Swanson
Chris Angelico wrote, on January 06, 2017 9:14 PM > > On Sat, Jan 7, 2017 at 4:07 PM, Deborah Swanson > wrote: > > > > I really don't know how long it would've taken me to think of that, so > > thank you! > > I have a well-trained crystal ball :) &g

RE: Namedtuples: TypeError: 'str' object is not callable

2017-01-07 Thread Deborah Swanson
Gregory Ewing wrote, on January 07, 2017 1:13 AM > > Deborah Swanson wrote: > > File "E:/Coding projects/Pycharm/Moving/moving_numberedtuples.py", > > line 139, in moving() > > for lst in map(listings._make, csv.reader(open('E:\\Coding > > proj

Using namedtuples field names for column indices in a list of lists

2017-01-07 Thread Deborah Swanson
What I've done so far: with open('E:\\Coding projects\\Pycharm\\Moving\\Moving 2017 in.csv', 'r') as infile: ls = list(csv.reader(infile)) lst = namedtuple('lst', ls[0]) where 'ls[0]' is the header row of the csv, and it works perfectly well. 'lst' is a namedtuple instance with each of th

RE: Using namedtuples field names for column indices in a list of lists

2017-01-08 Thread Deborah Swanson
Steven D'Aprano wrote, on January 07, 2017 10:43 PM > > On Sunday 08 January 2017 16:39, Deborah Swanson wrote: > > > What I've done so far: > > > > with open('E:\\Coding projects\\Pycharm\\Moving\\Moving > 2017 in.csv', > > 'r&#

RE: Using namedtuples field names for column indices in a list of lists

2017-01-08 Thread Deborah Swanson
Peter Otten wrote, on January 08, 2017 3:01 AM > > Deborah Swanson wrote: > > > to do that is with .fget(). Believe me, I tried every > possible way to > > use instance.A or instance[1] and no way could I get ls[instance.A]. > > Sorry, no. I quite agree, I was de

RE: Using namedtuples field names for column indices in a list of lists

2017-01-08 Thread Deborah Swanson
Peter Otten wrote, on January 08, 2017 5:21 AM > > Deborah Swanson wrote: > > > Peter Otten wrote, on January 08, 2017 3:01 AM > >> > >> Deborah Swanson wrote: > >> > >> > to do that is with .fget(). Believe me, I tried every > possib

RE: Using namedtuples field names for column indices in a list of lists

2017-01-08 Thread Deborah Swanson
Paul Rudin wrote, on January 08, 2017 6:49 AM > > "Deborah Swanson" writes: > > > Peter Otten wrote, on January 08, 2017 3:01 AM > >> > >> columnA = [record.A for record in records] > > > > This is very neat. Something like a list compr

RE: Grumpy: Python to Go compiler

2017-01-08 Thread Deborah Swanson
Steven D'Aprano wrote, on January 07, 2017 11:37 PM > > Grumpy, an experimental project from Google, transpiles > Python code into Go, allowing Python programs to be compiled > and run as static binaries using the Go toolchain. > > > http://www.infoworld.com/article/3154624/application-develo

RE: Grumpy: Python to Go compiler

2017-01-08 Thread Deborah Swanson
Tim Daneliuk wrote, on January 08, 2017 4:49 PM > > On 01/08/2017 06:18 PM, Deborah Swanson wrote: > > (haha, unless > > you ask) > > C'mon, go for it ... there hasn't been a good rant here in > 4 or 5 minutes ... Oh hell. (How do I tell him I was up til 8

RE: Using namedtuples field names for column indices in a list of lists

2017-01-08 Thread Deborah Swanson
Steven D'Aprano wrote, on January 07, 2017 10:43 PM > > On Sunday 08 January 2017 16:39, Deborah Swanson wrote: > > The recommended way is with the _replace method: > > py> instance._replace(A=999) > Record(A=999, B=20, C=30) > py> instance._replace(A=999,

RE: Using namedtuples field names for column indices in a list of lists

2017-01-08 Thread Deborah Swanson
Peter Otten wrote, on January 08, 2017 5:21 AM > > Deborah Swanson wrote: > > > Peter Otten wrote, on January 08, 2017 3:01 AM > > Personally I would recommend against mixing data (an actual location) and > metadata (the column name,"Location"), but if you

RE: Using namedtuples field names for column indices in a list of lists

2017-01-08 Thread Deborah Swanson
Steven D'Aprano wrote, on January 08, 2017 7:30 PM > > On Sunday 08 January 2017 20:53, Deborah Swanson wrote: > > > Steven D'Aprano wrote, on January 07, 2017 10:43 PM > > No, I'm pretty sure that's not the case. I don't have access > to

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
Antoon Pardon wrote, on January 09, 2017 2:14 AM > > 1) I have a section that loops through the sorted data, compares two > > adjacent rows at a time, and marks one of them for deletion if the > > rows are identical. > > > > I'm using > > > > for i in range(len(records)-1): > > r1 = records[

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
Antoon Pardon wrote, on January 09, 2017 2:35 AM > If I understand correctly you want something like: > > records.sort(key = lamda rec: rec.xx) > > AKA > > from operator import attrgetter > records.sort(key = attrgetter('xx')) > > or maybe: > > records.sort(key = lambda rec:

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
Steve D'Aprano wrote, on January 09, 2017 3:40 AM > > On Mon, 9 Jan 2017 09:57 pm, Deborah Swanson wrote: > > [...] > > I think you are replying to my question about sorting a > namedtuple, in > > this case it's called 'records'. > > > &

RE: Clickable hyperlinks

2017-01-09 Thread Deborah Swanson
Rhodri James wrote, on January 09, 2017 4:28 AM > > Nope. PyCharm outputs text to the console that the console > chooses to > interpret as a link and makes clickable. As Stephen pointed > out right > back at the beginning of this thread, printing the textual > string that > is a URL could

RE: Help with this code

2017-01-09 Thread Deborah Swanson
José Manuel Suárez Sierra wrote, on January 09, 2017 5:09 AM > > Hello, I am trying to make a code wich compares between 2 or > several sequences (lists). It compares every element in a > list with another list elements. For example, if we have a > list_a=["a","b","c","d"] and list_b=["a","b"]

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
Peter Otten wrote, on January 09, 2017 6:51 AM > > Deborah Swanson wrote: > > > Even better, to get hold of all the records with the same Description > > as the current row, compare them all, mark all but the different ones > > for deletion, and then resume proce

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
Tim Chase wrote, on January 09, 2017 6:22 AM > > On 2017-01-08 22:58, Deborah Swanson wrote: > > 1) I have a section that loops through the sorted data, compares two > > adjacent rows at a time, and marks one of them for deletion if the > > rows are identical. > &

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
breamore...@gmail.com wrote, on January 09, 2017 8:32 AM > > On Monday, January 9, 2017 at 2:22:19 PM UTC, Tim Chase wrote: > > On 2017-01-08 22:58, Deborah Swanson wrote: > > > 1) I have a section that loops through the sorted data, compares two > > > adjacent ro

RE: Clickable hyperlinks

2017-01-09 Thread Deborah Swanson
Tim Chase wrote, on January 09, 2017 5:53 AM > > On 2017-01-09 05:00, Deborah Swanson wrote: > > Code does in fact have the power to control what happens > > in the console. How do you think Linux does it on their terminals with > > clickable links? Granted, the

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
Peter Otten wrote, on January 09, 2017 3:27 PM > > While stable sort is nice in this case you can just say > > key=operator.attrgetter("Description", "Date") > > Personally I'd only use sorted() once and then switch to the > sort() method. This works perfectly, thank you. As I read the docs,

RE: Clickable hyperlinks

2017-01-09 Thread Deborah Swanson
Larry Martell wrote, on January 09, 2017 4:11 PM > > On Mon, Jan 9, 2017 at 5:33 PM, Deborah Swanson > wrote: > > Ok, here is the crux of this thread's communication problem. I didn't > > ask, or particularly care for all these lectures on the technology of >

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
Erik wrote, on January 09, 2017 5:47 PM > As people keep saying, the object you have called 'records' > is a *list* > of namedtuple objects. It is not a namedtuple. > > IIRC, you create it using a list comprehension which creates the > records. A list comprehension always creates a list. Well

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
MRAB wrote, on January 09, 2017 7:37 PM > > On 2017-01-10 03:02, Deborah Swanson wrote: > > Erik wrote, on January 09, 2017 5:47 PM > >> As people keep saying, the object you have called 'records' is a > >> *list* of namedtuple objects. It is not a namedtu

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
Ethan Furman wrote, on January 09, 2017 8:01 PM > > On 01/09/2017 07:02 PM, Deborah Swanson wrote: > > Erik wrote, on January 09, 2017 5:47 PM > > >> As people keep saying, the object you have called 'records' is a > >> *list* of namedtuple objects.

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
Erik wrote, on January 09, 2017 8:06 PM > > On 10/01/17 03:02, Deborah Swanson wrote: > > Erik wrote, on January 09, 2017 5:47 PM > >> IIRC, you create it using a list comprehension which creates the > >> records. A list comprehension always creates a list. > &

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
Ethan Furman wrote, on January 09, 2017 10:06 PM > > On 01/09/2017 08:51 PM, Deborah Swanson wrote: > > Ethan Furman wrote, on January 09, 2017 8:01 PM > > >> As I said earlier, I admire your persistence -- but take some time > >> and learn the basic vocabulary

RE: Using namedtuples field names for column indices in a list of lists

2017-01-11 Thread Deborah Swanson
Steven D'Aprano wrote, on January 10, 2017 6:19 PM > > On Tuesday 10 January 2017 18:14, Deborah Swanson wrote: > > > I'm guessing that you (and those who see things like you do) might > > not be used to working with quick learners who make mistakes at > &

RE: Using namedtuples field names for column indices in a list of lists

2017-01-12 Thread Deborah Swanson
Antoon Pardon wrote, on January 12, 2017 12:49 AM > > Op 11-01-17 om 23:57 schreef Deborah Swanson: > > > >> What are we supposed to do when somebody asks a question based on an > >> obvious mistake? Assume that they're a quick learner who has probably > &

RE: Must target be only one bit one such as 0001, 0010, 0100, 1000 In supervised neural learning f(w*p+b) with perceptron rule w = w + e for linear case?

2017-01-20 Thread Deborah Swanson
Ho Yeung Lee wrote, on January 19, 2017 12:05 AM > > Must target be only one bit one such as 0001,0010,0100,1000 > In supervised neural learning f(w*p+b) with perceptron rule w > = w + e for linear case? > > with neural network design > > does it means that can not use two or more one as targe

RE: What are your opinions on .NET Core vs Python?

2017-01-29 Thread Deborah Swanson
Juan C. wrote, on Saturday, January 28, 2017 7:07 PM > > As you guys might know, .NET Core is up and running, > promising a "cross-platform, unified, fast, lightweight, > modern and open source experience" (source: .NET Core > official site). What do you guys think about it? Do you think > it

RE: What are your opinions on .NET Core vs Python?

2017-01-29 Thread Deborah Swanson
Joseph L. Casale wrote, on January 29, 2017 1:14 PM > > > .NET is a library that can be used from many languages, including > > Python. > > No. > > .NET Core (what the OP asked about which is not .NET) is a > cross-platform framework. Obviously Python and .NET differ in > runtime semantics wi

RE: GeneratorExit masks StopIteration?

2017-01-29 Thread Deborah Swanson
inyeol@gmail.com wrote, on January 29, 2017 9:24 PM > > Does generator.close() prevent raising StopIteration? > > I'm trying to get the return value from coroutine after > terminating it. Here is simple test code: > > $ python3 > Python 3.6.0 (default, Dec 23 2016, 12:50:55) > [GCC 4.2.1

RE: Overriding True and False ?

2017-01-29 Thread Deborah Swanson
Irv Kalb wrote, on Sunday, January 29, 2017 9:04 PM > > I teach intro to programming using Python. In my first > assignment, students are asked to assign variables of > different types and print out the values. > > One student (who really did not understand Booleans) turned > in the followi

RE: Python: How do I resolve oauth2client.client.ApplicationDefaultCredentialsError: The Application Default Credentials are not available?

2017-02-04 Thread Deborah Swanson
david.am...@digital.beis.gov.uk wrote, on Saturday, February 04, 2017 3:39 PM > > Hello All, > > I'm a newbie to python programming - got into it > predominately for the purposes of machine learning and data > mining and even though I've committed several weeks to > learning the scripting lan

RE: Python: How do I resolve oauth2client.client.ApplicationDefaultCredentialsError: The Application Default Credentials are not available?

2017-02-05 Thread Deborah Swanson
ng the credentials. In the python script (link in the > above line), you could only add the API Key, which I obtained > and provided - but the script won't run. > > > I look forward to hearing back from you. > > > Regards, > David > > > On 5 Febru

RE: Python: How do I resolve oauth2client.client.ApplicationDefaultCredentialsError: The Application Default Credentials are not available?

2017-02-05 Thread Deborah Swanson
discovery, cache) File "/Users/*path*/anaconda/lib/python3.5/site-packages/googleapiclient/disc overy.py", line 270, in _retrieve_discovery_doc resp, content = http.request(actual_url) AttributeError: 'str' object has no attribute 'request' On 5 February 2017 at

RE: Python: How do I resolve oauth2client.client.ApplicationDefaultCredentialsError: The Application Default Credentials are not available?

2017-02-05 Thread Deborah Swanson
MRAB wrote, on February 05, 2017 4:34 PM > > On 2017-02-06 00:08, Deborah Swanson wrote: > > Hi David, > > > > Well, I really don't know the first thing about Macs, but it looks > > like you got the download and environment variable right, at least

RE: How to add months to a date (datetime object)?

2017-02-06 Thread Deborah Swanson
bajimicb...@gmail.com wrote, on February 02, 2017 2:44 AM > > for start of month to the beginning of next month > > from datetime import timedelta > from dateutil.relativedelta import relativedelta > > end_date = start_date + relativedelta(months=delta_period) + > timedelta(days=-delta_period)

RE: Get Result based on the Top value

2017-02-06 Thread Deborah Swanson
Meeran Rizvi wrote, on February 03, 2017 4:05 AM > > Hello guys, > Here i am creating a GUI which will act as a search engine. > When you search for a data in search box it will fetch the > results from the very first page in browser and it is > displayed in a Text widget When the TOP value is

RE: How to add months to a date (datetime object)?

2017-02-06 Thread Deborah Swanson
MRAB wrote,on February 06, 2017 2:17 PM > > On 2017-02-06 21:54, John Gordon wrote: > > In "Deborah > > Swanson" writes: > > > >> bajimicb...@gmail.com wrote, on February 02, 2017 2:44 AM > >> > > >> > for start of mont

RE: Coding issue with XML for word document

2017-02-06 Thread Deborah Swanson
I don't see any Python in your code. The python.org list isn't generally familiar with Microsoft proprietary code, which is often quite different from other versions. Try asking this question in Microsoft's Office/Word Document forums. Good luck! accessnew...@gmail.com wrote, on February 06, 2017

RE: Coding issue with XML for word document

2017-02-07 Thread Deborah Swanson
17 9:52 AM > To: python-list@python.org > Subject: Re: Coding issue with XML for word document > > > From: "Deborah Swanson" > > I don't see any Python in your code. The python.org list > isn't generally familiar with Microsoft proprietary code,

RE: gmail api

2017-02-08 Thread Deborah Swanson
Kelvid Pang wrote, on February 06, 2017 10:22 PM > > hi, > > I am trying to gmail api with reference to this URL: > https://developers.google.com/gmail/api/quickstart/python > > > But I couldn't find the > 'gmail-python-quickstart.json' file. Any one can help? thanks. You likely won't have a

Python application launcher (for Python code)

2017-02-19 Thread Deborah Swanson
I could probably write this myself, but I'm wondering if this hasn't already been done many times. Anyone have some git links or other places to download from? -- https://mail.python.org/mailman/listinfo/python-list

RE: Python application launcher (for Python code)

2017-02-20 Thread Deborah Swanson
Ben Finney wrote, on February 19, 2017 11:27 PM > > "Deborah Swanson" writes: > > > I could probably write this myself, but I'm wondering if this hasn't > > already been done many times. > > Can you describe what you are looking for, in enough

RE: Python application launcher (for Python code)

2017-02-20 Thread Deborah Swanson
I should also say that right now I'm using Windows XP, but hope very soon to have Linux again. Ideally, this launcher would work in both. I wrote, on February 20, 2017 7:44 AM > > Ben Finney wrote, on February 19, 2017 11:27 PM > > > > "Deborah Swanson" wr

RE: Python application launcher (for Python code)

2017-02-20 Thread Deborah Swanson
Grant Edwards wrote, on February 20, 2017 7:37 AM > > On 2017-02-20, Deborah Swanson wrote: > > > I could probably write this myself, but I'm wondering if > this hasn't > > already been done many times. > > Yes, it has. > > > Anyone hav

RE: Python application launcher (for Python code)

2017-02-20 Thread Deborah Swanson
Kevin Walzer wrote, on February 20, 2017 1:15 PM > > On 2/19/17 10:01 PM, Deborah Swanson wrote: > > I could probably write this myself, but I'm wondering if > this hasn't > > already been done many times. Anyone have some git links or other > > places to

RE: Python application launcher (for Python code)

2017-02-20 Thread Deborah Swanson
Steve D'Aprano wrote, on February 20, 2017 4:53 PM > > On Tue, 21 Feb 2017 04:04 am, Deborah Swanson wrote: > > > That's a good idea, you can do just about anything from a shell, and I > > read that Linus Torvalds never uses anything except the shell. > [...]

RE: Python application launcher (for Python code)

2017-02-20 Thread Deborah Swanson
Ben Finney wrote, on February 20, 2017 5:50 PM > > "Deborah Swanson" writes: > > > Basically, I now have quite a few Python programs I use frequently, > > and as time goes on my collection and uses of it will grow. Right now > > I just want a way to select

RE: Python application launcher (for Python code)

2017-02-20 Thread Deborah Swanson
Simon Ward wroe, on February 20, 2017 4:36 PM > > On 20 February 2017 22:56:31 GMT+00:00, Deborah Swanson > wrote: > > Basically, I now have quite a few Python programs I use frequently, > > and as time goes on my collection and uses of it will grow. Right now > >

RE: Python application launcher (for Python code)

2017-02-20 Thread Deborah Swanson
Steve D'Aprano wrote, on February 20, 2017 5:25 PM > > On Tue, 21 Feb 2017 02:44 am, Deborah Swanson wrote: > > [...] > > Basically, I now have quite a few Python programs I use frequently, > > and as time goes on my collection and uses of it will grow. > Rig

RE: Python application launcher (for Python code)

2017-02-21 Thread Deborah Swanson
Dennis Lee Bieber wrote, on February 21, 2017 4:19 AM > > On Mon, 20 Feb 2017 18:16:14 -0800, "Deborah Swanson" > declaimed the following: > > > >Yes, I've used Powershell, a couple decades ago, but it would be a > > Uhm... PowerShell 1.0 onl

RE: Python application launcher (for Python code)

2017-02-21 Thread Deborah Swanson
BartC wrote, on February 21, 2017 5:52 AM > > On 20/02/2017 15:44, Deborah Swanson wrote: > > Ben Finney wrote, on February 19, 2017 11:27 PM > >> > >> "Deborah Swanson" writes: > >> > >>> I could probably write this myself, but I&#

RE: Python application launcher (for Python code)

2017-02-21 Thread Deborah Swanson
Chris Angelico wrote, on February 21, 2017 7:30 AM > > On Wed, Feb 22, 2017 at 2:16 AM, Deborah Swanson > wrote: > > Really? We used software called Powershell a couple decades ago in > > the 90s, as an improvement on the DOS box. I didn't like it much and I >

RE: Python application launcher (for Python code)

2017-02-21 Thread Deborah Swanson
Jim wrote, on February 21, 2017 9:51 AM > > On 02/21/2017 09:43 AM, Deborah Swanson wrote: > > I like Linux for this job, as it has a number of capabilities that > > Windows doesn't have, and I was looking for an improvement on what I > > can do in Windows. If y

RE: Python application launcher (for Python code)

2017-02-21 Thread Deborah Swanson
Grant Edwards wrote, on February 21, 2017 11:21 AM > > On 2017-02-21, Rob Gaddi wrote: > > On 02/20/2017 06:16 PM, Deborah Swanson wrote: > > > > > [snip lots about using Windows but rather be > > > using Linux but not wanting to have to spend lots

RE: Python application launcher (for Python code)

2017-02-21 Thread Deborah Swanson
Chris Warrick wrote, on February 21, 2017 11:26 AM > > On 21 February 2017 at 20:21, Grant Edwards > wrote: > > On 2017-02-21, Rob Gaddi wrote: > >> On 02/20/2017 06:16 PM, Deborah Swanson wrote: > >> > >> > [snip lots about using Windows but ra

RE: Python application launcher (for Python code)

2017-02-21 Thread Deborah Swanson
I wrote, on February 21, 2017 12:12 PM > > Grant Edwards wrote, on February 21, 2017 11:21 AM > > NB: I haven't used any of these lately... > > > http://unxutils.sourceforge.net/ > http://www.mingw.org/ (look for msys) > https://gist.github.com/evanwill/0207876c3243bbb6863e65ec5dc3f05

RE: Python application launcher (for Python code)

2017-02-21 Thread Deborah Swanson
Ethan Furman wrote, on February 21, 2017 1:13 PM > > On 02/21/2017 11:59 AM, Deborah Swanson wrote: > > > I think I'll have a go with Cooperative Linux first > > It certainly looks interesting, but doesn't seem to have any > activity since late 2014. > >

RE: Python application launcher (for Python code)

2017-02-22 Thread Deborah Swanson
Grant Edwards wrote, on February 22, 2017 7:52 AM > > On 2017-02-21, Chris Warrick wrote: > > > Git Bash, or basically msys, is pretty reasonable. But if you are on > > Windows 10, you might like the built-in Windows Subsystem for Linux > > (aka Bash on Ubuntu on Windows) more - it's real Linu

RE: Python application launcher (for Python code)

2017-02-22 Thread Deborah Swanson
Dennis Lee Bieber wrote, on February 22, 2017 6:48 PM > > On Wed, 22 Feb 2017 10:50:18 -0800, "Deborah Swanson" > declaimed the following: > > > >first, and be able to use a running C version to check my Python > >version against. I couldn't afford

Namedtuples problem

2017-02-23 Thread Deborah Swanson
This is how the list of namedtuples is originally created from a csv: infile = open("E:\\Coding projects\\Pycharm\\Moving\\Moving 2017 in - test.csv") rows = csv.reader(infile)fieldnames = next(rows) Record = namedtuple("Record", fieldnames) records = [Record._make(fieldnames)] records.extend(R

RE: Namedtuples problem

2017-02-23 Thread Deborah Swanson
Thanks all of you for replying. I'm going to have to study your responses a bit before I can respond. I wrote this code the way I did because I was getting errors that I stopped getting with these fixes and I got the correct results from this code, up until the last line. All of you introduced con

RE: Namedtuples problem

2017-02-23 Thread Deborah Swanson
Peter Otten wrote, on February 23, 2017 2:34 AM > > Deborah Swanson wrote: > > > > Can anyone see why I'm getting this Index error? and how to fix it? > > I'm not completely sure I can follow you, but you seem to be > mixing two problems > > (1) sp

RE: Namedtuples problem

2017-02-23 Thread Deborah Swanson
> -Original Message- > From: Erik [mailto:pyt...@lucidity.plus.com] > Sent: Thursday, February 23, 2017 2:09 AM > To: pyt...@deborahswanson.net; python-list@python.org > Subject: Re: Namedtuples problem > > > Hi, > > On 23/02/17 09:38, Deborah

RE: Namedtuples problem

2017-02-23 Thread Deborah Swanson
MRAB wrote, on Thursday, February 23, 2017 4:06 PM > > On 2017-02-23 23:00, Deborah Swanson wrote: > > > > > >> -Original Message- > >> From: Erik [mailto:pyt...@lucidity.plus.com] > >> Sent: Thursday, February 23, 2017 2:09 AM > >>

RE: Namedtuples problem

2017-02-23 Thread Deborah Swanson
Ben Bacarisse wrote, on February 23, 2017 4:24 PM > > "Deborah Swanson" writes: > > >> -Original Message- > >> From: Erik [mailto:pyt...@lucidity.plus.com] > >> Sent: Thursday, February 23, 2017 2:09 AM > >> To: pyt...@debo

RE: Namedtuples problem

2017-02-23 Thread Deborah Swanson
Irv Kalb wrote, on February 23, 2017 3:51 PM > > > On Feb 23, 2017, at 3:00 PM, Deborah Swanson > > <mailto:pyt...@deborahswanson.net>> wrote: > > > > The weirdness is that > > > > group[0][4] > > > > gets the right answer, but >

RE: Python application launcher (for Python code)

2017-02-23 Thread Deborah Swanson
Cholo Lennon wrote, on February 23, 2017 7:58 AM > > On 02/20/2017 07:56 PM, Deborah Swanson wrote: > > Basically, I now have quite a few Python programs I use frequently, > > and as time goes on my collection and uses of it will grow. > Right now > > I just want a

RE: Python application launcher (for Python code)

2017-02-23 Thread Deborah Swanson
Michael Torrie wrote, on February 23, 2017 7:43 AM > > On 2017-02-22 09:49 PM, Deborah Swanson wrote: > > Didn't even look. Visual Studio has always been pricey, and it never > > occurred to me that they might have a free or cheap version now. > > You can get the

RE: Namedtuples problem

2017-02-23 Thread Deborah Swanson
Erik wrote, on February 23, 2017 4:03 PM > > On 23/02/17 23:00, Deborah Swanson wrote: > >> It looks to me like you are indexing into a single-element > list that > >> you are creating using the literal list syntax in the middle of > >> the expression. > &

RE: Namedtuples problem

2017-02-23 Thread Deborah Swanson
Gregory Ewing wrote, on February 23, 2017 9:07 PM > > Deborah Swanson wrote: > > I've run into this kind of problem with namedtuples before, > trying to > > access field values with variable names, like: > > > > label = 'Location' > > recor

RE: Python application launcher (for Python code)

2017-02-23 Thread Deborah Swanson
Gregory Ewing wrote, on February 23, 2017 9:13 PM > > Deborah Swanson wrote: > > As for it phoning home... Wonder what value they think this has, other > > than giving them a nosecount of how many active copies there are at > > any given time. > > It gives them

RE: Python application launcher (for Python code)

2017-02-24 Thread Deborah Swanson
Gregory Ewing wrote, on February 24, 2017 9:09 PM > > Deborah Swanson wrote: > > Well, they won't kill mine, not if I have my VPN on while I'm using > > it. > > How will a VPN help? If it needs to phone home and perform a > secret handshake before it will

RE: Python application launcher (for Python code)

2017-02-24 Thread Deborah Swanson
Chris Angelico wrote, February 24, 2017 10:04 PM > > On Sat, Feb 25, 2017 at 4:08 PM, Gregory Ewing > wrote: > > Deborah Swanson wrote: > >> > >> Well, they won't kill mine, not if I have my VPN on while > I'm using > >> it. > &g

RE: Python application launcher (for Python code)

2017-02-25 Thread Deborah Swanson
Dennis Lee Bieber wrote, on February 25, 2017 4:50 AM > > On Fri, 24 Feb 2017 22:26:15 -0800, "Deborah Swanson" > declaimed the following: > > > > >Well rats. Skull duggery on the net is a lot more sophisticated than > >when I saw it last (15 years ag

RE: Python application launcher (for Python code)

2017-02-25 Thread Deborah Swanson
cher (for Python code) > > > On Sat, 25 Feb 2017 10:03:45 -0800, "Deborah Swanson" > declaimed the following: > > > >Didn't think of that one either, but it's easy to export the > involved > >keys right after installing and restore them before eac

RE: Python application launcher (for Python code)

2017-02-25 Thread Deborah Swanson
Wanderer wrote, on February 25, 2017 2:07 PM > > If you want to turn internet access on and off more easily in > Windows 7, go to Control Panel\ Network and Sharing Center > and in the left hand menu click on Change Adapter Settings. > Create a shortcut to Local Area Connect and put it on your

RE: Python application launcher (for Python code)

2017-02-25 Thread Deborah Swanson
breamore...@gmail.com wrote, on February 25, 2017 4:49 AM > > On Friday, February 24, 2017 at 1:54:39 AM UTC, Deborah Swanson wrote: > > Michael Torrie wrote, on February 23, 2017 7:43 AM > > > > > > On 2017-02-22 09:49 PM, Deborah Swanson wrote: > > >

RE: Exposing all methods of a class

2017-02-28 Thread Deborah Swanson
Ethan Furman wrote, on February 28, 2017 8:23 AM > > On 02/26/2017 12:15 PM, Pete Dowdell wrote: > > > I was wondering if anyone has encountered an editor that > could display > > a class with all inherited methods included in the editor's view of > > the class code. > > I do not know of one,

RE: Dynamically replacing an objects __class__; is it safe?

2017-03-15 Thread Deborah Swanson
MRAB wrote, on Wednesday, March 15, 2017 3:19 PM > > On 2017-03-15 22:03, Gregory Ewing wrote: > > Steve D'Aprano wrote: > >> You probably can't make a whale fly just by changing the class to > >> bird. It will need wings, and feathers, at the very least. > > > > Some things succeed in flying wit

RE: Dynamically replacing an objects __class__; is it safe?

2017-03-16 Thread Deborah Swanson
Steve D'Aprano wrote,on March 16, 2017 5:07 AM > > On Thu, 16 Mar 2017 09:03 am, Gregory Ewing wrote: > > > Steve D'Aprano wrote: > >> You probably can't make a whale fly just by changing the class to > >> bird. It will need wings, and feathers, at the very least. > > > > Some things succeed in

RE: syntax error in first-time user script

2017-03-25 Thread Deborah Swanson
john polo wrote, on March 25, 2017 2:45 PM > > I had a misconception of how the Python interpreter works. If > I have a > script, call it example.py, in order to run it, I shouldn't be in the > interpreter? In other words, I should be at the Windows > command prompt, > for example > > C:/tes

RE: should i kill these two process with python?

2017-03-25 Thread Deborah Swanson
Chris Angelico wrote, on Saturday, March 25, 2017 1:53 AM > > On Sat, Mar 25, 2017 at 7:41 PM, Ho Yeung Lee > wrote: > > TCP127.0.0.1:1663 127.0.0.1:28091 > ESTABLISHED 9900 > > TCP127.0.0.1:28091127.0.0.1:1663 > ESTABLISHED 9532 > > > > above

RE: why and how to run forever and debug when error in for proc in psutil.process_iter()?

2017-03-25 Thread Deborah Swanson
Someone here can probably help you, but they'll need your Python version, operating system, and full traceback. They get tired of saying so. In this case, the full traceback is needed to see what went wrong and when (after which statements). Ho Yeung Lee wrote, on Saturday, March 25, 2017 1:38

RE: Using/compiling pyuno with Python 3.6

2017-03-27 Thread Deborah Swanson
filtered wrote, on Monday, March 27, 2017 4:41 AM > > I am running CentOS 7.1 with LibreOffice 5.0.6.2. > > I have installed the official pyuno package from CentOS. > > I installed Python 3.6.1 from the sources and now I am trying > to import pyuno which fails with > > aj...@dev.zopyx.com:~/sr

RE: Using/compiling pyuno with Python 3.6

2017-03-27 Thread Deborah Swanson
filtered wrote, on March 27, 2017 9:09 PM > > Sorry but all your answers are pointless. > > I clearly asked about compiling PyUno MYSELF with a > self-compiled Python 3.6.1 installation. Is this so hard to > understand? Why do you give unrelated comments to a clear > questions? Sometimes it is

RE: Developing a Python JIT and have trouble

2017-03-31 Thread Deborah Swanson
Yuheng Zou wrote, on Friday, March 31, 2017 6:52 AM > > I am building a Python JIT, so I want to change the > interp->eval_frame to my own function. > > I built a C++ library which contains EvalFrame function, and > then use dlopen and dlsym to use it. It looks like this: > > extern "C" PyObje

Two variable dictionary comprehension

2017-04-02 Thread Deborah Swanson
It seems like this should be easy to rewrite as a dict comprehension: records_idx = {} for idx, label in enumerate(records[0]): records_idx[label] = idx Maybe I'm having another "dumb day", or maybe I've just been struggling with this (larger) problem for too long, but eveything I

RE: Two variable dictionary comprehension

2017-04-02 Thread Deborah Swanson
Chris Angelico wrote, on April 02, 2017 6:37 PM > > On Mon, Apr 3, 2017 at 11:26 AM, Deborah Swanson > wrote: > > It seems like this should be easy to rewrite as a dict > comprehension: > > > > records_idx = {} > > for idx, label in enumerate(record

RE: Two variable dictionary comprehension

2017-04-02 Thread Deborah Swanson
Ben Finney wrote, on April 02, 2017 6:38 PM > > "Deborah Swanson" writes: > > > It seems like this should be easy to rewrite as a dict > comprehension: > > > > records_idx = {} > > for idx, label in enumerate(records[0]): > >

RE: Two variable dictionary comprehension

2017-04-02 Thread Deborah Swanson
Ben Finney wrote. on April 02, 2017 7:41 PM > > "Deborah Swanson" writes: > > > Chris Angelico wrote, on April 02, 2017 6:37 PM > > > > > > On Mon, Apr 3, 2017 at 11:26 AM, Deborah Swanson > > > > Maybe I'm having another "dum

RE: Two variable dictionary comprehension

2017-04-03 Thread Deborah Swanson
Gregory Ewing wrote, on April 02, 2017 11:35 PM > > Deborah Swanson wrote: > > > Oh, come on. That's a fairly obscure citation in the docs, one that > > would take a good deal of experience and time reading > through them to > > know was there, > > Yo

RE: Two variable dictionary comprehension

2017-04-03 Thread Deborah Swanson
Dennis Lee Bieber wrote, on April 03, 2017 9:35 AM > > On Mon, 3 Apr 2017 07:30:40 -0700, "Deborah Swanson" > declaimed the following: > > > > >Clearly there's more to be found in nooks, crannies and > byways in the > >docs than you'll get

<    1   2   3   >