Re: How to share class relationship representations?

2017-09-20 Thread dieter
Leam Hall writes: > On 09/19/2017 11:16 AM, Stefan Ram wrote: >> leam hall writes: >>> I'm working on designing the classes, sub-classes, and relationships in my >>> code. What is a good visual way to represent it so it can be stored in git >>> and shared on the list without large images or attac

userpath - Easily add your app to PATH on all platforms!

2017-09-20 Thread ofekmeister
https://github.com/ofek/userpath -- https://mail.python.org/mailman/listinfo/python-list

Re: Greater and less than operators [was Re: [Tutor] beginning to code]

2017-09-20 Thread Steve D'Aprano
On Thu, 21 Sep 2017 10:16 am, Rick Johnson wrote: >> You've never wanted to sort strings? How do you sort >> strings unless you have a concept of which string comes >> before the other, i.e. < operator? >> >> >>> 'xyz' < 'abc' >> False > > Interesting. But now we need to learn yet another set of

Re: errors with json.loads

2017-09-20 Thread Bill
Ned Batchelder wrote: On 9/20/17 8:22 PM, Bill wrote: Apparenty an \xa0 byte corresponds to a "non-breaking space". What sort of white space characters are allowed in a json file ( tabs and newlines?)? Just curious. These things can be looked up. From RFC 7159 (https://tools.ietf.org/htm

Re: errors with json.loads

2017-09-20 Thread Christopher Reimer
> On Sep 20, 2017, at 5:03 PM, Stefan Ram wrote: > > Dennis Lee Bieber writes: >> After removing all the \xa0 bytes >> and trying to decode it I get... > > I did the same here, before I read your post. > I got the same results, but did not post them. > > Someone has posted programs with \xA

Re: errors with json.loads

2017-09-20 Thread Ned Batchelder
On 9/20/17 8:22 PM, Bill wrote: Apparenty an \xa0 byte corresponds to a "non-breaking space". What sort of white space characters are allowed in a json file ( tabs and newlines?)?  Just curious. These things can be looked up.  From RFC 7159 (https://tools.ietf.org/html/rfc7159): Insign

Re: errors with json.loads

2017-09-20 Thread Bill
Stefan Ram wrote: Dennis Lee Bieber writes: After removing all the \xa0 bytes and trying to decode it I get... Apparenty an \xa0 byte corresponds to a "non-breaking space". What sort of white space characters are allowed in a json file ( tabs and newlines?)? Just curious. Bill I did

Re: Greater and less than operators [was Re: [Tutor] beginning to code]

2017-09-20 Thread Chris Angelico
On Thu, Sep 21, 2017 at 10:16 AM, Rick Johnson wrote: >> >>> 'xyz' < 'abc' >> False > > Interesting. But now we need to learn yet another set of > arbitrary rules. Consider this: > > >>> 'azzz' > 'zzz' > False > > Now, i'm not sure how Python decided that 'azzz' is not > greater than 'zzz'

Re: Greater and less than operators [was Re: [Tutor] beginning to code]

2017-09-20 Thread Rick Johnson
Steven D'Aprano wrote: > Rick Johnson wrote: > > > Of course, allowing all objects to use the `==`, `!=` > > sugars makes perfect sense, but `<`, `>`, `<=`, `>=` are > > meaningless outside of numeric-ish types. > > You've never wanted to sort strings? How do you sort > strings unless you have a

Re: errors with json.loads

2017-09-20 Thread Bill
john polo wrote: Greetings, I am using IPython 6.1.0 with Python 3.6.2 on a Windows 7 machine. I am not a programmer. I am using a book called Python Data Analytics to try to learn some of Python. I am at a section for reading and writing JSON data. The example JSON file is: Listing 5-13.

Re: errors with json.loads

2017-09-20 Thread John Gordon
In john polo writes: > JSONDecodeError: Expecting ':' delimiter: line 5 column 50 (char 161) > ?json.loads says that the method is for deserializing "s", with "s" > being a string, bytes, or bytearray. > In [24]: type(text) > Out[24]: str > So "text" seems to be a string. Why does json.load

Re: errors with json.loads

2017-09-20 Thread Bill
Interesting problem, John. I have probably even less experience with json than you do, so I'm taking this as an opportunity to learn with you. Suggestions: 1. Try your example with Python 2 rather than Python 3. 2. Take your file and make it into a string literal in your program, and try cal

errors with json.loads

2017-09-20 Thread john polo
Greetings, I am using IPython 6.1.0 with Python 3.6.2 on a Windows 7 machine. I am not a programmer. I am using a book called Python Data Analytics to try to learn some of Python. I am at a section for reading and writing JSON data. The example JSON file is: Listing 5-13.  books.json [{"wri

Re: Old Man Yells At Cloud

2017-09-20 Thread Grant Edwards
On 2017-09-19, Stefan Ram wrote: > Chris Angelico writes: >>On Wed, Sep 20, 2017 at 4:59 AM, Stefan Ram wrote: >>>I don't get this. For example, the contractual payment (cost) is >>>47.21 >>>, the other party hands over >>>50.25 >>>. Now I am supposed to add /what/ to the cost? >>Start at the sm

Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread Grant Edwards
On 2017-09-20, Gregory Ewing wrote: > Grant Edwards wrote: >> Alternatively, you should design an instruction set and implement it >> using microcode and AM2900 bit-slice processors. > > AMD2900? That's cheating! You should design and build your > own logic gates. After refining the silicon to mak

Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread Grant Edwards
On 2017-09-19, Christopher Reimer wrote: > Is assembly still a thing today? Depends on what you're doing. If you're working with custom-designed boards, you often have to write some assembly for startup and interrupt stuff. If you're porting an OS kernel to a new architecture, you have to wri

Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread Ben Bacarisse
Larry Martell writes: > On Tue, Sep 19, 2017 at 12:12 PM, Rhodri James wrote: >> >> Eh, my school never 'ad an electronics class, nor a computer neither. Made >> programming a bit tricky; we 'ad to write programs on a form and send 'em >> off to next county. None of this new-fangled VHDL neith

Re: Fwd: Issues with python commands in windows powershell

2017-09-20 Thread Terry Reedy
On 9/20/2017 1:09 PM, Joey Steward wrote: -- Forwarded message -- From: Joey Steward Date: Tue, Sep 19, 2017 at 10:30 PM Subject: Issues with python commands in windows powershell To: python-list@python.org Hello, I've been having issues using basic python commands in windows

Re: Old Man Yells At Cloud

2017-09-20 Thread Ben Bacarisse
bartc writes: > Value-Added-Tax in the UK increased from 17.5% to 20%, ... When it was 17.5% you could shock people not in the know by working it out in your head since it's much simpler than it sounds: take a tenth, halve it, halve it again, and add all three. -- Ben. -- https://mail.python.

Re: Fwd: Issues with python commands in windows powershell

2017-09-20 Thread Bill
Joey Steward wrote: -- Forwarded message -- From: Joey Steward Date: Tue, Sep 19, 2017 at 10:30 PM Subject: Issues with python commands in windows powershell To: python-list@python.org Hello, I've been having issues using basic python commands in windows powershell. Did you

Fwd: Issues with python commands in windows powershell

2017-09-20 Thread Joey Steward
-- Forwarded message -- From: Joey Steward Date: Tue, Sep 19, 2017 at 10:30 PM Subject: Issues with python commands in windows powershell To: python-list@python.org Hello, I've been having issues using basic python commands in windows powershell. I'm new to programming so just g

Re: How do I check all variables returned buy the functions exists

2017-09-20 Thread Bill
Steve D'Aprano wrote: In "any(v is None for v in values)", "any" probably isn't called until its argument is (fully) known. No, its a generator expression, so it provides the values one at a time, as needed. Okay, thank you for setting me straight. I'm only about 2 weeks down this road so

Re: Old Man Yells At Cloud

2017-09-20 Thread Steve D'Aprano
On Thu, 21 Sep 2017 01:06 am, Dennis Lee Bieber wrote: > On Wed, 20 Sep 2017 10:08:18 +1000, Steve D'Aprano > declaimed the following: > >>For what its worth: from Python 3.5 (I think) onwards the error you get is >>customized: >> >>py> print 1 >> File "", line 1 >>print 1 >> ^ >>S

Re: Fw: Problems Installing Python36

2017-09-20 Thread Irmen de Jong
On 14/09/2017 05:46, Michael Torrie wrote: > On 09/12/2017 03:05 AM, Thomas Jollans wrote: >> Other people on this list: >> This isn't the first time I've someone with this issue here. It's >> probably putting off plenty of potential new users who don't make as >> much effort to find a solution. I

Fwd: Issues with python commands in windows powershell

2017-09-20 Thread Joey Steward
-- Forwarded message -- From: Joey Steward Date: Wed, Sep 20, 2017 at 10:09 AM Subject: Fwd: Issues with python commands in windows powershell To: python-list@python.org -- Forwarded message -- From: Joey Steward Date: Tue, Sep 19, 2017 at 10:30 PM Subject: Issu

Fwd: Issues with python commands in windows powershell

2017-09-20 Thread Joey Steward
-- Forwarded message -- From: Joey Steward Date: Tue, Sep 19, 2017 at 10:30 PM Subject: Issues with python commands in windows powershell To: python-list@python.org Hello, I've been having issues using basic python commands in windows powershell. I'm new to programming so just g

Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread Gene Heskett
On Wednesday 20 September 2017 10:29:08 Larry Martell wrote: > On Wed, Sep 20, 2017 at 5:09 AM, Gregory Ewing > > wrote: > > Never mind that fake assembly rubbish, learn a real assembly > > language! And hand-assemble it and toggle it into the front > > panel switches like I did! > > 1979, I was

Re: Stdlib, what's in, what's out

2017-09-20 Thread Ethan Furman
On 09/20/2017 09:24 AM, Chris Warrick wrote: On 20 September 2017 at 17:16, Dennis Lee Bieber wrote: And if wxPython had been part of the stdlib, it would have meant Python 3 would have been delayed years until wxPython had been ported -- or wxPython would have been pulled from the stdlib and

Re: Old Man Yells At Cloud

2017-09-20 Thread Thomas Jollans
On 2017-09-19 16:30, D'Arcy Cain wrote: > On 09/19/2017 06:46 AM, Larry Martell wrote: >> True story - the other day I was in a store and my total was $10.12. I > > One time I was at a cash with three or four items which were taxable. > The cashier rung each one up and hit the total button.  She t

Re: Stdlib, what's in, what's out

2017-09-20 Thread Chris Warrick
On 20 September 2017 at 17:16, Dennis Lee Bieber wrote: > On Tue, 19 Sep 2017 11:58:47 -0700 (PDT), John Ladasky > declaimed the following: > >> >>And of course I have found some other third-party packages: scipy, pandas, >>matplotlib, and PyQt5 are important for my work. I helped a student of

Re: Old Man Yells At Cloud

2017-09-20 Thread Thomas Jollans
On 2017-09-20 17:06, Dennis Lee Bieber wrote: > On Wed, 20 Sep 2017 10:08:18 +1000, Steve D'Aprano > declaimed the following: > >> For what its worth: from Python 3.5 (I think) onwards the error you get is >> customized: >> >> py> print 1 >> File "", line 1 >>print 1 >> ^ >> SyntaxE

Re: How to get Nose to run doctests from my Markdown documentation?

2017-09-20 Thread Skip Montanaro
> I didn't mean, "Can you name your Markdown files with an .rst extension," I > meant, "Can you use ReST instead of Markdown?" I wondered if maybe I was misinterpreting your question. :-) Conceptually, yes, I could use ReST. I'm just trying to go with the flow here at work. Markdown seems to be t

Re: How to get Nose to run doctests from my Markdown documentation?

2017-09-20 Thread Skip Montanaro
> Actually, I semi-lied. It seems to pick up the second of two examples, > and gets a bit confused about leading whitespace. I think I need to do > some more fiddling. Solved the whitespace issue with the +NORMALIZE_WHITESPACE flag. It turns out that it actually does run all examples in the docume

Re: Research paper "Energy Efficiency across Programming Languages: How does energy, time, and memory relate?"

2017-09-20 Thread alister via Python-list
On Wed, 20 Sep 2017 14:14:24 +0100, Paul Moore wrote: > On 20 September 2017 at 13:58, alister via Python-list > wrote: >> On Tue, 19 Sep 2017 14:40:17 -0400, leam hall wrote: >> >>> On Tue, Sep 19, 2017 at 2:37 PM, Stephan Houben < >>> stephan...@gmail.com.invalid> wrote: >>> Op 2017-09-19,

Re: How to get Nose to run doctests from my Markdown documentation?

2017-09-20 Thread Ned Batchelder
On 9/20/17 11:17 AM, Skip Montanaro wrote: There are tools for getting doctests out of .rst files. Is it an option to use .rst instead of .md? Given the existence proof of md working as an extension (see my previous follow-up), my guess is that it more-or-less supports just about any nearly-pla

Re: Old Man Yells At Cloud

2017-09-20 Thread Chris Angelico
On Thu, Sep 21, 2017 at 1:06 AM, Dennis Lee Bieber wrote: > On Wed, 20 Sep 2017 10:08:18 +1000, Steve D'Aprano > declaimed the following: > >>For what its worth: from Python 3.5 (I think) onwards the error you get is >>customized: >> >>py> print 1 >> File "", line 1 >>print 1 >> ^ >

Re: How to get Nose to run doctests from my Markdown documentation?

2017-09-20 Thread Skip Montanaro
Actually, I semi-lied. It seems to pick up the second of two examples, and gets a bit confused about leading whitespace. I think I need to do some more fiddling. S -- https://mail.python.org/mailman/listinfo/python-list

Re: How to get Nose to run doctests from my Markdown documentation?

2017-09-20 Thread Skip Montanaro
> There are tools for getting doctests out of .rst files. Is it an option to > use .rst instead of .md? Given the existence proof of md working as an extension (see my previous follow-up), my guess is that it more-or-less supports just about any nearly-plain-text format. I could use .rst, I suppo

Re: How to get Nose to run doctests from my Markdown documentation?

2017-09-20 Thread Skip Montanaro
> I routinely include doctests as a source of test cases in my nose runs, but I > want to also coax it to check the > examples in my Markdown files. Is there a way to do this? If I explicitly > give a Markdown file on the command line, > nose complains: > > Unable to load tests from file ... I b

Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread justin walters
On Wed, Sep 20, 2017 at 7:29 AM, Larry Martell wrote: > On Wed, Sep 20, 2017 at 5:09 AM, Gregory Ewing > wrote: > > > > Never mind that fake assembly rubbish, learn a real assembly > > language! And hand-assemble it and toggle it into the front > > panel switches like I did! > > 1979, I was work

Re: How to get Nose to run doctests from my Markdown documentation?

2017-09-20 Thread Ned Batchelder
On 9/20/17 10:07 AM, Skip Montanaro wrote: I routinely include doctests as a source of test cases in my nose runs, but I want to also coax it to check the examples in my Markdown files. Is there a way to do this? If I explicitly give a Markdown file on the command line, nose complains: Unable to

Re: [Tutor] beginning to code

2017-09-20 Thread Jerry Hill
On Tue, Sep 19, 2017 at 8:26 PM, Rick Johnson wrote: > In the spirit of my last comment, i was going to say: "Or if > `x` does not support rich comparisons", but alas, it seems that > _all_ objects in Python support rich comparisons, even when > it doesn't make sense to! o_O For example: > > >

Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread Larry Martell
On Wed, Sep 20, 2017 at 5:09 AM, Gregory Ewing wrote: > > Never mind that fake assembly rubbish, learn a real assembly > language! And hand-assemble it and toggle it into the front > panel switches like I did! 1979, I was working at Bausch and Lomb in Rochester NY. We had a 16 bit Data General No

How to get Nose to run doctests from my Markdown documentation?

2017-09-20 Thread Skip Montanaro
I routinely include doctests as a source of test cases in my nose runs, but I want to also coax it to check the examples in my Markdown files. Is there a way to do this? If I explicitly give a Markdown file on the command line, nose complains: Unable to load tests from file ... Am I perhaps missi

Re: How do I check all variables returned buy the functions exists

2017-09-20 Thread Steve D'Aprano
On Wed, 20 Sep 2017 10:07 pm, Steve D'Aprano wrote: > I'm not sure whether to be surprised or not. > > The first one only checks for identity, which should be really fast, while the > `is` operator tests for equality too, Oops, that's supposed to be `in`, not `is`. [...] > Ah... I see that Ro

Re: Old Man Yells At Cloud

2017-09-20 Thread Steve D'Aprano
On Wed, 20 Sep 2017 02:55 pm, Pavol Lisy wrote: > On 9/19/17, Steve D'Aprano wrote: > > [...] > >> The point is, we all make the occasional silly error. Doesn't mean we should >> cripple our functions and fill the language with special cases like the >> print >> statement to avoid such rare err

Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread Gene Heskett
On Wednesday 20 September 2017 05:09:53 Gregory Ewing wrote: > Rhodri James wrote: > > Tsk. You should have learned (a fake simplified) assembler first, > > Never mind that fake assembly rubbish, learn a real assembly > language! And hand-assemble it and toggle it into the front > panel switches

Feature extraction assignment for training machine learning classifier in python

2017-09-20 Thread mimsichka23
Hi all, I have a question concerning this task. I need to train a classifier for a list of treebank sentences and extract features POS and FORM and then train a transition-based parser algorithm? Do you have any idea how I can do that, I used CountVectorizer and MultinomialNB but i have difficul

Re: Research paper "Energy Efficiency across Programming Languages: How does energy, time, and memory relate?"

2017-09-20 Thread Paul Moore
On 20 September 2017 at 13:58, alister via Python-list wrote: > On Tue, 19 Sep 2017 14:40:17 -0400, leam hall wrote: > >> On Tue, Sep 19, 2017 at 2:37 PM, Stephan Houben < >> stephan...@gmail.com.invalid> wrote: >> >>> Op 2017-09-19, Steven D'Aprano schreef >> pearwood.info>: >>> >>> > There is a

Re: Research paper "Energy Efficiency across Programming Languages: How does energy, time, and memory relate?"

2017-09-20 Thread alister via Python-list
On Tue, 19 Sep 2017 14:40:17 -0400, leam hall wrote: > On Tue, Sep 19, 2017 at 2:37 PM, Stephan Houben < > stephan...@gmail.com.invalid> wrote: > >> Op 2017-09-19, Steven D'Aprano schreef > pearwood.info>: >> >> > There is a significant chunk of the Python community for whom "just >> > pip instal

Re: How do I check all variables returned buy the functions exists

2017-09-20 Thread Steve D'Aprano
On Wed, 20 Sep 2017 06:04 pm, Bill wrote: > Robin Becker wrote: >> On 16/09/2017 01:58, Steve D'Aprano wrote: >> >>> >>> If you want to test for None specifically: >>> >>> if any(v is None for v in values): >>> print "at least one value was None" >>> >> ... >> >> for some reason

Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread Steve D'Aprano
On Wed, 20 Sep 2017 09:50 pm, Steve D'Aprano wrote: > On Wed, 20 Sep 2017 07:12 pm, Gregory Ewing wrote: > >> Grant Edwards wrote: >>> Alternatively, you should design an instruction set and implement it >>> using microcode and AM2900 bit-slice processors. >> >> AMD2900? That's cheating! You sho

Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread Steve D'Aprano
On Wed, 20 Sep 2017 07:12 pm, Gregory Ewing wrote: > Grant Edwards wrote: >> Alternatively, you should design an instruction set and implement it >> using microcode and AM2900 bit-slice processors. > > AMD2900? That's cheating! You should design and build your > own logic gates. After refining th

Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread Chris Angelico
On Wed, Sep 20, 2017 at 7:12 PM, Gregory Ewing wrote: > Grant Edwards wrote: >> >> Alternatively, you should design an instruction set and implement it >> using microcode and AM2900 bit-slice processors. > > > AMD2900? That's cheating! You should design and build your > own logic gates. After refi

Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread Gregory Ewing
Grant Edwards wrote: Alternatively, you should design an instruction set and implement it using microcode and AM2900 bit-slice processors. AMD2900? That's cheating! You should design and build your own logic gates. After refining the silicon to make the transistors first, of course. -- Greg --

Re: How do I check all variables returned buy the functions exists

2017-09-20 Thread Peter Otten
Bill wrote: > Robin Becker wrote: >> On 16/09/2017 01:58, Steve D'Aprano wrote: >> >>> >>> If you want to test for None specifically: >>> >>> if any(v is None for v in values): >>> print "at least one value was None" >>> >> ... >> >> for some reason that seems slow on my machine

Re: Even Older Man Yells At Whippersnappers

2017-09-20 Thread Gregory Ewing
Rhodri James wrote: Tsk. You should have learned (a fake simplified) assembler first, Never mind that fake assembly rubbish, learn a real assembly language! And hand-assemble it and toggle it into the front panel switches like I did! -- Greg -- https://mail.python.org/mailman/listinfo/python-

Re: How to share class relationship representations?

2017-09-20 Thread Leam Hall
On 09/19/2017 11:16 AM, Stefan Ram wrote: leam hall writes: I'm working on designing the classes, sub-classes, and relationships in my code. What is a good visual way to represent it so it can be stored in git and shared on the list without large images or attachments? Code /is/ design.

Re: Old Man Yells At Cloud

2017-09-20 Thread Chris Angelico
On Wed, Sep 20, 2017 at 4:01 PM, Steven D'Aprano wrote: > The other reserved words are either: > > - values, like None, which can be included in expressions; > > - operators, like `is`, `or`, and `not`; > > - block statements, like `for x in seq` or `while flag` which > require a block; > > - st

Re: How do I check all variables returned buy the functions exists

2017-09-20 Thread Bill
Robin Becker wrote: On 16/09/2017 01:58, Steve D'Aprano wrote: If you want to test for None specifically: if any(v is None for v in values): print "at least one value was None" ... for some reason that seems slow on my machine when compared with if None in values:

Re: How do I check all variables returned buy the functions exists

2017-09-20 Thread Robin Becker
On 16/09/2017 01:58, Steve D'Aprano wrote: If you want to test for None specifically: if any(v is None for v in values): print "at least one value was None" ... for some reason that seems slow on my machine when compared with if None in values: . C:\usr\share\rob