Reviews of book on introductory Python (was: Need reviews for my book on introductory python)

2017-01-28 Thread Thomas 'PointedEars' Lahn
mm0fmf wrote: > […] Python, the name of the language, is a proper noun and should be > captialised. In the few pages I read, Python appears as "python" and > "Python", randomly losing the capital letter. Lacking capitalisation > would suggest to me that some or all words are consistently written

Re: The right way to 'call' a class attribute inside the same class

2016-12-19 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Mon, Dec 19, 2016 at 9:52 AM, Erik wrote: >> 1) Method call: >>"obj.foo(1, 2, 3)" is syntactic sugar for "obj.foo(obj, 1, 2, 3)". > > And the bit you have to be REALLY careful of when working with both > Python and JS is that you have to

Re: Python constructors have particular semantics, and ‘Foo.__init__’ doesn't qualify

2016-12-15 Thread Thomas 'PointedEars' Lahn
Ben Finney wrote: > Chris Angelico writes: >> On Tue, Dec 13, 2016 at 10:17 AM, Ben Finney >> wrote: >> > If the differences didn't matter I would agree that “overly >> > pedantic” is fair. But those differences trip up newcomers. Thinking >> > of

Re: The right way to 'call' a class attribute inside the same class

2016-12-12 Thread Thomas 'PointedEars' Lahn
Juan C. wrote: > On Mon, Dec 12, 2016 at 12:34 PM, Thomas 'PointedEars' Lahn > <pointede...@web.de> wrote: >> To call something means generally in programming, and in Python, to >> execute it as a function instead: In the code above, the class object >> referr

Re: The right way to 'call' a class attribute inside the same class

2016-12-12 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > Note that (AIUI) in this example the instances of the class referred by > “C” do not have an *own* “foo” property in the beginning, so until bar() > is called on them, they inherit that property (and its value) from that > class.³ For pr

Re: The right way to 'call' a class attribute inside the same class

2016-12-12 Thread Thomas 'PointedEars' Lahn
Juan C. wrote: > I'm watching a Python course and was presented a topic regarding classes. > One of the examples were: > > box.py > > class Box: > serial = 100 > > def __init__(self, from_addr, to_addr): > self.from_addr = from_addr > self.to_addr = to_addr >

Re: correct way to catch exception with Python 'with' statement

2016-11-28 Thread Thomas 'PointedEars' Lahn
Ganesh Pal wrote: > I am using Python 2.7 and Linux As a rule of thumb¹, use at least Python 3.3 for new programs. > What will be the best way to catch the exception in the above program ? > Can we replace both the with statement in the above program with > something like below > > try: >

Re: Expression can be simplified on list

2016-09-13 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > […] Thomas 'PointedEars' Lahn […] wrote: >> If I knew that it is always going to be a list or a tuple, I would check >> its length instead: >> >> if len(errors) == 0: > > I wouldn't. I'd use boolification here too. Only if I

Re: How to extend a tuple of tuples?

2016-09-13 Thread Thomas 'PointedEars' Lahn
John Gordon wrote: > […] Thomas 'PointedEars' Lahn […] writes: It is supposed to be an attribution *line*, _not_ an attribution novel. >> >> The obvious way does not work - >> >> >> >> a += (5, 6) >> ^^ >> > Righ

Re: Expression can be simplified on list

2016-09-12 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Mon, Sep 12, 2016 at 9:14 PM, Daiyue Weng wrote: >> Hi, I found that when I tried to make an equality test on empty like, >> >> if errors == []: >> >> PyCharm always warns me, >> >> Expression can be simplified. >> >> I am wondering what's wrong

Re: manually sorting images?

2016-09-04 Thread Thomas 'PointedEars' Lahn
Ulli Horlacher wrote: > I need to sort images (*.jpg), visually, not by file name. > It looks, there is no standard UNIX tool for this job? Depends. What are the sort keys? -- PointedEars Twitter: @PointedEars2 Please do not cc me. / Bitte keine Kopien per E-Mail. --

Re: use import *

2016-08-01 Thread Thomas 'PointedEars' Lahn
Ganesh Pal wrote: > is it a good programming practice to use [from … ] import * ? No; but it is not as harmful as one would think either. > if answer is "NO " then are there situation where you are forced to use >

Re: making executables smaller

2016-07-27 Thread Thomas 'PointedEars' Lahn
Carter Temm wrote: > I’m writing a couple different projects at the moment, and when I compile > it into a single executable using pyinstaller, it becomes extremely large. > I’m guessing this is because of the modules used. Because I’m not that > skilled at python, I put stuff like for example,

Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-10 Thread Thomas 'PointedEars' Lahn
DFS wrote: > On 5/8/2016 8:44 PM, Thomas 'PointedEars' Lahn wrote: >> DFS wrote: >>> sSQL = "line 1\n" >>> sSQL += "line 2\n" >>> sSQL += "line 3" >> >> […] >> #--

String concatenation (was: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?)

2016-05-08 Thread Thomas 'PointedEars' Lahn
DFS wrote: > sSQL = "line 1\n" > sSQL += "line 2\n" > sSQL += "line 3" What is wrong with it in Python is that it is unnecessarily inefficient. Python has implicit string concatenation if all operands are string literals:

Re: function to remove and punctuation

2016-04-10 Thread Thomas 'PointedEars' Lahn
Peter Otten wrote: > gesh...@gmail.com wrote: >> how to write a function taking a string parameter, which returns it after >> you delete the spaces, punctuation marks, accented characters in python ? > > Looks like you want to remove more characters than you want to keep. In > this case I'd

Re: [beginner] What's wrong?

2016-04-06 Thread Thomas 'PointedEars' Lahn
Rustom Mody wrote: > On Sunday, April 3, 2016 at 5:17:36 PM UTC+5:30, Thomas 'PointedEars' Lahn > wrote: >> Rustom Mody wrote: >> > When python went to full unicode identifers it should have also added >> > pragmas for which blocks the programmer intended to use --

Re: WP-A: A New URL Shortener

2016-04-06 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > In other words, you are assuming that the string escaping *in the > module* is buggy. Well, duh. This is exactly what I said about not > having stupid bugs. The developer of a MySQL binding library should > know the *entire* rules for escaping, and, duh, that's going to >

Re: Import graphics error

2016-04-05 Thread Thomas 'PointedEars' Lahn
Nicolae Morkov wrote: > […] > *Following the instructions I copied The graphic modules by John Zelle in > Python folder in Lib folder * > **And when I installed graphic library the error was :* * > > Traceback (most recent call last): > File >

Re: [beginner] What's wrong?

2016-04-03 Thread Thomas 'PointedEars' Lahn
Rustom Mody wrote: > On Saturday, April 2, 2016 at 10:42:27 PM UTC+5:30, Thomas 'PointedEars' > Lahn wrote: >> Marko Rauhamaa wrote: >> > Steven D'Aprano : >> >> So you're saying that learning to be a fluent speaker of English is a >> >> pre-requis

Re: [beginner] What's wrong?

2016-04-03 Thread Thomas 'PointedEars' Lahn
Michael Torrie wrote: > Mark, your messages are showing up to the list as being from "python," > at least on my email. Any reason for this? Depends on which Mark you are addressing and how you are reading e-mail. The messages of Mark Lawrence, for example, appear to me as technically correct

Re: writing to command line thru python gui

2016-04-02 Thread Thomas 'PointedEars' Lahn
A. ElKader wrote: > I posted this question, no reply : > > Any advice : > > http://unix.stackexchange.com/questions/273573/write-to-terminal-in-tkinter-gui I do not think that this newsgroup/mailing list is meant as an advertisement board to get your questions answered on Q forums on the Web,

Re: [beginner] What's wrong?

2016-04-02 Thread Thomas 'PointedEars' Lahn
Marko Rauhamaa wrote: > Steven D'Aprano : >> So you're saying that learning to be a fluent speaker of English is a >> pre-requisite of being a programmer? > > No more than learning Latin is a prerequisite of being a doctor. Full ACK. Probably starting with the Industrial

Re: [OT'ish] Is there a list as good as this for Javascript

2016-03-26 Thread Thomas 'PointedEars' Lahn
Mark Lawrence wrote: > On 24/03/2016 20:53, c...@isbd.net wrote: >> I use Python wherever I can and find this list (as a usenet group via >> gmane) an invaluable help at times. >> >> Occasionally I have to make forays into Javascript, can anyone >> recommend a place similar to this list where

Re: [OT'ish] Is there a list as good as this for Javascript

2016-03-25 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Sat, Mar 26, 2016 at 12:36 PM, Thomas 'PointedEars' Lahn > <pointede...@web.de> wrote: >>> Thomas is not typical of the Python community. We are mostly nice >>> people. >>> :) >> >> You do not even know me. I *a

Re: WP-A: A New URL Shortener

2016-03-25 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Sat, Mar 26, 2016 at 9:25 AM, Thomas 'PointedEars' Lahn > <pointede...@web.de> wrote: Attribution line, not attribution novel. >> Chris Angelico wrote: >>> On Sat, Mar 26, 2016 at 8:28 AM, Thomas 'PointedEars' Lahn >>> <pointed

Re: [OT'ish] Is there a list as good as this for Javascript

2016-03-25 Thread Thomas 'PointedEars' Lahn
Ned Batchelder wrote: > Chris, I apologize for Thomas. How dare you to speak for me, and *again* the rest of the subscribers? There is nothing to apologize for when I am *helping* someone by giving them useful information. You can apologize for your own presumptous behavior instead. > is

Re: WP-A: A New URL Shortener

2016-03-25 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Sat, Mar 26, 2016 at 8:28 AM, Thomas 'PointedEars' Lahn > <pointede...@web.de> wrote: >> Chris Angelico wrote: >>> […] Thomas 'PointedEars' Lahn […] wrote: >>>> Chris Angelico wrote: >>>>> […] Thomas 'PointedEars' La

Re: WP-A: A New URL Shortener

2016-03-25 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > […] Thomas 'PointedEars' Lahn […] wrote: >> Chris Angelico wrote: >>> […] Thomas 'PointedEars' Lahn […] wrote: >>>> Daniel Wilcox wrote: >>>>> Cool thanks, highly recommended to use an ORM to deter easy SQL >>>>>

Re: [OT'ish] Is there a list as good as this for Javascript

2016-03-25 Thread Thomas 'PointedEars' Lahn
Mark Lawrence wrote: > […] It is so blatantly obvious that he knows precisely nothing about > Python, but still the moderators on this list let him get away with it. This is a mailing list? It is moderated? *Seriously*? -- PointedEars Twitter: @PointedEars2 Please do not cc me. / Bitte

Re: [OT'ish] Is there a list as good as this for Javascript

2016-03-25 Thread Thomas 'PointedEars' Lahn
c...@isbd.net wrote: > Occasionally I have to make forays into Javascript, can anyone > recommend a place similar to this list where Javascript questions can > be asked? The trouble is that there are very many usenet Javascript > lists and it's difficult to guess which one[es] might be good.

Re: WP-A: A New URL Shortener

2016-03-19 Thread Thomas 'PointedEars' Lahn
Daniel Wilcox wrote: > Cool thanks, highly recommended to use an ORM to deter easy SQL > injections. That is to crack a nut with a sledgehammer. SQL injection can be easily and more efficiently prevented with prepared statements. While an Object- Relational Mapper (ORM) can use those, and

Re: WP-A: A New URL Shortener

2016-03-19 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Fri, Mar 18, 2016 at 10:17 AM, Thomas 'PointedEars' Lahn > <pointede...@web.de> wrote: >> Daniel Wilcox wrote: >>> Cool thanks, highly recommended to use an ORM to deter easy SQL >>> injections. >> >> That is to cra

Re: WP-A: A New URL Shortener

2016-03-19 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > In some cases, the correct solution would be a short URL at a domain > that the provider controls. But that's no different from running your > own shortener service - it still has the extra indirection and > consequent risks. So for a lot of people, a public shortener is

Re: WP-A: A New URL Shortener

2016-03-19 Thread Thomas 'PointedEars' Lahn
Rick Johnson wrote: > On Thursday, March 17, 2016 at 4:15:37 PM UTC-5, Thomas 'PointedEars' Lahn > wrote: >> Get a life, *please*. > > Well, you see *Thomas*, the problem is, this *IS* my life! I couldn't > remove myself from this life anymore than you could apply a Bézier

Re: WP-A: A New URL Shortener

2016-03-19 Thread Thomas 'PointedEars' Lahn
Rick Johnson wrote: > On Thursday, March 17, 2016 at 1:28:05 PM UTC-5, Thomas 'PointedEars' Lahn > wrote: > >> BTW and JFTR, this thread has gone *way* off topic. > Who cares? Python-list is not a "strictly moderated group". [rant] Get a life

Re: WP-A: A New URL Shortener

2016-03-15 Thread Thomas 'PointedEars' Lahn
Gene Heskett wrote: > On Tuesday 15 March 2016 19:55:52 Chris Angelico wrote: >> On Wed, Mar 16, 2016 at 10:38 AM, Thomas 'PointedEars' Lahn >> > And as for second-level domains, consider for example “t.c” instead >> > of “twitter.com” as part of the short URI. >&g

Re: Descriptors vs Property

2016-03-15 Thread Thomas 'PointedEars' Lahn
Mark Lawrence wrote: > Please ignore 'PointedEars', Please ignore Mark Lawrence unless he has something on-topic to say. How does that feel, Mark? > every month or so for some weird reason The reason being obviously that the people to whose postings I happen to post a follow-up to do not

Re: WP-A: A New URL Shortener

2016-03-15 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Wed, Mar 16, 2016 at 10:38 AM, Thomas 'PointedEars' Lahn > <pointede...@web.de> wrote: >> Chris Angelico wrote: >>> On Wed, Mar 16, 2016 at 9:53 AM, Thomas 'PointedEars' Lahn >>> <pointede...@web.de> wrote: >>&g

Re: WP-A: A New URL Shortener

2016-03-15 Thread Thomas 'PointedEars' Lahn
Rick Johnson wrote: > On Tuesday, March 15, 2016 at 5:54:46 PM UTC-5, Thomas 'PointedEars' Lahn > wrote: >> Vinicius Mesel wrote: >> > I'm a 16 year old Python Programmer that wanted to do >> > something different. But, like we know, ideas are quite >> > dif

Re: WP-A: A New URL Shortener

2016-03-15 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Wed, Mar 16, 2016 at 9:53 AM, Thomas 'PointedEars' Lahn > <pointede...@web.de> wrote: Attribution *line*, _not_ attribution novel. >> […] I cannot be sure because I have not th

Re: WP-A: A New URL Shortener

2016-03-15 Thread Thomas 'PointedEars' Lahn
Vinicius Mesel wrote: > I'm a 16 year old Python Programmer that wanted to do something different. > But, like we know, ideas are quite difficult to find. > So I decided to develop a URL Shortener to help the Python community out > and share my coding knowledge, and today the project was launched

Re: Obfuscating Python code

2016-03-15 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Wed, Mar 16, 2016 at 5:59 AM, Thomas 'PointedEars' Lahn > <pointede...@web.de> wrote: >> That said, not distributing the source code of a program as well (or at >> least making it available to users in some way) strikes me as unpythonic >>

Re: Obfuscating Python code

2016-03-15 Thread Thomas 'PointedEars' Lahn
Ben Finney wrote: > Swanand Pashankar writes: >> Embedding a Python file in C code works, but it exposes your Python >> script. Didn't find any free fool-proof way to obfuscate Python code >> either. > > What exactly is it you want to prevent? Why do you think

Re: Python Advanced Help

2016-03-15 Thread Thomas 'PointedEars' Lahn
Luke Charlton wrote: > Okay, So basically I created a python script around 1 year ago to grab an > explain_plan from a Greenplum system (Normal SQL) and change it around and > explain each step/section, the thing is, I've came back to the python code > and I don't understand anything of what it's

Re: The Cost of Dynamism

2016-03-13 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Sun, Mar 13, 2016 at 6:24 AM, Thomas 'PointedEars' Lahn > <pointede...@web.de> wrote: >> Marko Rauhamaa wrote: >>> […] HTML markup is all ASCII. >> >> Wrong. I am creating HTML documents whose source code contains Unicode >&

Re: The Cost of Dynamism

2016-03-13 Thread Thomas 'PointedEars' Lahn
BartC wrote: > On 12/03/2016 19:26, Thomas 'PointedEars' Lahn wrote: >> BartC wrote: >>> On 12/03/2016 12:13, Marko Rauhamaa wrote: >>>> Why, look at the *English* page on Hillary Clinton: >>>> >>>> Hillary Diane Rodham Clinton /ˈhɪl

Re: issue w/ python 3.5.7

2016-03-13 Thread Thomas 'PointedEars' Lahn
lucile.m...@free.fr wrote: > We would like to get the procedure to launch the software "python.exe". > The only options we have acsess are: modify, repair and uninstall. […] -- PointedEars Twitter: @PointedEars2 Please do not cc me. / Bitte

Re: Descriptors vs Property

2016-03-13 Thread Thomas 'PointedEars' Lahn
Veek. M wrote: > Thomas 'PointedEars' Lahn wrote: >>>> Nobility lies in action, not in name. >>>> —Surak > > Someone called Ned.B who i know elsewhere spoke on your behalf. I'm glad > to say I like/trust Ned a bit so *huggles* to you, and I shall sni

Re: Descriptors vs Property

2016-03-13 Thread Thomas 'PointedEars' Lahn
Veek. M wrote: > > http://www.thecodingforums.com/threads/examples-of-ecmascipt-written-by-thomas-lahn.937812/ > > Examples of ECMAScipt written by Thomas Lahn > > Thomas is the forums best known critic of everyone else's attempts at > writing ECMAscript. I was

Re: Descriptors vs Property

2016-03-13 Thread Thomas 'PointedEars' Lahn
Veek. M wrote: > Thomas 'PointedEars' Lahn wrote: >>> I haven't read the descriptor protocol as yet. >> You should. You should also trim your quotations to the relevant >> minimum, and post using your real name. > > I don't take advice from people on USENET

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-12 Thread Thomas 'PointedEars' Lahn
BartC wrote: > On 12/03/2016 12:13, Marko Rauhamaa wrote: >> Why, look at the *English* page on Hillary Clinton: >> >> Hillary Diane Rodham Clinton /ˈhɪləri daɪˈæn ˈrɒdəm ˈklɪntən/ (born >> October 26, 1947) is an American politician. >> https://en.wikipedia.org/wiki/Hillary_Clinton>

Re: The Cost of Dynamism

2016-03-12 Thread Thomas 'PointedEars' Lahn
Marko Rauhamaa wrote: > […] all keyboards can produce ASCII and no keyboard can produce all of > Unicode. Both claims are wrong. -- PointedEars Twitter: @PointedEars2 Please do not cc me. / Bitte keine Kopien per E-Mail. -- https://mail.python.org/mailman/listinfo/python-list

Re: The Cost of Dynamism

2016-03-12 Thread Thomas 'PointedEars' Lahn
Marko Rauhamaa wrote: > […] HTML markup is all ASCII. Wrong. I am creating HTML documents whose source code contains Unicode characters every day. Also, the two of you fail to differentiate between US-ASCII, a 7-bit character encoding, and 8-bit or longer encodings which can *also* encode

Re: Descriptors vs Property

2016-03-12 Thread Thomas 'PointedEars' Lahn
Veek. M wrote: > Veek. M wrote: >> class TypedProperty(object): >> def __init__(self,name,type,default=None): >> self.name = "_" + name >> self.type = type >> self.default = default if default else type() >> >> def __get__(self,instance,cls): >> return

Re: Simple exercise

2016-03-10 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > od = OrderedDict() This is pointless, then. > […] > od = OrderedDict(map(lambda item: (item[0], 0), items)) > for item in items: od[item[0]] += item[1] -- PointedEars Twitter: @PointedEars2 Please do not cc me. / Bitte keine

Re: Simple exercise

2016-03-10 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: [ > key = m.group(1) > value = int(m.group(2)) > > if key not in od: > od[key] = value > else: > od[key] += value > > But there is probably an even more pythonic way to do

Re: Simple exercise

2016-03-10 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > key = m.group(1) > value = int(m.group(1)) value = int(m.group(2)) > if key not in od: > od[key] = value > else: > od[key] += value -- PointedEars Twitter: @PointedEars2 P

Re: Simple exercise

2016-03-10 Thread Thomas 'PointedEars' Lahn
Rodrick Brown wrote: > […] > if m: > if m.group(1) not in od.keys(): > od[m.group(1)] = int(m.group(2)) > else: > od[m.group(1)] += int(od.get(m.group(1),0)) > […] This program logic appears to be wrong as you are not adding the value that you just read to the

Photon mass (was: [Still off-top] Physics)

2016-03-05 Thread Thomas 'PointedEars' Lahn
Gene Heskett wrote: > I've never heard of a massless photon, That is unfortunate as it should be common knowledge by now. > and they do exert a push on the surface they are reflected from, […] Photons exert a force on surfaces because they carry *momentum* or, as it had been understood in

Photon mass (was: [Still off-top] Physics)

2016-03-05 Thread Thomas 'PointedEars' Lahn
Oscar Benjamin wrote: > On 5 March 2016 at 02:51, Gregory Ewing > wrote: >>> The masslessness of photons comes from an extrapolation >>> that leads to a divide by infinity: strictly speaking it's just >>> undefined. >> >> No, it's not. The total energy of a particle

Re: Make a unique filesystem path, without creating the file

2016-02-15 Thread Thomas 'PointedEars' Lahn
Gregory Ewing wrote: > Ben Finney wrote: >> One valid filesystem path each time it's accessed. That is, behaviour >> equivalent to ‘tempfile.mktemp’. >> >> My question is because the standard library clearly has this useful >> functionality implemented, but simultaneously warns strongly against

Re: Make a unique filesystem path, without creating the file

2016-02-14 Thread Thomas 'PointedEars' Lahn
Ben Finney wrote: > How should a program generate a unique filesystem path and *not* create > the filesystem entry? The Python documentation suggests that it should not. > The ‘tempfile.mktemp’ function is strongly deprecated, and rightly so >

Re: create Email with multiple HTML blocks embedded

2016-01-31 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > See RFC 5233 and RTFM for details. RFC _5322_ (“Internet Message Format”) <http://tools.ietf.org/html/rfc5322> -- PointedEars Twitter: @PointedEars2 Please do not cc me. / Bitte keine Kopien per E-Mail. -- https://mail.python.org/mailman/listin

Re: carry **arguments through different scopes/functions

2016-01-31 Thread Thomas 'PointedEars' Lahn
Terry Reedy wrote: > On 1/31/2016 7:19 AM, c.bu...@posteo.jp wrote: >> I am not sure what the problem is here, so I don't really know how I >> should call the subject for that question. Please offer a better >> subject. >> >> The code below is a extrem simplified example of the original one. But

Re: create Email with multiple HTML blocks embedded

2016-01-31 Thread Thomas 'PointedEars' Lahn
kevind0...@gmail.com wrote: > Following your suggestions, I now have code that looks like the below. > I get the same result. First HTML is displayed in body of email and > second shows up as an attachment. Works as designed. The message structure is correct now, but there is no plain-text

Re: python

2016-01-11 Thread Thomas 'PointedEars' Lahn
Sean Melville wrote: >> On 11 Jan 2016, at 20:33, Cameron Simpson wrote: >>> On 11Jan2016 19:17, Sean Melville wrote: >>> I've downloaded python 3.5.1 but when I try and open it always says that >>> I have to either uninstall it, repair it or modify

Re: licenses

2016-01-10 Thread Thomas 'PointedEars' Lahn
Ben Finney wrote: > "Martinez, Jorge Alberto (GE Aviation)" […] writes: >> We develop applications here with Python and I want to know if there's >> issues by using. We use NumPy, PyDaqMx, Py Visa > > Those are all free software: meaning, every recipient has freedom to > execute, modify, and/or

Re: Why is there difference between cmd line and .py file?

2016-01-05 Thread Thomas 'PointedEars' Lahn
Joel Goldstick wrote: > On Tue, Jan 5, 2016 at 3:45 PM, Robert wrote: >> import numpy as np >> >> In [154]: np.sum(expectation_A)[0] >> […] >> IndexError: invalid index to scalar variable. > > I've not used numpy, but you should print expectation_A to see what's in > it. It

Re: Why is there difference between cmd line and .py file?

2016-01-05 Thread Thomas 'PointedEars' Lahn
Robert wrote: > I just wonder that the cmd line function sum may be different from the > .py file used. One is numpy package, the other is a general one. Then, > how can I further make it clear for this guess? Among other things: print(sum.__doc__) -- PointedEars Twitter: @PointedEars2

Re: create Email with multiple HTML blocks embedded

2016-01-05 Thread Thomas 'PointedEars' Lahn
kevind0...@gmail.com wrote: Please either do not use Google Groups and configure your newsreader accordingly (recommended), or use Google Groups to subscribe to the newsgroup so that you can specify your real name. > body = MIMEMultipart('multipart') Obviously there is

Re: We will be moving to GitHub

2016-01-04 Thread Thomas 'PointedEars' Lahn
Marko Rauhamaa wrote: > Well, Git and Mercurial are not all that bad as long as only a single > person is working on the repository at any given time and you have a > strictly linear version history. I cannot confirm your observations(?) for Git. There was a time when three of four people of

Re: Trailing zeros of 100!

2016-01-02 Thread Thomas 'PointedEars' Lahn
Mark Lawrence wrote: > Please don't top post, it's extremely annoying when trying to follow > long threads. As are full quotes. -- PointedEars Twitter: @PointedEars2 Please do not cc me. / Bitte keine Kopien per E-Mail. -- https://mail.python.org/mailman/listinfo/python-list

Re: Ignore error with non-zero exit status

2015-12-22 Thread Thomas 'PointedEars' Lahn
Terry Reedy wrote: > On 12/21/2015 9:05 AM, Thomas 'PointedEars' Lahn wrote: >> Chris Angelico wrote: >>> On Tue, Dec 22, 2015 at 12:19 AM, Thomas 'PointedEars' Lahn >>> <pointede...@web.de> wrote: >>>> Mark Lawrence wrote: >>>>> On 21/

Re: Meaning and purpose of the Subject field

2015-12-22 Thread Thomas 'PointedEars' Lahn
Random832 wrote: > This makes sense for the change from "old" to "new (was: old)", > which nobody was advocating against (after all, there's semantic > content - they wouldn't have changed the subject line if they > didn't consider it a new discussion topic), but I think there is > a reasonable

Re: match point

2015-12-22 Thread Thomas 'PointedEars' Lahn
Thierry wrote: > Reading the docs about regular expressions, I am under the impression > that calling > re.match(pattern, string) > is exactly the same as > re.search(r'\A'+pattern, string) Correct. > Same for fullmatch, that amounts to > re.search(r'\A'+pattern+r'\Z', string) Correct. >

Re: Meaning and purpose of the Subject field

2015-12-21 Thread Thomas 'PointedEars' Lahn
Jon Ribbens wrote: > On 2015-12-21, Ian Kelly wrote: >> I can't specifically recall if I've used any MUA other than Gmail that >> even attempts threading email messages. > > Also: Thunderbird, The Bat!, Eudora, Gnus, Outlook, Outlook Express, > Pegasus Mail, Pine, Apple

Re: Ignore error with non-zero exit status

2015-12-21 Thread Thomas 'PointedEars' Lahn
Mark Lawrence wrote: > On 21/12/2015 07:51, Thomas 'PointedEars' Lahn wrote: >> Chris Angelico wrote: >>> But it's been clearly stated that .format is not going to do away with >>> percent formatting, and all language of "new-style formatting" has been >

Re: Ignore error with non-zero exit status

2015-12-21 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Tue, Dec 22, 2015 at 12:19 AM, Thomas 'PointedEars' Lahn > <pointede...@web.de> wrote: >> Mark Lawrence wrote: >>> On 21/12/2015 07:51, Thomas 'PointedEars' Lahn wrote: >>>> Chris Angelico wrote: >>>>> But it's be

Re: Ignore error with non-zero exit status

2015-12-21 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > […] Thomas 'PointedEars' Lahn […] wrote: >> Chris Angelico wrote: >>> […] Thomas 'PointedEars' Lahn […] wrote: >>>> Mark Lawrence wrote: >>>>> On 21/12/2015 07:51, Thomas 'PointedEars' Lahn wrote: >>>>>

Re: Ignore error with non-zero exit status

2015-12-20 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Mon, Dec 21, 2015 at 8:22 AM, Thomas 'PointedEars' Lahn > <pointede...@web.de> wrote: It is supposed to be an attribution *line*, _not_ an attribution novel. Also, the “(was: …)” part is to be removed from the Subject header field value to complet

Re: Ignore error with non-zero exit status

2015-12-20 Thread Thomas 'PointedEars' Lahn
Ganesh Pal wrote: [repaired Subject, restored attribution] > Thomas 'PointedEars' Lahn wrote: >> Most simple solution for this: Do not use a loop. More "complicated" >> solution: Use an “if” statement. > > I want to stick on to loop and try modifying the co

Ignore error with non-zero exit status (was: How to ignore error with anon-zero exit status)

2015-12-20 Thread Thomas 'PointedEars' Lahn
Ganesh Pal wrote: > def run_scanner(): > """ > Mount /filesystems and run scanner > """ > for cmd in [" mount /filesystems ", " scanner_start"]: > try: > out, err, ret = run(cmd, timeout=3600) > if ret != 0: >

Re: Installing PyCharm on Windows

2015-12-20 Thread Thomas 'PointedEars' Lahn
Josef Pktd wrote: ^^ I doubt that is your real name. > On Saturday, December 19, 2015 at 1:32:27 PM UTC-5, Thomas 'PointedEars' > Lahn wrote: >> Have you tried to install Python ≥ 3.4.4rc1 on Windows XP? If yes, it >> cannot work; you need Python < 3.4.4rc1 in

Re: Ignore error with non-zero exit status

2015-12-20 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > On Mon, Dec 21, 2015 at 9:46 AM, Thomas 'PointedEars' Lahn > <pointede...@web.de> wrote: >>> Percent formatting isn't going away. There's no need to tell people to >>> abandon it in favour of .format(), unless they actually need a feature &g

Installing PyCharm on Windows (was: issues)

2015-12-19 Thread Thomas 'PointedEars' Lahn
Anna Szaharcsuk wrote: > I was trying to install PyCharm, but didn't worked and needed interpreter. > the computer advised to install the python for windows. Not “the python for windows” (that would be some species of snake), but _Python_ for _Windows_, the programming language interpreter.

Re: cannot open file with non-ASCII filename

2015-12-14 Thread Thomas 'PointedEars' Lahn
Ulli Horlacher wrote: > Laura Creighton wrote: >> Given that Ulli is in Germany, latin-1 is likely to work fine for him. > > For me, but not for my users. We have people from about 100 nations at our > university. > […] > The problem is the input of these filenames. Why do you

Re: Getting data out of Mozilla Thunderbird with Python?

2015-12-10 Thread Thomas 'PointedEars' Lahn
Michael Torrie wrote: > It's good to know I can configure Thunderbird to use maildir for local > storage. I'll have to make the change here. Will make my backups a lot > easier and faster. But see also . Not all of those bugs have been

Re: Accessing container's methods

2015-12-08 Thread Thomas 'PointedEars' Lahn
Erik wrote: Please fix, Erik #75656. > On 07/12/15 18:10, Tony van der Hoff wrote: >> A highly contrived example, where I'm setting up an outer class in a >> Has-a relationship, containing a number of Actors. The inner class needs >> to access a method of the outer class; here the method

Re: Getting data out of Mozilla Thunderbird with Python?

2015-12-08 Thread Thomas 'PointedEars' Lahn
Anthony Papillion wrote: > -BEGIN PGP SIGNED MESSAGE- Please don’t do that again. > I have a TON of email (years) stored in my Thunderbird. My backup > strategy for the last few years has been to periodically dump it all > in a tar file, encrypt that tar file, and move it up to the

Re: Accessing container's methods

2015-12-08 Thread Thomas 'PointedEars' Lahn
Mark Lawrence wrote: > On 08/12/2015 19:02, Thomas 'PointedEars' Lahn wrote: >> Erik wrote: >> >> Please fix, Erik #75656. > > Please fix what? You are not ready for the answer yet. -- PointedEars Twitter: @PointedEars2 Please do not cc me. / Bitte keine K

Re: Accessing container's methods

2015-12-08 Thread Thomas 'PointedEars' Lahn
Vincent Vande Vyvre wrote: > Le 08/12/2015 20:02, Thomas 'PointedEars' Lahn a écrit : >> Erik wrote: >>> Amongst other things, you can't put the object into multiple containers >> You can. Quickhack: ^ >> class Child: >> self._paren

Re: filter a list of strings

2015-12-08 Thread Thomas 'PointedEars' Lahn
Mark Lawrence wrote: > On 03/12/2015 01:15, c.bu...@posteo.jp wrote: >> I would like to know how this could be done more elegant/pythonic. >> >> I have a big list (over 10.000 items) with strings (each 100 to 300 >> chars long) and want to filter them. >> >> list = . >> […] > > targets =

Re: Brief Code Review Please - Learning Python

2015-12-07 Thread Thomas 'PointedEars' Lahn
Joel Goldstick wrote: > On Sun, Dec 6, 2015 at 12:21 PM, wrote: >> * Same question as right above but with the if tests on lines 5-8. >> * I've also used ( ) around the if tests, but I'm not sure if this is >> good Python style or not. >> >> 1 def

Re: Accessing container's methods

2015-12-07 Thread Thomas 'PointedEars' Lahn
Tony van der Hoff wrote: > I have a class A, containing embedded embedded classes, which need to > access methods from A. Let the name of the "embedded class" (which is not embedded at all in your example code) be E. You could either store the information in the E instance upon or after

Re: Accessing container's methods

2015-12-07 Thread Thomas 'PointedEars' Lahn
Michael Torrie wrote: > On 12/07/2015 11:10 AM, Tony van der Hoff wrote: >> I have a class A, containing embedded embedded classes, which need to >> access methods from A. >> . >> A highly contrived example, where I'm setting up an outer class in a >> Has-a relationship, containing a number of

Re: if else python

2015-11-25 Thread Thomas 'PointedEars' Lahn
Scott Montreuil wrote: > I have an if statement which seems to run both commands and I cannot > figure out why. (just learning so I may be missing something obvious) Any > ideas? Use a Python IDE and debugger. I recommend PyDev, but YMMV. > while True: > global

Re: pyinstaller and Python 3.5 on Windows?

2015-11-18 Thread Thomas 'PointedEars' Lahn
Ulli Horlacher wrote: > To run my Python programs on other Windows systems without a Python > installation I must create standalone Windows executables. > > pyinstaller runs without any problems with Python 2.7.10 on Windows 7, but > with Python 3.5 I get: > > [b0rked stack trace] > > Is there

Re: Question about math.pi is mutable

2015-11-12 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > […] Ben Finney […] wrote: >> I recommend you ignore that request; “Bartc” is fine as a name here, >> IMO. > > Given that LARTC means Linux Advanced Routing and Traffic Control, I'm > guessing Bartc is all about *BSD networking? :) I thought LART were the Luser Attitude

Re: Question about math.pi is mutable

2015-11-06 Thread Thomas 'PointedEars' Lahn
Thomas 'PointedEars' Lahn wrote: > In theory, it should be possible to substitute “math” with a reference to > an object that acts as a proxy for the original “math” module object but > whose base class declares the attributes for all the constants read-only. #!/usr/bin/en

  1   2   3   >