Re: The "loop and a half"

2017-10-05 Thread Chris Angelico
On Fri, Oct 6, 2017 at 11:08 AM, bartc wrote: > I don't run these things often enough to remember exactly how to specify an > EOF with the keyboard. It might be: > > - One of Ctrl C, D, Z or Break This is your problem, not the program's. ChrisA -- https://mail.python.org/mailman/listinfo/python

Re: The "loop and a half"

2017-10-05 Thread Chris Angelico
On Fri, Oct 6, 2017 at 12:07 PM, Steve D'Aprano wrote: > But in fairness, if the author of the `sort` command had a commitment to > friendliness in their programs, they could have `sort` only print a message > when it is reading from stdin and writing to stdout, much as `ls` defaults to > outputti

Re: why does memory consumption keep growing?

2017-10-05 Thread Chris Angelico
On Fri, Oct 6, 2017 at 4:14 PM, Gregory Ewing wrote: > Steve D'Aprano wrote: >> >> Plus the downtime and labour needed to install the memory, if the computer >> will even take it. > > > Obviously we need an architecture that supports hot-swappable > robot-installable RAM. > Cloud computing is the

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-06 Thread Chris Angelico
On Fri, Oct 6, 2017 at 7:09 PM, Steve D'Aprano wrote: > What are the right ways for a Python script to detect these sorts of > situations? > > (1) Standard input is coming from a pipe; > > (2) Stdin is being read from a file; > > (3) Stdin is coming from a human at a terminal; > > I get these. How

Re: why does memory consumption keep growing?

2017-10-06 Thread Chris Angelico
On Fri, Oct 6, 2017 at 8:05 PM, D'Arcy Cain wrote: > On 10/05/2017 05:42 PM, Fetchinson . via Python-list wrote: >> >> On 10/5/17, Chris Angelico wrote: >>> >>> On Fri, Oct 6, 2017 at 8:06 AM, Fetchinson . via Python-list >

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-06 Thread Chris Angelico
On Fri, Oct 6, 2017 at 8:27 PM, Paul Moore wrote: > On 6 October 2017 at 10:14, Marko Rauhamaa wrote: >> Generally, you shouldn't condition the program too much on such >> environmental details, although it is done. For example, the "ls" >> command outputs the directory listing in a (colorful) mu

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Fri, Oct 6, 2017 at 9:32 PM, bartc wrote: > (And properly, by being given the same of an actual file rather than using > crude redirection.) Why do you call redirection "crude"? Do you not understand the value of generic solutions that work with all programs, rather than having every program i

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Fri, Oct 6, 2017 at 10:41 PM, bartc wrote: > On 06/10/2017 12:04, Rhodri James wrote: >> >> On 05/10/17 19:45, bartc wrote: >>> >>> Yes, I tried typing 'sort' in Linux, where it apparently hangs (same on >>> Windows actually). The reason: because it might have killed someone to have >>> added a

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
d way of doing things. Actually it does, because you learn the system once and use it for everything. > On 06/10/2017 12:45, Chris Angelico wrote: >> Why do you call redirection "crude"? Do you not understand the value >> of generic solutions that work with all programs, ra

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 4:05 AM, Grant Edwards wrote: > On 2017-10-06, Thomas Jollans wrote: > >> Seriously? sys.stdin can be None? That's terrifying. > > Why? > > Unix daemons usually run with no stdin, stderr, or stdout. > > And yes, people do write Unix daemons in Python. Hmm, but usually I wo

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 4:13 AM, bartc wrote: > On 06/10/2017 15:55, Chris Angelico wrote: >> >> On Fri, Oct 6, 2017 at 11:38 PM, bartc wrote: > > >> Have you ever worked on a slow remote session where a GUI is >> completely impracticable (or maybe even unavaila

Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 4:54 AM, Grant Edwards wrote: > On 2017-10-06, Chris Angelico wrote: >> On Sat, Oct 7, 2017 at 4:05 AM, Grant Edwards >> wrote: >>> On 2017-10-06, Thomas Jollans wrote: >>> >>>> Seriously? sys.stdin can be None? That&#x

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 4:55 AM, Marko Rauhamaa wrote: > Personally, I think stdin is a bit lame as a stimulus source for an > interactive program. That's not even what stdin is primarily meant for; > stdin is meant to be the input data for a job. Similarly, stdout is > meant to be the result of th

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 5:47 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Sat, Oct 7, 2017 at 4:55 AM, Marko Rauhamaa wrote: >>> Personally, I think stdin is a bit lame as a stimulus source for an >>> interactive program. That's not even what stdin i

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 5:51 AM, bartc wrote: > On 06/10/2017 18:42, Chris Angelico wrote: >> >> On Sat, Oct 7, 2017 at 4:13 AM, bartc wrote: > > >>> So what's the excuse for an unresponsive text display in 2017? >> >> >> Got it. You

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 6:18 AM, bartc wrote: >> I don't know if anybody has seen a market/need for an interactive sort >> program, but there's nothing preventing you from writing one. > > > For sort, there is no real need. You use a text editor to create your data. > Then use existing file-based s

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 7:32 AM, bartc wrote: > On 06/10/2017 20:21, Chris Angelico wrote: >> >> On Sat, Oct 7, 2017 at 5:51 AM, bartc wrote: > > >>> If you're stuck, whip out a tablet computer or smartphone (they should >>> still >>> function

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 10:49 AM, Steve D'Aprano wrote: > On Sat, 7 Oct 2017 01:55 am, Chris Angelico wrote: > >> Since GCC is the GNU Compiler *Collection* > > Today I Learned that gcc doesn't mean "Gnu C Compiler". > > I knew gcc compiles C, C++

Warnings (was Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"])

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 11:19 AM, Steve D'Aprano wrote: > On Sat, 7 Oct 2017 05:33 am, Grant Edwards wrote: > >> On 2017-10-06, Marko Rauhamaa wrote: >> >>> The reason a daemon usually opens dummy file descriptors for the 0, 1 >>> and 2 slots is to avoid accidents. Some library might assume the >>

Re: The "loop and a half"

2017-10-06 Thread Chris Angelico
On Sat, Oct 7, 2017 at 12:50 PM, Steve D'Aprano wrote: > On Sat, 7 Oct 2017 06:21 am, Chris Angelico wrote: > >> I'm not sure what printing to a window or image would mean, or how >> it's useful, but sure. > > Print to window: Print Preview. > >

Re: The "loop and a half"

2017-10-07 Thread Chris Angelico
On Sun, Oct 8, 2017 at 2:06 AM, bartc wrote: > On 07/10/2017 15:45, Grant Edwards wrote: >> Admit it, you're just trolling. > > FFS, NOW what's wrong? > > IF you DO redefine those names, then you DO have to use other means to > terminate. I happen to call those means 'crashing out', because it's l

Re: Introducing the "for" loop

2017-10-07 Thread Chris Angelico
On Sun, Oct 8, 2017 at 3:58 AM, Terry Reedy wrote: > No built-in function is an instance of FunctionType isinstance(compile, FunctionType) > False isinstance(print, FunctionType) > False type(compile) > type(int.bit_length) > > > > FunctionType == function defined by def stat

Re: The "loop and a half"

2017-10-08 Thread Chris Angelico
On Sun, Oct 8, 2017 at 10:22 PM, Paul Moore wrote: > On 8 October 2017 at 11:36, bartc wrote: >> Even with things like building applications (eg. trying to build CPython >> from sources), they are designed from the ground up to be inextricably >> linked to Linux scripts, utilities, makefiles, ins

Re: The "loop and a half"

2017-10-08 Thread Chris Angelico
On Sun, Oct 8, 2017 at 10:46 PM, bartc wrote: > On 07/10/2017 15:40, Steve D'Aprano wrote: >> >> On Sat, 7 Oct 2017 11:54 pm, bartc wrote: >> >>> So my programs that use Escape on Windows needed >>> to use Escape Escape on Linux to get around that. >> >> >> >> Or you could just follow the expected

Re: Python platforms without long long

2017-10-08 Thread Chris Angelico
On Mon, Oct 9, 2017 at 1:31 AM, Peter J. Holzer wrote: > I just stumbled about this note in > https://docs.python.org/3/library/array.html: > > | 2. The 'q' and 'Q' type codes are available only if the platform C > | compiler used to build Python supports C long long, or, on Windows, > | __int64.

Pandas/dataexplore, how do you get data into them?

2017-10-08 Thread Chris Green
seful. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: The "loop and a half"

2017-10-08 Thread Chris Angelico
On Mon, Oct 9, 2017 at 2:01 AM, bartc wrote: > However as graphics became more mainstream then yes I did adopt some > commonly expected styles (menubars for example). As for Alt-F4, if that > generates a WM_CLOSE message for example, then I would be obliged to deal > with it. Yes, it usually does

Re: The "loop and a half"

2017-10-08 Thread Chris Angelico
On Mon, Oct 9, 2017 at 3:37 AM, Stefan Ram wrote: > Gregory Ewing writes: >>bartc wrote: >>>Interactive Python requires quit() or exit(), complete with parentheses. >>Er, what? Ctrl-D works fine for me to exit Python when not >>in the midst of entering a block. > > Under Microsoft Windows, one

Re: Pandas/dataexplore, how do you get data into them?

2017-10-08 Thread Chris Green
Stefan Ram wrote: > Chris Green writes: > >How do you load a large table into dataexplore? > > I have not tested the following lines, I have no experience > with "dataexplore", this is just from what I heard: > > from pandastable.app import DataExp

Re: The "loop and a half"

2017-10-08 Thread Chris Angelico
On Mon, Oct 9, 2017 at 3:50 AM, bartc wrote: > Yeah, well, some people like to be sheep, others like to be individuals**. Yeah, well, some people like to be standards-compliant, others like to be irrelevant morons. > I start in computing at a time when an application was the only thing > running

Re: Pandas/dataexplore, how do you get data into them?

2017-10-08 Thread Chris Green
Thomas Jollans wrote: > On 08/10/17 18:02, Chris Green wrote: > > I am looking at dataexplore and Pandas, they look as if they may > > provide useful tools but at the moment I can't quite understand how > > you get data into them. > > > > How do y

Re: The "loop and a half"

2017-10-08 Thread Chris Angelico
On Mon, Oct 9, 2017 at 3:35 PM, Mikhail V wrote: >> Have you ever worked on a slow remote session where a GUI is >> completely impracticable (or maybe even unavailable), and redrawing >> the screen is too expensive to do all the time? > > So where does the redrawing happen? The machine youre sitti

Re: The "loop and a half"

2017-10-08 Thread Chris Angelico
On Mon, Oct 9, 2017 at 4:17 PM, Ian Kelly wrote: > On Sun, Oct 8, 2017 at 10:49 PM, Chris Angelico wrote: >> On Mon, Oct 9, 2017 at 3:35 PM, Mikhail V wrote: >>>> Have you ever worked on a slow remote session where a GUI is >>>> completely impracticable

Re: on = style

2017-10-08 Thread Chris Angelico
On Mon, Oct 9, 2017 at 5:40 PM, Abdur-Rahmaan Janhangeer wrote: > hi just a quick question, why is > > my_pens = 4 > my_pencils = 5 > > is preffered to > > my_pens = 4 > my_pencils = 5 > > *referring to = symbol alignment Because when you add a new variable: my_mousepads = 6 you then have t

Re: The "loop and a half"

2017-10-09 Thread Chris Angelico
On Mon, Oct 9, 2017 at 7:05 PM, Mikhail V wrote: > The first thing a developer should provide - the keys and mouse input > should be > *customizable* by the user. It is so by most serious application I have > ever used. And they most certainly are. Often, in something in the host platform. For in

Re: The "loop and a half"

2017-10-09 Thread Chris Angelico
On Mon, Oct 9, 2017 at 8:15 PM, alister via Python-list wrote: > On Mon, 09 Oct 2017 08:00:34 +0200, Lele Gaifax wrote: > >> Chris Angelico writes: >> >>>> Or you could use a GUI editor that runs locally and has the capability >>>> to edit file

Re: The "loop and a half"

2017-10-09 Thread Chris Angelico
On Mon, Oct 9, 2017 at 8:44 PM, Mikhail V wrote: >> ... The server may not be able to >> (it's a server, why would anyone install a GUI on it?) > > If I ever work on it (locally) why would I want a GUI on it? (Presuming you mean "wouldn't" here) > o_O I'm not sure if I'm getting you. > You mea

Re: The "loop and a half"

2017-10-09 Thread Chris Angelico
On Mon, Oct 9, 2017 at 11:43 PM, bartc wrote: > On 09/10/2017 05:49, Chris Angelico wrote: > >> Generally, my preferred editor is nano, since it lives within those >> requirements but still has a decent UI. It's not always available >> though, and it's useful to

Re: Is there a way to globally set the print function separator?

2017-10-09 Thread Chris Angelico
On Tue, Oct 10, 2017 at 7:40 AM, John Black wrote: > In article , > [email protected] says... >> >> John Black wrote: >> >> > I want sep="" to be the default without having to specify it every time I >> > call print. Is that possible? >> >> No, but you can replace the print function with your own:

Re: pathlib PurePosixPath

2017-10-10 Thread Chris Angelico
On Tue, Oct 10, 2017 at 6:21 PM, Sayth Renshaw wrote: > Hi > > How do I create a valid file name and directory with pathlib? > > When I create it using PurePosixPath I end up with an OSError due to an > obvously invlaid path being created. You're on Windows. The rules for POSIX paths don't apply

Re: pathlib PurePosixPath

2017-10-10 Thread Chris Angelico
On Tue, Oct 10, 2017 at 8:22 PM, Tim Golden wrote: > On 2017-10-10 08:29, Chris Angelico wrote: >> >> On Tue, Oct 10, 2017 at 6:21 PM, Sayth Renshaw >> wrote: >>> >>> Hi >>> >>> How do I create a valid file name and directory with pathl

Re: pathlib PurePosixPath

2017-10-10 Thread Chris Angelico
On Tue, Oct 10, 2017 at 8:56 PM, Tim Golden wrote: >> My understanding of the document you linked to >> is that the colon still has special meaning, and thus you can't use it >> in arbitrary file names. > > > In fact its presence in that filename creates a (usually hidden) data stream > piggybacke

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread Chris Angelico
On Thu, Oct 12, 2017 at 12:16 AM, Marko Rauhamaa wrote: > Rhodri James : > >> C++ is designed, true, but well designed? It has a fundamental flaw; >> it wants to be both a high-level language and compatible with C, under >> the mistaken impression that C is a high level language. Since C is >> act

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread Chris Angelico
On Thu, Oct 12, 2017 at 1:14 AM, bartc wrote: > Python, maybe. C syntax isn't as painful as C++ but I still have a lot of > trouble with it. (Eg. the variable declaration 'char(*(*x[3])())[5]'. The > name of the variable can be found lurking in that lot somewhere, but what's > the type?) Not so co

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread Chris Angelico
On Thu, Oct 12, 2017 at 2:43 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> The places where C++ is not a superset of C are mostly things you >> wouldn't want to be doing anyway. You can generally take C code and >> compile it with a C++ compiler, and it'll h

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread Chris Angelico
On Thu, Oct 12, 2017 at 5:22 AM, Grant Edwards wrote: > On 2017-10-11, bartc wrote: >> On 11/10/2017 15:36, Chris Angelico wrote: >>> On Thu, Oct 12, 2017 at 1:14 AM, bartc wrote: >>>> Python, maybe. C syntax isn't as painful as C++ but I still have a lo

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread Chris Angelico
On Thu, Oct 12, 2017 at 5:35 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Thu, Oct 12, 2017 at 2:43 AM, Marko Rauhamaa wrote: >>> That is not immediately all that significant but points to subtle >>> incompatibilities between the data models of C and C++. &g

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread Chris Angelico
On Thu, Oct 12, 2017 at 3:29 AM, Rhodri James wrote: > On 11/10/17 15:36, Chris Angelico wrote: >> >> On Thu, Oct 12, 2017 at 1:14 AM, bartc wrote: >>> >>> Python, maybe. C syntax isn't as painful as C++ but I still have a lot of >>> trouble with

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread Chris Angelico
On Thu, Oct 12, 2017 at 7:07 AM, Bill wrote: > Mikhail V wrote: > > [...] I'm not here to "cast stones", I like Python. I just think > that you shouldn't cast stones at C/C++. Not while PHP exists. There aren't enough stones in the world... >>> PHP seems (seemed?) popul

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread Chris Angelico
On Thu, Oct 12, 2017 at 7:42 AM, Ben Bacarisse wrote: > Bill writes: > >> Mikhail V wrote: >> [...] I'm not here to "cast stones", I like Python. I just think >> that you shouldn't cast stones at C/C++. > Not while PHP exists. There aren't enough stones in the world... > PHP

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread Chris Angelico
On Thu, Oct 12, 2017 at 9:44 AM, Ben Bacarisse wrote: > Chris Angelico writes: >> Check out Django and Flask, the two most popular ways. I quite like >> Flask. > > I see. Both appear to be frameworks (I'd heard of Django). Do you know > if they widely available

Re: OT: MPC-HC project ending? [Re: Lies in education [was Re: The "loop and a half"]]

2017-10-11 Thread Chris Angelico
On Thu, Oct 12, 2017 at 11:38 AM, boB Stepp wrote: > On Wed, Oct 11, 2017 at 4:45 PM, Mikhail V wrote: > >> >> PS Off-topic: >> I have a related observation regarding popularity of software. >> There is such a program "VLC", which is a video player. Some would >> think it is sort of best free pla

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread Chris Angelico
On Thu, Oct 12, 2017 at 11:55 AM, Ben Bacarisse wrote: > Chris Angelico writes: >> it binds your URLs to >> the concrete file system. That may not seem like too much of a >> problem, but it's a pretty big limitation; you can't have URLs like >> "https:

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread Chris Angelico
On Thu, Oct 12, 2017 at 12:19 PM, Ben Bacarisse wrote: > Chris Angelico writes: > >> On Thu, Oct 12, 2017 at 11:55 AM, Ben Bacarisse wrote: >>> Chris Angelico writes: >>>> it binds your URLs to >>>> the concrete file system. That may not seem like

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Chris Angelico
On Thu, Oct 12, 2017 at 6:22 PM, Marko Rauhamaa wrote: > Grant Edwards : > >> I like [const qualifiers] in C because it allows the linker to place >> them in ROM with the code. It also _sometimes_ provides useful >> diagnostics when you pass a pointer to something which shouldn't be >> modified to

Re: Want to write a python code for sending and receiving frames over wifi/wlan0 using python

2017-10-12 Thread Chris Angelico
On Thu, Oct 12, 2017 at 7:08 PM, T Obulesu wrote: > Hello all, I want to send some frames defined by me{Example, > [0x45,0x43,0x32]} to the raspberry pi from any macine(Desktop/Laptop/other > raspberry pi). But I want to send those frames over wifi or use wlan0 using > python Any suggestions? >

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Chris Angelico
On Thu, Oct 12, 2017 at 7:32 PM, Thomas Jollans wrote: > On 2017-10-12 07:31, Chris Angelico wrote: >> On Thu, Oct 12, 2017 at 12:19 PM, Ben Bacarisse wrote: >>> Provided some early part of the URL is handled by PHP, the rest of the >>> URL path is provided to

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Chris Angelico
On Thu, Oct 12, 2017 at 8:20 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Thu, Oct 12, 2017 at 6:22 PM, Marko Rauhamaa wrote: >>> Additionally, you can launder any constant string into a nonconstant >>> string with strstr(3): >>> >>> co

Re: OT: MPC-HC project ending? [Re: Lies in education [was Re: The "loop and a half"]]

2017-10-12 Thread Chris Angelico
On Thu, Oct 12, 2017 at 8:12 PM, Thomas Jollans wrote: > On 2017-10-12 02:51, Chris Angelico wrote: >> If it wants new life, it's probably going to need a Linux version, >> because that's where a lot of developers hang out. The reality is that >> open source dev

Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-12 Thread Chris Angelico
On Fri, Oct 13, 2017 at 1:09 AM, Ben Bacarisse wrote: > Chris Angelico writes: > >> On Thu, Oct 12, 2017 at 7:32 PM, Thomas Jollans wrote: >>> On 2017-10-12 07:31, Chris Angelico wrote: >>>> On Thu, Oct 12, 2017 at 12:19 PM, Ben Bacarisse >>>> wro

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-12 Thread Chris Angelico
On Fri, Oct 13, 2017 at 10:14 AM, Ben Bacarisse wrote: > Chris Angelico writes: >> I abbreviated that down to nothing, but since you ask, here's a really >> REALLY simple run-down of how to use Heroku: > > I think I see what you mean now. You meant no configuration i

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Chris Angelico
On Fri, Oct 13, 2017 at 4:16 PM, Steve D'Aprano wrote: > On Fri, 13 Oct 2017 03:37 pm, Gregory Ewing wrote: > >> If the compiler can tell where p is initially pointing, it could >> put the pointer in read-only memory. > > If it's read-only, how can the compiler write to it? > > > (I come from the

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread Chris Angelico
On Fri, Oct 13, 2017 at 4:28 PM, Gregory Ewing wrote: > Grant Edwards wrote: >> >> On 2017-10-13, Stefan Ram wrote: >> >>> 1 byte >>> >>> addressable unit of data storage large enough to hold >>> any member of the basic character set of the execution >>> environment« >>> >>>

Re: Return str to a callback raise a segfault if used in string formating

2017-10-13 Thread Chris Angelico
On Fri, Oct 13, 2017 at 4:46 PM, Vincent Vande Vyvre wrote: > Simplified code: > > ---%<-- > class Foo: > tasks = [] > def process(self, *args): > # process with the file > # save result on disk with a new name > self.out_file

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 12:00 AM, bartc wrote: > Even if data is actually in write-protected memory, attempts to write to it > will cause a crash. On my home-made system, they just did nothing. Much more > graceful. The novice thinks his job is to stop the program from crashing. The expert knows

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 12:51 AM, bartc wrote: > On 13/10/2017 14:16, Chris Angelico wrote: >> >> On Sat, Oct 14, 2017 at 12:00 AM, bartc wrote: >>> >>> Even if data is actually in write-protected memory, attempts to write to >>> it >>> will c

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 1:32 AM, Steve D'Aprano wrote: > It seems to me that you're not talking about ROM at all, but ordinary RAM. > Then what do you mean by "read only"? A block of memory with a flag that > says "unprivileged processes are prohibited from writing here"? > > (That's also not a rh

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 6:32 AM, Peter J. Holzer wrote: > On 2017-10-13 14:51, Chris Angelico wrote: >> On Sat, Oct 14, 2017 at 1:32 AM, Steve D'Aprano >> wrote: >>> It seems to me that you're not talking about ROM at all, but ordinary RAM. >>> Then

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 8:42 AM, Ben Bacarisse wrote: > Chris Angelico writes: > >> On Fri, Oct 13, 2017 at 10:14 AM, Ben Bacarisse wrote: >>> Chris Angelico writes: >>>> I abbreviated that down to nothing, but since you ask, here's a really >>&g

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 9:02 AM, Grant Edwards wrote: > On 2017-10-13, Chris Angelico wrote: > > [regarding PHP vs Python capable web-hosting services] > >> Thing is, that's exactly the same for both languages these days. You >> can get cheap (even zero-dollar) hosti

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 2:46 PM, Steve D'Aprano wrote: > On Fri, 13 Oct 2017 09:47 pm, Marko Rauhamaa wrote: > >> "Peter J. Holzer" : >> >>> On 2017-10-13 05:28, Gregory Ewing wrote: Not only does "byte" not always mean "8 bits", but "char" isn't always short for "character"... >>> >>>

Re: Lies in education [was Re: The "loop and a half"]

2017-10-14 Thread Chris Angelico
thought to actually answer my question > until perhaps a dozen posts later, when Chris more-or-less said: > > - the compiler doesn't, but the program loader does; > > - its not so much read-only memory as write-protected memory: > privileged code can still write to it. > >

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-14 Thread Chris Angelico
On Sat, Oct 14, 2017 at 10:16 PM, Ben Bacarisse wrote: > "Peter J. Holzer" writes: >> Which probably boils down to the question: Why did providers offer PHP >> and not Python? One reason might be that at the time no suitable web >> framework for Python existed (Zope was released in 1999, and I re

Re: Best practise for passing time as arguments

2017-10-14 Thread Chris Angelico
On Sun, Oct 15, 2017 at 5:20 AM, Marko Rauhamaa wrote: > Thomas Jollans : > >> When working with time zones, the standard library needs a little help. >> Luckily, there's a module for that. https://pypi.python.org/pypi/pytz > > Even better: > >sudo dnf install python3-pytz How is that better?

Re: Best practise for passing time as arguments

2017-10-14 Thread Chris Angelico
On Sun, Oct 15, 2017 at 7:57 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Sun, Oct 15, 2017 at 5:20 AM, Marko Rauhamaa wrote: >>> Even better: >>> >>>sudo dnf install python3-pytz >> >> How is that better? It's the same thing,

Re: Best practise for passing time as arguments

2017-10-14 Thread Chris Angelico
On Sun, Oct 15, 2017 at 8:15 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> * You get into the habit of posting distro-specific (not just >> OS-specific) commands to global mailing lists. > > And? I don't mind you posting the instructions for any other Li

Re: An endless loop

2017-10-15 Thread Chris Angelico
On Sun, Oct 15, 2017 at 9:15 PM, bartc wrote: > On 15/10/2017 03:10, Stefan Ram wrote: >> >>I made an error I made a thousand times before. >> >>I had programmed an endless loop. >> >>But never did I see before so clear why it's called >>an endless loop. (Tested in IDLE.) >> >> fro

Re: how to read in the newsreader

2017-10-15 Thread Chris Angelico
On Mon, Oct 16, 2017 at 3:19 PM, Andrew Z wrote: > Michael, that's what i use too - gmail. But i get the digest only and can't > really reply that way. i was hoping to get the mail.python.org list Turn off digests then. Easy! ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: how to read in the newsreader

2017-10-16 Thread Chris Green
7;t that useful anyway. > The mostly very silly spam is trivial to filter with some very simple rules, most newsreaders have easy ways to specify subjects and/or senders to ignore. I have (I think) just three or four rules that eliminate just about all the junk. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: how to read in the newsreader

2017-10-16 Thread Chris Green
that matter) I use mutt which is also a text mode program. It makes reading mailing lists easy because it provides threading etc. I use like I use tin, alway on my desktop machine using ssh where necessary. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: how to read in the newsreader

2017-10-16 Thread Chris Green
Marko Rauhamaa wrote: > Chris Green : > > > I read newsgroups using tin, a text-mode/command line newsreader. I > > always run tin on my home desktop machine, even if I'm away from home > > by using ssh. So I maintain my settings that way. By the way tin *is* >

Re: why del is not a function or method?

2017-10-16 Thread Chris Angelico
On Tue, Oct 17, 2017 at 3:07 AM, bartc wrote: > On 16/10/2017 16:58, Stefan Ram wrote: >> >> Xue Feng writes: >>> >>> I wonder why 'del' is not a function or method. >> >> >>Assume, >> >> x = 2. >> >>When a function »f« is called with the argument »x«, >>this is written as >> >> f( x

Re: why del is not a function or method?

2017-10-16 Thread Chris Angelico
On Tue, Oct 17, 2017 at 3:18 AM, Stefan Ram wrote: > bartc writes: >>What about del team[2]? > > All arguments of a call are evaluated before the callable > called then is incarnated with the values obtained. Assume, > »team[ 2 ]« is bound to »8«. Then, the call > > f( team[ 2 ])« > > is

Re: Logging module stopped working

2017-10-16 Thread Chris Angelico
On Tue, Oct 17, 2017 at 3:06 PM, llanitedave wrote: > I'm building an application that contains some long-running operations in a > separate thread from the user interface. I've been using the logging module > writing logging.info() statements to a .log file to keep track of the data > interac

Re: why del is not a function or method?

2017-10-17 Thread Chris Angelico
On Wed, Oct 18, 2017 at 3:19 AM, bartc wrote: > On 17/10/2017 16:44, Terry Reedy wrote: > >> In CPython left-hand expressions are not merely quoted for runtime >> evaluation and use. They are parsed at compile time and compiled to almost >> normal bytecode. The difference is that a load bytecode

Re: What happens when a __call__ function is defined in both class and object ?

2017-10-19 Thread Chris Angelico
On Thu, Oct 19, 2017 at 7:11 PM, ast wrote: > Hello, please have a look at following code snippet > (python 3.4.4) > > class Test: > >a = 1 > >def __init__(self): >self.a = 2 >self.f = lambda : print("f from object") >self.__call__ = lambda : print("__call__ from ob

Re: What happens when a __call__ function is defined in both class and object ?

2017-10-19 Thread Chris Angelico
On Thu, Oct 19, 2017 at 7:24 PM, Chris Angelico wrote: > On Thu, Oct 19, 2017 at 7:11 PM, ast wrote: >> Hello, please have a look at following code snippet >> (python 3.4.4) >> >> class Test: >> >>a = 1 >> >>def __init__(self): >&g

Re: efficient way to get a sufficient set of identifying attributes

2017-10-19 Thread Chris Angelico
On Fri, Oct 20, 2017 at 4:21 AM, Stefan Ram wrote: > Dennis Lee Bieber writes: >>Interesting -- that is coming out to be 2^size - 1, which will sure speed >>up calculation for larger sets rather than doing all the factorial stuff. > > A set of size n has 2^n subsets. > > We exclude the empty

Re: Application and package of the same name

2017-10-19 Thread Chris Angelico
On Fri, Oct 20, 2017 at 7:09 AM, Skip Montanaro wrote: >> My immediate reaction is "you shouldn't name your main program and >> your package the same". It's not a pattern I've seen commonly used. >> >> However, the approaches I've seen used (a __main__.py inside the >> package, so you can execute

Re: Efficient counting of results

2017-10-19 Thread Chris Angelico
On Fri, Oct 20, 2017 at 12:18 PM, Steve D'Aprano wrote: > On Fri, 20 Oct 2017 05:28 am, Israel Brewster wrote: >> So if the date of >> the first record was today, t1 was on-time, and t2 was 5 minutes late, then >> I would need to increment ALL of the following (using your data structure >> from ab

Re: grapheme cluster library

2017-10-20 Thread Chris Angelico
On Sat, Oct 21, 2017 at 3:25 PM, Stefan Ram wrote: > Rustom Mody writes: >>Is there a recommended library for manipulating grapheme clusters? > > The Python Library has a module "unicodedata", with functions like: > > |unicodedata.normalize( form, unistr ) > | > |Returns the normal form »form«

Re: choice of web-framework

2017-10-22 Thread Chris Angelico
On Sun, Oct 22, 2017 at 9:24 PM, Patrick Vrijlandt wrote: > Hello list, > > I would like your recommendation on the choice of a web framework. > > The project is completely new, there are no histories to take into account > (current solutions are paper-based). The website involves questionnaires >

Re: choice of web-framework

2017-10-22 Thread Chris Warrick
18n support available for when you need it * it’s a modern, friendly web framework If you went with Flask, you’d end up with a pile of plugins (for auth, for databases, for other things) and reimplement half of Django, badly. -- Chris Warrick <https://chriswarrick.com/> PGP: 5EAAEA16 -- https://mail.python.org/mailman/listinfo/python-list

Re: choice of web-framework

2017-10-22 Thread Chris Warrick
On 22 October 2017 at 13:25, Lele Gaifax wrote: > Chris Warrick writes: > >> Zope is effectively dead these days. > > Except it's alive and kicking: https://blog.gocept.com/ > > :-) > > ciao, lele. A few people still care, sure. But how alive is a proj

Re: choice of web-framework

2017-10-22 Thread Chris Angelico
On Sun, Oct 22, 2017 at 10:34 PM, Chris Warrick wrote: > On 22 October 2017 at 13:25, Lele Gaifax wrote: >> Chris Warrick writes: >> >>> Zope is effectively dead these days. >> >> Except it's alive and kicking: https://blog.gocept.com/ >> >&

Re: choice of web-framework

2017-10-22 Thread Chris Warrick
On 22 October 2017 at 13:48, Chris Angelico wrote: > On Sun, Oct 22, 2017 at 10:34 PM, Chris Warrick wrote: >> On 22 October 2017 at 13:25, Lele Gaifax wrote: >>> Chris Warrick writes: >>> >>>> Zope is effectively dead these days. >>> >>&g

Re: choice of web-framework

2017-10-22 Thread Chris Angelico
On Mon, Oct 23, 2017 at 12:26 AM, Patrick Vrijlandt wrote: > Op 22-10-2017 om 14:05 schreef Tim Chase: > >> I'm not sure what "version control is required" means in this >> context. Is this version-control of the users' answers? Or >> version-control of the source code. If it's the source code,

Re: Modern website

2017-10-22 Thread Chris Angelico
On Mon, Oct 23, 2017 at 2:21 AM, Andrew Z wrote: > I realize the following has little todo with python per se. But i hope to > get a guidance on how these types of tasks are done nowadays. > > The task: > Ive been asked to create an integration process. That is a few webpages > with questioneer w

Re: Compression of random binary data

2017-10-23 Thread Chris Angelico
On Mon, Oct 23, 2017 at 8:06 PM, wrote: > Ridiculous? Ludicrous?? > > Harsh words! First let me clarify before you lump this in with perpetual > motion, or cold fusion. It is a mapping solution to compress ANY i repeat ANY > random file with numbers of only 0 - 9 such as are in the million rand

Re: Compression of random binary data

2017-10-23 Thread Chris Angelico
On Mon, Oct 23, 2017 at 8:32 PM, wrote: > According to this website. This is an uncompressable stream. > > https://en.m.wikipedia.org/wiki/Incompressible_string > > 12344321 > > It only takes seven 8 bit bytes to represent this That page says nothing about using a byte to represent each

<    36   37   38   39   40   41   42   43   44   45   >