Re: Geting error using python 3.5 : a_token = r.json() mention below

2016-12-20 Thread Ned Batchelder
On Tuesday, December 20, 2016 at 7:28:47 AM UTC-5, Akbar Shaikh wrote: > import io > import csv > import glob > import os.path > import requests > import subprocess > import urllib.request > import json > import time > import xlwt > import xlrd > import datetime > from datetime import date, timedel

Re: Byte-run: a Python interpreter written in Python

2017-01-13 Thread Ned Batchelder
On Friday, January 13, 2017 at 12:09:52 PM UTC-5, Ian wrote: > On Fri, Jan 13, 2017 at 3:46 AM, Steve D'Aprano > wrote: > > > > http://aosabook.org/en/500L/a-python-interpreter-written-in-python.html > > Neat. But not really surprising IMO that it can fit into 500 lines, > since it doesn't handle

Re: List slicing on Python 2.7

2018-03-15 Thread Ned Batchelder
On 3/15/18 9:57 AM, Vlastimil Brom wrote: 2018-03-15 12:54 GMT+01:00 Arkadiusz Bulski : I have a custom class (a lazy list-like container) that needs to support slicing. The __getitem__ checks if index is of slice type, and does a list comprehension over individual integer indexes. The code work

Re: List slicing on Python 2.7

2018-03-15 Thread Ned Batchelder
On 3/15/18 12:35 PM, Peter Otten wrote: Ned Batchelder wrote: On 3/15/18 9:57 AM, Vlastimil Brom wrote: 2018-03-15 12:54 GMT+01:00 Arkadiusz Bulski : I have a custom class (a lazy list-like container) that needs to support slicing. The __getitem__ checks if index is of slice type, and does a

Re: Style Q: Instance variables defined outside of __init__

2018-03-19 Thread Ned Batchelder
On 3/19/18 1:04 PM, Irv Kalb wrote: I am building some classes for use in future curriculum. I am using PyCharm for my development. On the right hand edge of the PyCharm editor window, you get some little bars indicating warnings or errors in your code. I like this feature and try to clean

Re: [OT] Re: Thank you Python community!

2018-03-20 Thread Ned Batchelder
On 3/20/18 12:08 PM, Rick Johnson wrote: On Tuesday, March 20, 2018 at 7:03:11 AM UTC-5, Adriaan Renting wrote: (on the subject of the opioid epidemic) The [OT] in the subject line is right: let's not get off on a political tangent. --Ned. -- https://mail.python.org/mailman/listinfo/python-

Re: Python 3.6: How to expand f-string literals read from a file vs inline statement

2018-03-23 Thread Ned Batchelder
On 3/23/18 4:30 AM, Malcolm Greene wrote: Looking for advice on how to expand f-string literal strings whose values I'm reading from a configuration file vs hard coding into my script as statements. I'm using f-strings as a very simple template language. I'm currently using the following techniqu

Re: Python 3.6: How to expand f-string literals read from a file vs inline statement

2018-03-23 Thread Ned Batchelder
On 3/23/18 12:39 PM, Malcolm Greene wrote: Perhaps it doesn't need to be said, but just to be sure: don't use eval if you don't trust the people writing the configuration file. They can do nearly unlimited damage to your environment.  They are writing code that you are running. Of course! Sc

Re: Ruby parens-free function calls [was Re: Accessing parent objects]

2018-03-26 Thread Ned Batchelder
On 3/26/18 7:10 PM, Python wrote: Humans are already good enough at making mistakes that they require no additional encouragement, such as what is provided by allowing such syntactical horrors. Agreed. And that's why we must respect and follow the code styling wisdom which has been passed down b

Re: Compression of random binary data

2018-04-12 Thread Ned Batchelder
On 4/11/18 9:29 PM, cuddlycave...@gmail.com wrote: I’m replying to your post on January 28th Nice carefully chosen non random numbers Steven D'Aprano. Was just doing what you asked, but you don’t remember 😂😂😂 Best practice is to include a quote of the thing you are replying to.  It makes it m

Re: Issue with python365.chm on window 7

2018-04-24 Thread Ned Batchelder
On 4/24/18 2:10 AM, Bob Martin wrote: Senior Software Engineer? Seriously? What is the point of this comment?  We can be more respectful than this. --Ned. -- https://mail.python.org/mailman/listinfo/python-list

Re: The perils of multiple Pythons

2018-04-30 Thread Ned Batchelder
On 4/30/18 1:15 PM, Chris Angelico wrote: https://xkcd.com/1987/ So take-away is: On a Mac, just use Homebrew. (Cue the angry hordes telling me how wrong I am.) My take-away (though not really, since I held this view before this morning): pick a way and stick to it. --Ned. -- https://

Re: syntax error (?) on ubuntu

2018-05-03 Thread Ned Batchelder
On 5/3/18 9:11 AM, Joel Goldstick wrote: On Thu, May 3, 2018 at 9:06 AM, joseph pareti wrote: $ python tf_simple.py /anaconda/envs/py35/lib/python3.5/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. I

Re: Problem/bug with class definition inside function definition

2018-05-08 Thread Ned Batchelder
On 5/8/18 3:55 AM, Alexey Muranov wrote: Sorry, i was confused.  I would say that this mostly works as expected, though the difference between    x = 42    class C:    x = x  # Works and    def f2(a):    class D:    a = a  # Does not work <    return D is still surpr

Re: object types, mutable or not?

2018-05-16 Thread Ned Batchelder
On 5/16/18 3:17 AM, Steven D'Aprano wrote: On Wed, 16 May 2018 17:03:22 +1000, Ben Finney wrote: So, no, I think the more useful – and less problematic – framing is that every object *has* a value, and mutable objects may change to a different value while remaining the same object. What's an o

Re: object types, mutable or not?

2018-05-16 Thread Ned Batchelder
On 5/16/18 10:06 AM, Steven D'Aprano wrote: On Wed, 16 May 2018 09:23:02 -0400, Ned Batchelder wrote: I've also experimented with different ways to better say "everything is an object".  One possibility is, "any right-hand side of an assignment is an object,"

Re: why does list's .remove() does not return an object?

2018-05-16 Thread Ned Batchelder
On 5/16/18 10:41 PM, Abdur-Rahmaan Janhangeer wrote: why is x = list.remove(elem) not return the list? Methods in Python usually do one of two things: 1) mutate the object and return None; or 2) leave the object alone and return a new object.  This helps make it clear which methods mutate and

Re: why does list's .remove() does not return an object?

2018-05-17 Thread Ned Batchelder
-Ned. (PS: bottom-posting (adding your response below the text you are responding to) will make the conversation easier to follow...) ps. list is was demo illustrative var Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ On Thu, 17 May 2018, 07:01 Ned Batchelder, <mailto:n...@nedb

Re: why does list's .remove() does not return an object?

2018-05-17 Thread Ned Batchelder
On 5/17/18 11:57 AM, Abdur-Rahmaan Janhangeer wrote: x = [0,1] x.remove(0) new_list = x instead i want in one go x = [0,1] new_list = x.remove(0) # here a way for it to return the modified list by adding a .return() maybe ? There isn't a way to do that in one line.  I often find myself splitt

Re: why does list's .remove() does not return an object?

2018-05-17 Thread Ned Batchelder
On 5/17/18 12:28 PM, Dan Strohl via Python-list wrote: On 2018-05-17 11:26 AM, Abdur-Rahmaan Janhangeer wrote: I don't understand what this would return? x? You already have x. Is it meant to make a copy? x has been mutated, so I don't understand the benefit of making a copy of the 1-less x. C

Re: what does := means simply?

2018-05-18 Thread Ned Batchelder
On 5/18/18 7:09 AM, bartc wrote: On 18/05/2018 02:45, Steven D'Aprano wrote: On Fri, 18 May 2018 02:17:39 +0100, bartc wrote: Normally you'd use the source code as a start point. In the case of Python, that means Python source code. But you will quickly run into problems because you will often

Re: "Data blocks" syntax specification draft

2018-05-21 Thread Ned Batchelder
On 5/19/18 10:58 PM, Mikhail V wrote: I have made up a printable PDF with the current version of the syntax suggestion. https://github.com/Mikhail22/Documents/blob/master/data-blocks-v01.pdf After some of your comments I've made some further re-considerations, e.g. element separation should be

Re: "Data blocks" syntax specification draft

2018-05-21 Thread Ned Batchelder
On 5/21/18 9:42 PM, Mikhail V wrote: On Mon, May 21, 2018 at 2:14 PM, Ned Batchelder wrote: On 5/19/18 10:58 PM, Mikhail V wrote: I have made up a printable PDF with the current version of the syntax suggestion. https://github.com/Mikhail22/Documents/blob/master/data-blocks-v01.pdf After

Re: Usenet Gateway

2018-05-23 Thread Ned Batchelder
On 5/23/18 12:03 PM, Gene Heskett wrote: On Wednesday 23 May 2018 11:20:34 Abdur-Rahmaan Janhangeer wrote: can someone explain to me why the mailing list (spam free) is not used by everybody? Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Brain damaged by facebook, AOL, M$, Google

Re: List replication operator

2018-05-24 Thread Ned Batchelder
On 5/24/18 2:17 PM, Steven D'Aprano wrote: Python has a sequence replication operator: py> [1, 2]*3 [1, 2, 1, 2, 1, 2] Unfortunately, it is prone to a common "gotcha": py> x = [[]]*5 # make a multi-dimensional list py> x [[], [], [], [], []] py> x[0].append(1) py> x [[1], [1], [1], [1], [1]]

Re: convert a string to a variable

2018-05-25 Thread Ned Batchelder
On 5/24/18 6:54 PM, bruceg113...@gmail.com wrote: I am trying to convert a string to a variable. I got cases 1 & 2 to work, but not cases 3 & 4. The print statement in cases 3 & 4 reports the following: builtins.AttributeError: type object 'animal' has no attribute 'tiger' I am stuck

Re: convert a string to a variable

2018-05-25 Thread Ned Batchelder
On 5/25/18 9:52 AM, brucegoodst...@gmail.com wrote: On Friday, May 25, 2018 at 8:06:31 AM UTC-4, Ned Batchelder wrote: On 5/24/18 6:54 PM, bruceg113...@gmail.com wrote: I am trying to convert a string to a variable. I got cases 1 & 2 to work, but not cases 3 & 4. The print statement

Re: Fwd: QUERY

2018-06-02 Thread Ned Batchelder
On 6/2/18 9:08 AM, S Srihari wrote: To: python-list@python.org I AM UNABLE TO INSTALL PYTHON. KINDLY HELP ME. Put yourself in our shoes: how can we help you with so little information?  We don't know what operating system you are on, we don't know what you have tried, we don't know what has

Re: Sorting NaNs

2018-06-02 Thread Ned Batchelder
On 6/2/18 6:16 PM, Richard Damon wrote: On 6/2/18 4:51 PM, Ben Bacarisse wrote: Paul Rubin writes: Steven D'Aprano writes: it too will mess up sorting in unpredictable ways. So don't do that. Hmm. GHCi 7.4.2: Prelude> let x = 0.0 / 0.0 Prelude> x NaN Prelude> x==x

Re: Learning Python

2018-06-05 Thread Ned Batchelder
On 6/5/18 12:51 PM, T Berger wrote: Can someone learn Python through a book such as Head Start Python? Would an online course from MIT or google be better? This is really a question about your own learning style.  It is possible to learn from a book.  Not too long ago, that was one of the onl

Re: Stefan's headers [was:Names and identifiers]

2018-06-08 Thread Ned Batchelder
On 6/8/18 2:34 AM, Thomas Jollans wrote: On 07/06/18 22:36, Peter Pearson wrote: X-Copyright: (C) Copyright 2018 Stefan Ram. All rights reserved. Distribution through any means other than regular usenet channels is forbidden. It is forbidden to publish this article in the Web, to change

Re: sympy

2016-03-30 Thread Ned Batchelder
On Wednesday, March 30, 2016 at 7:17:33 AM UTC-4, Poul Riis wrote: > Is it possible to transfer results from sympy to 'normal' python. Poul, welcome to the group. > In the case below I think my intention is clear enough but it does not work > as intended. How can it be done? > > from sympy impo

Re: Drowning in a teacup?

2016-04-02 Thread Ned Batchelder
On Friday, April 1, 2016 at 4:27:30 PM UTC-4, Fillmore wrote: > notorious pass by reference vs pass by value biting me in the backside > here. Proceeding in order. As others have pointed out, this is false dichotomy. There are other possibilities than pass by reference and pass by value. Python

Re: writing to command line thru python gui

2016-04-02 Thread Ned Batchelder
On Saturday, April 2, 2016 at 1:20:52 PM UTC-4, Thomas 'PointedEars' Lahn wrote: > 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/maili

Re: Strange range

2016-04-02 Thread Ned Batchelder
On Friday, April 1, 2016 at 10:34:50 AM UTC-4, Marko Rauhamaa wrote: > Chris Angelico : > > > *A range object is not an iterator.* > > We now have learned as much. > > However, doesn't that extra level of indirection seem like an odd > choice? I agree that it is surprising (and confusing) at fi

Re: Strange range

2016-04-02 Thread Ned Batchelder
On Saturday, April 2, 2016 at 5:40:35 PM UTC-4, Marko Rauhamaa wrote: > Chris Angelico : > > > On Sun, Apr 3, 2016 at 6:44 AM, Marko Rauhamaa wrote: > >> I don't have a problem with a list being a "reiterable." I only was > >> surprised about range(), which I had thought to be a plain, > >> down-

Re: [Beginner] - Hanging in the code, can't figure out what's wrong

2016-04-02 Thread Ned Batchelder
On Saturday, April 2, 2016 at 6:09:13 PM UTC-4, BartC wrote: > On 02/04/2016 22:59, Loop.IO wrote: > > Hey > > > > So I built a keylogger using python as a test, got the code from the > > tutorial online, I want to improve on it to make it more automated, but the > > issue I'm having is it won't

Re: Collection: weak error prompt drives beginner crazy

2016-04-04 Thread Ned Batchelder
On Monday, April 4, 2016 at 7:31:38 AM UTC-4, animalize wrote: > An example, the file-name is conflict with library-name in stdlib or > installed library. > > There is a file uuid.py that only has two lines: > > import uuid > print(uuid.uuid4()) > > Run uuid.py, output on Python 3.5.1

Re: module alias in import statement

2016-04-04 Thread Ned Batchelder
On Monday, April 4, 2016 at 11:31:41 AM UTC-4, ast wrote: > hello > > >>> import tkinter as tk > >>> import tk.ttk as ttk > > Traceback (most recent call last): > File "", line 1, in > import tk.ttk as ttk > ImportError: No module named 'tk' > > > of course > > >>> import tkinter.ttk as

Re: Import graphics error

2016-04-05 Thread Ned Batchelder
On Tuesday, April 5, 2016 at 4:06:02 PM UTC-4, Thomas 'PointedEars' Lahn wrote: > | >>> from email import ID10T > | Traceback (most recent call last): > | File "", line 1, in > | ImportError: cannot import name 'ID10T' This is uncalled for. You don't have to participate in this thread if you d

Re: Promoting Python

2016-04-06 Thread Ned Batchelder
On Wednesday, April 6, 2016 at 7:06:28 AM UTC-4, BartC wrote: > On 05/04/2016 06:48, Gordon( Hotmail ) wrote: > > The problem I am finding is most of the sites claiming to help understand > > Python devote > > far too much space bragging about the wonders of Python instead of... > > I fully agree

Re: Promoting Python

2016-04-06 Thread Ned Batchelder
On Wednesday, April 6, 2016 at 10:25:13 AM UTC-4, Mark Lawrence wrote: > On 06/04/2016 14:54, BartC wrote: > > On 06/04/2016 12:46, Marko Rauhamaa wrote: > >> BartC : > > > >>> It'll cope with ordinary coding as well, although such programs seem > >>> to be frowned upon here; they are not 'Pythonic

Re: Promoting Python

2016-04-06 Thread Ned Batchelder
On Wednesday, April 6, 2016 at 10:40:36 AM UTC-4, Mark Lawrence wrote: > On 06/04/2016 15:34, Ned Batchelder wrote: > > No, please, let's not ask BartC to list these features. We've already > > well established Bart's point of view, let's not revisit this de

Re: one-element tuples

2016-04-10 Thread Ned Batchelder
On Sunday, April 10, 2016 at 8:48:49 PM UTC-4, Fillmore wrote: > On 04/10/2016 08:31 PM, Ben Finney wrote: > > Can you describe explicitly what that "discontinuation point" is? I'm > > not seeing it. > > Here you go: > > >>> a = '"string1"' > >>> b = '"string1","string2"' > >>> c = '"string1",

Re: Unacceptable behavior

2016-04-10 Thread Ned Batchelder
On Sunday, April 10, 2016 at 9:29:19 PM UTC-4, Jeff Schumaker wrote: > On Sunday, April 10, 2016 at 1:15:18 PM UTC-4, bream...@gmail.com wrote: > > On Sunday, April 10, 2016 at 2:54:45 PM UTC+1, Jeff Schumaker wrote: > > > On Thursday, April 7, 2016 at 2:50:32 AM UTC-4, Ethan Furman wrote: > > > >

Re: An educational site written in Python (from YCombinator's RFS)

2016-05-10 Thread Ned Batchelder
On Tuesday, May 10, 2016 at 2:13:42 AM UTC-4, Cai Gengyang wrote: > > EDUCATION > > If we can fix education, we can eventually do everything else on this list. > The first attempts to use technology to fix education have focused on using > the Internet to distribute traditional content to a wide

Re: The irony

2016-05-10 Thread Ned Batchelder
On Tuesday, May 10, 2016 at 2:03:47 PM UTC-4, DFS wrote: > Which is the "one obvious way" to do it? > > I liked: > > sSQL = "line 1\n" > sSQL += "line 2\n" > sSQL += "line 3" > > > but it's frowned upon in PEP8. I would use a way you didn't show: sSQL = """ line1 line2

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

2016-05-11 Thread Ned Batchelder
On Tuesday, May 10, 2016 at 8:16:43 PM UTC-4, Thomas 'PointedEars' Lahn wrote: > DFS wrote: > > > On 5/8/2016 8:44 PM, Thomas 'PointedEars' Lahn wrote: > >> With the “%” string operator (deprecated), > > > > according to who? > > TFM. > It's easy to be confused on this point. Early on in the

Re: String concatenation

2016-05-11 Thread Ned Batchelder
On Wednesday, May 11, 2016 at 5:30:48 PM UTC-4, sohca...@gmail.com wrote: > On Wednesday, May 11, 2016 at 12:14:43 PM UTC-7, Thomas 'PointedEars' Lahn > wrote: > > sohcahto...@gmail.com wrote: > > > > > I don't blame people for not wanting to use their real name on the > > > Internet, especially

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

2016-05-12 Thread Ned Batchelder
On Thursday, May 12, 2016 at 4:24:55 AM UTC-4, srinivas devaki wrote: > On May 9, 2016 5:31 AM, "Tim Chase" wrote: > > > > then that's a bad code-smell (you get quadratic behavior as the > > strings are constantly resized), usually better replaced with > > > > I just want to point out that in Pyt

Re: An educational site written in Python (from YCombinator's RFS)

2016-05-13 Thread Ned Batchelder
On Friday, May 13, 2016 at 12:05:33 PM UTC-4, Cai Gengyang wrote: > edx.org is a great example , perhaps a competitor / clone with different > functionalities and better design , more videos, graphics , more interactive As I mentioned in a previous reply, edx.org runs on Open edX, which is open

Re: An educational site written in Python (from YCombinator's RFS)

2016-05-13 Thread Ned Batchelder
re you understood the Open edX option. I wish you all the best. More and better educational sites will be good for the world. --Ned. > > > As Paul Graham mentioned : "Startups are often ruthless competitors, but > they're competing in a game won by making what people wan

Re: Quote of the day

2016-05-18 Thread Ned Batchelder
On Wednesday, May 18, 2016 at 8:06:11 AM UTC-4, Thomas Mlynarczyk wrote: > On 17/05/16 12:39, Cem Karan wrote: > > Just downloaded and used a library that came with unit tests, which all > > passed. > > [...] > > I discovered they had commented out the bodies of some of the unit > tests... > > Sh

Re: Quote of the day

2016-05-18 Thread Ned Batchelder
On Wednesday, May 18, 2016 at 11:36:03 AM UTC-4, Thomas Mlynarczyk wrote: > On 18/05/16 17:21, Ned Batchelder wrote: > > Ideally, an empty test wouldn't be a success, but I'm not sure how > > the test runner could determine that it was empty. I guess it could > >

Re: setrecursionlimit

2016-05-18 Thread Ned Batchelder
On Wednesday, May 18, 2016 at 12:11:25 PM UTC-4, Steven D'Aprano wrote: > The documentation for setrecursion limit warns against setting the limit too > high: > > [quote] > The highest possible limit is platform-dependent. A user may need to > set the limit higher when they have a prog

Re: for / while else doesn't make sense

2016-05-19 Thread Ned Batchelder
On Thursday, May 19, 2016 at 12:43:56 PM UTC-4, Herkermer Sherwood wrote: > Most keywords in Python make linguistic sense, but using "else" in for and > while structures is kludgy and misleading. I am under the assumption that > this was just utilizing an already existing keyword. Adding another li

Re: How to memory dump an object?

2016-05-20 Thread Ned Batchelder
On Friday, May 20, 2016 at 9:05:51 PM UTC-4, jf...@ms4.hinet.net wrote: > Is there any tools which can do the memory dump of an object so I can view > their content or implementation? For example, > > >>> s1 = '\x80abc' > >>> b1 = b'\x80abc' > > What are exactly stored in memory for each of them

Re: for / while else doesn't make sense

2016-05-23 Thread Ned Batchelder
On Monday, May 23, 2016 at 9:06:13 PM UTC-4, Steven D'Aprano wrote: > On Tue, 24 May 2016 08:36 am, Christopher Reimer wrote: > > > Those symbols are blowing my 8-bit ASCII brain. :) > > That's certainly true, because there is no such thing as 8-bit ASCII. ASCII > is a 7-bit encoding. (Most imple

Re: META Culture of this place [was Re: for / while else doesn't make sense]

2016-05-24 Thread Ned Batchelder
On Tuesday, May 24, 2016 at 12:44:04 PM UTC-4, Steven D'Aprano wrote: > On Tue, 24 May 2016 12:19 pm, Ned Batchelder wrote: > > > Ugh, can we please stop with the "well, actually" pedantic tangents? > > With respect, no. > > This is a forum with a very

Re: Anonymous hyperlinks in restructuredtext

2016-05-28 Thread Ned Batchelder
On Saturday, May 28, 2016 at 8:28:35 AM UTC-4, Sergio Spina wrote: > From the "restructuredtext markup specification": > > >Anonymous hyperlink targets consist of an explicit markup > >start (".. "), two underscores, a colon, whitespace, and a > >link block; there is no reference name:

Re: Anonymous hyperlinks in restructuredtext

2016-05-28 Thread Ned Batchelder
On Saturday, May 28, 2016 at 8:58:41 AM UTC-4, Sergio Spina wrote: > Il giorno sabato 28 maggio 2016 14:37:21 UTC+2, Ned Batchelder ha scritto: > > On Saturday, May 28, 2016 at 8:28:35 AM UTC-4, Sergio Spina wrote: > > > From the "restructuredtext markup specification":

Re: Coding systems are political (was Exended ASCII and code pages)

2016-05-28 Thread Ned Batchelder
On Saturday, May 28, 2016 at 11:16:39 AM UTC-4, wxjm...@gmail.com wrote: > Le samedi 28 mai 2016 06:47:11 UTC+2, Rustom Mody a écrit : > > > ... > > [which AIUI is jmf's principal error] > > > > ... > > I'm very confident. It's only a question of time until > the rest of the world dive into this

Re: for / while else doesn't make sense

2016-06-04 Thread Ned Batchelder
On Friday, June 3, 2016 at 11:43:33 PM UTC-4, Lawrence D’Oliveiro wrote: > On Saturday, June 4, 2016 at 3:00:36 PM UTC+12, Steven D'Aprano wrote: > > You can exit a loop because you have run out of items to process, or you can > > exit the loop because a certain condition has been met. > > But why

Re: for / while else doesn't make sense

2016-06-05 Thread Ned Batchelder
On Saturday, June 4, 2016 at 11:29:30 PM UTC-4, Lawrence D’Oliveiro wrote: > On Saturday, June 4, 2016 at 11:37:18 PM UTC+12, Ned Batchelder wrote: > > On Friday, June 3, 2016 at 11:43:33 PM UTC-4, Lawrence D’Oliveiro wrote: > > > On Saturday, June 4, 2016 at 3:00:36 PM UTC+1

Re: for / while else doesn't make sense

2016-06-07 Thread Ned Batchelder
On Tuesday, June 7, 2016 at 6:07:23 PM UTC-4, Lawrence D’Oliveiro wrote: > On Tuesday, June 7, 2016 at 8:00:31 PM UTC+12, Marko Rauhamaa wrote: > > I understand you are hurt when your code is criticized bluntly. However, > > you *did* stick your head out. > > Don’t worry, I am not the thin-skinned

Re: Possible PEP - two dimensional arrays?

2016-06-07 Thread Ned Batchelder
On Tuesday, June 7, 2016 at 8:19:33 PM UTC-4, Harrison Chudleigh wrote: > I was programming a computer game and found that while 1D arrays can be > created using the module array, there is no module for two-dimensional > arrays, unlike languages like C. Currently, the closest thing Python has to >

Re: for / while else doesn't make sense

2016-06-07 Thread Ned Batchelder
On Tuesday, June 7, 2016 at 9:29:59 PM UTC-4, Lawrence D’Oliveiro wrote: > On Wednesday, June 8, 2016 at 12:32:01 PM UTC+12, Ned Batchelder wrote: > > > Lawrence writes code in an unusual style... > > “Unusual” I can deal with. But when some people react with outrage, then i

Re: the global keyword:

2016-06-11 Thread Ned Batchelder
On Saturday, June 11, 2016 at 8:13:50 PM UTC-4, Marcin Rak wrote: > On Saturday, 11 June 2016 19:09:29 UTC-5, MRAB wrote: > > On 2016-06-12 00:50, Random832 wrote: > > > On Sat, Jun 11, 2016, at 19:44, Marcin Rak wrote: > > >> So my question is, how the heck is it possible that I get 5 as the last

Re: the global keyword:

2016-06-11 Thread Ned Batchelder
On Saturday, June 11, 2016 at 11:38:33 PM UTC-4, Steven D'Aprano wrote: > On Sun, 12 Jun 2016 11:26 am, Random832 wrote: > > > On Sat, Jun 11, 2016, at 20:09, MRAB wrote: > >> Not true. Importing doesn't copy the value. > >> > >> Importing a name creates a new name in the local scope that refers

Re: Indentation example?

2016-06-12 Thread Ned Batchelder
On Sunday, June 12, 2016 at 11:10:39 AM UTC-4, ICT Ezy wrote: > Pl explain with an example the following phase > "Indentation cannot be split over multiple physical lines using backslashes; > the whitespace up to the first backslash determines the indentation" (in > 2.1.8. Indentation of Tutorial

Re: the global keyword:

2016-06-12 Thread Ned Batchelder
On Sunday, June 12, 2016 at 3:08:01 PM UTC-4, BartC wrote: > On 12/06/2016 00:44, Marcin Rak wrote: > > Hi to all. > > > > I have the following file named Solver.py: > > * > > from Test import some_function, my_print > > from Test import test_var > > > > some

Re: Re - Contradictory error messages in Python 3.4 - standard library issue!

2016-06-16 Thread Ned Batchelder
On Thursday, June 16, 2016 at 6:39:27 PM UTC-4, Harrison Chudleigh wrote: > Sorry! I was trying to indent a line and accidentally sent only half of the > message. > > As I was saying, I changed the line and reran the program. However, this > produced another group of error messages. One was - > Fi

Re: Method Chaining

2016-06-17 Thread Ned Batchelder
On Friday, June 17, 2016 at 12:37:14 AM UTC-4, Lawrence D’Oliveiro wrote: > On Friday, June 17, 2016 at 4:24:24 PM UTC+12, Michael Selik wrote: > > On Thu, Jun 16, 2016 at 10:53 PM Lawrence D’Oliveiro wrote: > > > > > Example from , > > > c

Re: Method Chaining

2016-06-17 Thread Ned Batchelder
On Friday, June 17, 2016 at 6:23:12 PM UTC-4, Lawrence D’Oliveiro wrote: > On Friday, June 17, 2016 at 8:13:50 PM UTC+12, Ned Batchelder wrote: > > > But the unchained version is more explicit, and avoids > > the awkward parenthesis. > > You think of parentheses as “awkwa

Re: best text editor for programming Python on a Mac

2016-06-17 Thread Ned Batchelder
On Friday, June 17, 2016 at 8:19:46 PM UTC-4, Lawrence D’Oliveiro wrote: > On Saturday, June 18, 2016 at 11:52:35 AM UTC+12, Chris wrote: > > > SyntaxError: Non-ASCII character '\xe2' in hello_world.py on line 1, but no > > encoding declared; see http://python.org/dev/peps/pep-0263/ for details >

Re: Which one is the best XML-parser?

2016-06-24 Thread Ned Batchelder
On Friday, June 24, 2016 at 8:44:49 PM UTC-4, Sayth Renshaw wrote: > On Friday, 24 June 2016 07:03:18 UTC+10, David Shi wrote: > > Which one is the best XML-parser? > > Can any one tell me? > > Regards. > > David > > Most use lxml http://lxml.de/index.html > > Sayth Sayth, is everything OK? Why

Re: Which one is the best JSON parser?

2016-06-27 Thread Ned Batchelder
On Monday, June 27, 2016 at 9:31:04 AM UTC-4, Nagy László Zsolt wrote: > On 2016-06-23, MRAB wrote: > >> On 2016-06-23 21:58, David Shi via Python-list wrote: > >>> Can any one tell me? > >>> Regards. > >>> David > >>> > >> There's one in the standard library. > > Which has always worked fine for

Re: Well, I finally ran into a Python Unicode problem, sort of

2016-07-04 Thread Ned Batchelder
On Monday, July 4, 2016 at 6:05:20 AM UTC-4, BartC wrote: > On 04/07/2016 03:30, Steven D'Aprano wrote: > > On Mon, 4 Jul 2016 10:17 am, BartC wrote: > > > >> On 04/07/2016 01:00, Lawrence D’Oliveiro wrote: > >>> On Monday, July 4, 2016 at 11:47:26 AM UTC+12, eryk sun wrote: > Python lacks a m

Re: Well, I finally ran into a Python Unicode problem, sort of

2016-07-04 Thread Ned Batchelder
On Monday, July 4, 2016 at 10:36:54 AM UTC-4, BartC wrote: > On 04/07/2016 13:47, Ned Batchelder wrote: > > On Monday, July 4, 2016 at 6:05:20 AM UTC-4, BartC wrote: > >> On 04/07/2016 03:30, Steven D'Aprano wrote: > > >>> You're still having problems

Re: Zero runtime impact tracing

2016-07-30 Thread Ned Batchelder
On Saturday, July 30, 2016 at 4:32:25 AM UTC-4, Johannes Bauer wrote: > Hi group, > > I'm using CPython 3.5.1. Currently I'm writing some delicate code that > is doing the right thing in 99% of the cases and screws up on the other 1%. > > I would like to have tracing in some very inner loops: >

Re: How do I make a game in Python ?

2016-08-06 Thread Ned Batchelder
On Saturday, August 6, 2016 at 5:51:40 PM UTC-4, Cai Gengyang wrote: > As in, any recommended websites that helps users create complex games in > Python ? http://inventwithpython.com/ --Ned. -- https://mail.python.org/mailman/listinfo/python-list

Re: Ned Batchelder: Loop Like A Native

2016-08-06 Thread Ned Batchelder
On Saturday, August 6, 2016 at 6:06:27 PM UTC-4, Lawrence D’Oliveiro wrote: > On Saturday, August 6, 2016 at 12:08:30 PM UTC+12, bream...@gmail.com wrote: > > A couple or three years old but this is well worth seeing for anybody, > > regardless of your Python expertise. http://nedbatchelder.com/tex

Re: Ned Batchelder: Loop Like A Native

2016-08-06 Thread Ned Batchelder
On Saturday, August 6, 2016 at 7:36:06 PM UTC-4, Ned Batchelder wrote: > On Saturday, August 6, 2016 at 6:06:27 PM UTC-4, Lawrence D’Oliveiro wrote: > > On Saturday, August 6, 2016 at 12:08:30 PM UTC+12, bream...@gmail.com wrote: > > > A couple or three years old but this is wel

Re: Ned Batchelder: Loop Like A Native

2016-08-06 Thread Ned Batchelder
On Saturday, August 6, 2016 at 9:21:24 PM UTC-4, Lawrence D’Oliveiro wrote: > On Sunday, August 7, 2016 at 11:36:06 AM UTC+12, Ned Batchelder wrote: > > > Didn't we already do this debate? > > I understand. You want to discuss loops, just not *those* sorts of loops...

Re: Ned Batchelder: Loop Like A Native

2016-08-07 Thread Ned Batchelder
On Sunday, August 7, 2016 at 6:52:45 PM UTC-4, Lawrence D’Oliveiro wrote: > On Sunday, August 7, 2016 at 1:26:48 PM UTC+12, Ned Batchelder wrote: > > I'm merely pointing out that your concern about multiple ways to exit loops > > sounds like exactly what was discussed here two

Re: To whoever hacked into my Database

2013-11-11 Thread Ned Batchelder
On Monday, November 11, 2013 5:47:28 PM UTC-5, ru...@yahoo.com wrote: > On 11/08/2013 11:08 AM, Chris Angelico wrote: > > On Sat, Nov 9, 2013 at 4:11 AM, wrote: > >> On 11/08/2013 03:05 AM, Νίκος Αλεξόπουλος wrote: > >>> I never ignore advices. > >>> I read all answers as carefully as i can. > >>

Re: To whoever hacked into my Database

2013-11-12 Thread Ned Batchelder
On Tuesday, November 12, 2013 1:31:32 AM UTC-5, ru...@yahoo.com wrote: > On 11/11/2013 06:16 PM, Ned Batchelder wrote: > > Nikos has received a good deal of genuine advice. He has also been > > genuinely difficult to help. > > Yes. If he is too difficult to help without ge

Re: Trying tcompile an use the Python 3.4a

2013-11-13 Thread Ned Batchelder
On Wednesday, November 13, 2013 11:38:53 AM UTC-5, Ferrous Cranus wrote: > Στις 13/11/2013 6:13 μμ, ο/η Steven D'Aprano έγραψε: > > >> and also is there a way to call it like #!/usr/bin/python > > > > Of course there is, but only if you wish to break your system. The OS > > will be expecting /usr/

Re: To whoever hacked into my Database

2013-11-13 Thread Ned Batchelder
On Wednesday, November 13, 2013 1:27:39 PM UTC-5, superchromix wrote: > hi all, > > I've been thinking about learning Python for scientific programming.. but all > of these flame war type posts make the user community look pretty lame. How > did all of these nice packages get written when most

Re: Packing byte fields and an array object into struct

2013-11-13 Thread Ned Batchelder
On Wednesday, November 13, 2013 1:31:49 PM UTC-5, krishna...@gmail.com wrote: > Hello, > > I am trying to build a structure to be passed down to an I2C device driver. > The driver expects a struct that has a data array of size 512 bytes among > other things. This is my code - > > rd_wr

Re: Packing byte fields and an array object into struct

2013-11-13 Thread Ned Batchelder
On Wednesday, November 13, 2013 3:41:03 PM UTC-5, krishna...@gmail.com wrote: > Thanks for your reply Ned! > > I tried this your suggestion and this is what it complains... > > os_inst_bytes = struct.pack('7BI512s', 0, 0x51, 0x10, 5, 0, 0xD, 0x80, 0, '') > > -

Re: Trying tcompile an use the Python 3.4a

2013-11-13 Thread Ned Batchelder
On Wednesday, November 13, 2013 4:39:59 PM UTC-5, Ferrous Cranus wrote: > Στις 13/11/2013 11:30 μμ, ο/η Johannes Findeisen έγραψε: > > On Wed, 13 Nov 2013 23:19:53 +0200 > > Ferrous Cranus wrote: > > > >> Στις 13/11/2013 7:45 μμ, ο/η Chris “Kwpolska” Warrick έγραψε:> > >>> Get ez_setup.py and get-p

Re: To whoever hacked into my Database

2013-11-13 Thread Ned Batchelder
On Wednesday, November 13, 2013 4:46:59 PM UTC-5, Ferrous Cranus wrote: > root@secure:~/lib64# ls -al | grep libkey > > lrwxrwxrwx 1 root root 20 Jun 22 2012 libkeyutils.so.1 -> > libkeyutils.so.1.3.0* > -rwxr-xr-x 1 root root 10192 Jun 22 2012 libkeyutils.so.1.3* > -rwxr-xr-x 1 root root 32920 J

Re: Trying tcompile an use the Python 3.4a

2013-11-13 Thread Ned Batchelder
On Wednesday, November 13, 2013 5:32:49 PM UTC-5, Mark Lawrence wrote: > Wrong. You've once again not bothered to read the information that's > been handed to you on a plate. If you'd followed the instructions you > would not get the "No such file or directory" error shown above. I'm > not go

Re: python 3.3 repr

2013-11-15 Thread Ned Batchelder
On Friday, November 15, 2013 6:28:15 AM UTC-5, Robin Becker wrote: > I'm trying to understand what's going on with this simple program > > if __name__=='__main__': > print("repr=%s" % repr(u'\xc1')) > print("%%r=%r" % u'\xc1') > > On my windows XP box this fails miserably if run direc

Re: python 3.3 repr

2013-11-15 Thread Ned Batchelder
On Friday, November 15, 2013 7:16:52 AM UTC-5, Robin Becker wrote: > On 15/11/2013 11:38, Ned Batchelder wrote: > .. > > > > In Python3, repr() will return a Unicode string, and will preserve existing > > Unicode characters in its arguments. This has been controv

Re: python 3.3 repr

2013-11-15 Thread Ned Batchelder
On Friday, November 15, 2013 9:43:17 AM UTC-5, Robin Becker wrote: > Things went wrong when utf8 was not adopted as the standard encoding thus > requiring two string types, it would have been easier to have a len function > to > count bytes as before and a glyphlen to count glyphs. Now as I unde

Re: Question regarding 2 modules installed via 'pip'

2013-11-16 Thread Ned Batchelder
On Saturday, November 16, 2013 8:45:51 AM UTC-5, Ferrous Cranus wrote: > What the difference between locate and find? > > and seen find show me some results, what now? > > 'rm -rf' those files or i will break something? > > and then how i'am gonna install those 2 modules for python 3.3.2? For l

Re: Question regarding 2 modules installed via 'pip'

2013-11-16 Thread Ned Batchelder
On Saturday, November 16, 2013 8:59:13 AM UTC-5, Ferrous Cranus wrote: > HELP ME > Στις 16/11/2013 3:53 μμ, ο/η Joel Goldstick έγραψε: > > not related to python > > Nikos, stop this. You are sending repeated emails with no new information, and no evidence that you have tried anything, ab

Re: Question regarding 2 modules installed via 'pip'

2013-11-16 Thread Ned Batchelder
On Saturday, November 16, 2013 10:45:38 AM UTC-5, Johannes Findeisen wrote: > On Sat, 16 Nov 2013 07:32:36 -0800 (PST) > Ferrous Cranus wrote: > > > Τη Σάββατο, 16 Νοεμβρίου 2013 5:20:51 μ.μ. UTC+2, ο χρήστης Mark Lawrence > > έγραψε: > > > On 16/11/2013 13:45, Ferrous Cranus wrote: > > > root@s

<    1   2   3   4   5   6   7   8   9   >