Re: Old Man Yells At Cloud

2017-09-18 Thread Gregory Ewing
Dennis Lee Bieber wrote: Pascal provides print()/println() [okay, not /statements/ but /procedures/] Actually write/writeln, and although they used parens like procedures, they had special syntax for output formatting that wasn't available to user-defined procedures, so they were at least as sp

Re: Even Older Man Yells At Whippersnappers

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

Re: Even Older Man Yells At Whippersnappers

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

Re: Call by binding [was Re: [Tutor] beginning to code]

2017-09-24 Thread Gregory Ewing
Dennis Lee Bieber wrote: "Binding" itself tends to be Python specific terminology -- in that it is the parameter /name/ that gets bound/attached to the argument /object/. It is the same method as used in any Python "assignment" statement, Which is why I think "call by assignment" would

Re: Call by binding [was Re: [Tutor] beginning to code]

2017-09-24 Thread Gregory Ewing
Dennis Lee Bieber wrote: Though "assignment" differs so much between languages That's the point of the term -- it's the same as whatever assignment does in the language concerned. This is true of *every* language I know of that uses the term "call by value" in its official documentatio

Re: Call by binding [was Re: [Tutor] beginning to code]

2017-09-24 Thread Gregory Ewing
Steve D'Aprano wrote: I think that suffers from the same problem as "call by binding" -- assignment is too general a word. If you're learning a new language, you're almost certainly going to learn how assignment works in that language before you get as far as worrying about parameter passing. I

Re: Grumpy-pants spoil-sport [was Re: [Tutor] beginning to code]

2017-09-25 Thread Gregory Ewing
Steve D'Aprano wrote: Or perhaps I should say: I disintegrate it really snooze to pyramid running when the ribbons they apply to sandwiches are not the same as the sleep I use. You could say that, and nobody would care much. If you insisted that your personal interpretation of those

Re: Call by binding [was Re: [Tutor] beginning to code]

2017-09-25 Thread Gregory Ewing
Neil Cerutti wrote: The quest to find a succinct way to categorize Python's argument passing for non-Python programmers strikes me as a sincere effort to to simplify something that just isn't simple. I don't see how it's useful to do that in the first place. Under what circumstances would you f

Re: [Tutor] beginning to code

2017-09-25 Thread Gregory Ewing
Antoon Pardon wrote: It also says: This typically means that the function can modify the variable used as argument, something Python can do that. No, it can't. It can modify the *object* bound to the variable, but *not* the variable itself. If you think it can, then you're misunderstanding wha

Re: Calling methods without objects?

2017-09-25 Thread Gregory Ewing
Thomas Jollans wrote: When an object is constructed from a class, all functions in the class are turned into method objects that refer back to the original object. That's not quite true. Nothing is done to the methods at the time an instance is created; rather, a bound method object is created

Re: Printing a Chunk Of Words

2017-09-26 Thread Gregory Ewing
Ben Bacarisse wrote: Think functional! This is 257 characters: 250 chars, 17 shorter than the text it produces: a=[];o=[];n=[];A=list.append for b in range(3,-1,-1): x=bool(b>>1);y=bool(b&1);A(a,"%s and %s is %s"%(x,y,x and y));A(o,"%s or %s is %s"%(x,y,x or y)) if x:A(n,"not %s is %s"%(y

Re: Boolean Expressions

2017-09-26 Thread Gregory Ewing
Cai Gengyang wrote: So does that mean that the way 'and' works in Python is that both terms must be True (1) for the entire expression to be True ? Why is it defined that way, weird ? It's not weird, it's the normal meaning of "and" in English. Do I have purple hair? No. Do I have three nostri

Re: Beginners and experts (Batchelder blog post)

2017-09-28 Thread Gregory Ewing
Chris Angelico wrote: finding the bug is basically searching through a problem space of all things that could potentially cause this symptom. A novice could accidentally stumble onto the right solution to a tricky bug, or an expert could search a thousand other things and only get to the true cau

Re: Beginners and experts (Batchelder blog post)

2017-09-29 Thread Gregory Ewing
Steve D'Aprano wrote: (1) I know there's a bug in a specific chunk of code, but I'm having trouble working out where. When everything else fails, if I perturb the code a bit (reorder lines, calculate things in a different order, rename variables, etc) it may change the nature of the bug enough fo

Re: Beginners and experts (Batchelder blog post)

2017-09-29 Thread Gregory Ewing
Bill wrote: Don't be afraid to write *really descriptive* output statements, and do so even though you "don't need to". Yeah, often when I'm writing something tricky I'll proactively put in some code to print intermediate state to reassure myself that things are on track. Being more verbose wit

Re: The "loop and a half"

2017-10-04 Thread Gregory Ewing
Steve D'Aprano wrote: On Wed, 4 Oct 2017 01:40 pm, Chris Angelico wrote: You know, you don't HAVE to economize on letters. It's okay to call your parameters "prompt" instead of "prmt". Remember, that's part of your API. Whn u wste vwels lik that, dn't b srprsd whn u run ot n hav shrtg of vwel

Re: The "loop and a half"

2017-10-05 Thread Gregory Ewing
Steve D'Aprano wrote: I recall that the Pascal compiler had to do some clever behind the scenes jiggery-pokery to get eof() to work, but that's what compilers are supposed to do: make common tasks easy for the programmer. Sometimes the jiggery-pokery worked, sometimes it didn't. For example, th

Re: newb question about @property

2017-10-05 Thread Gregory Ewing
bartc wrote: Result? You can't just look at my 'any' class and see what fields it uses. You can't even just look at the static source code. You have to run the program to find out. And it might be different each time. You can usually get a pretty good idea of what attributes a class has by loo

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

2017-10-05 Thread Gregory Ewing
Steve D'Aprano wrote: I've seen (or at least, I remember seeing) diagrams of matter/antimatter annihilation with the two particles coming together and a single photon coming out: a simplified and strictly wrong view of the physics. It may or may not be wrong, depending on what the diagram was s

Re: The "loop and a half"

2017-10-05 Thread Gregory Ewing
bartc wrote: It can be done with an in-band end-of-data code, Then you need some way of escaping that in-band code, in case it happens to equal some of the data you want to sort. And you need to ensure that your input is escaped properly. All of which adds a lot of complexity. Yes, I tried typ

Re: why does memory consumption keep growing?

2017-10-05 Thread Gregory Ewing
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. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: The "loop and a half"

2017-10-08 Thread Gregory Ewing
bartc wrote: Then you might have 'sort' for the non-interactive version, and 'isort' or whatever for the interactive. It's pretty rare that you'd want to use 'sort' interactively, which is why your hypothetical 'isort' doesn't exist. However, it *is* common to use it as part of a pipeline, whi

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

2017-10-08 Thread Gregory Ewing
Steve D'Aprano wrote: You don't think multiple columns in interactive mode is useful? The issue is not whether single vs. multi column mode is better, but whether it should automatically switch based on what kind of thing is connected to stdin. Personally I find that behavour surprising and wo

Re: The "loop and a half"

2017-10-08 Thread Gregory Ewing
bartc wrote: This preprocesses the code and shows the result. Typical programs will have many thousands of lines of output, but it just dumps it to the console. You /have/ to use '>' to use it practically (Windows doesn't really have a working '|' system.) This may be why you're having troubl

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

2017-10-08 Thread Gregory Ewing
Chris Angelico wrote: Hmm, but usually I would expect them still to HAVE those streams, they're just connected to /dev/null or something. I don't think they would actually fail to exist, would they? On unix there's nothing to stop you launching a process with fds 0, 1 and 2 all closed. It would

Re: The "loop and a half"

2017-10-08 Thread Gregory Ewing
Peter J. Holzer wrote: In any case, that -E writes to stdout and -S to file is an inconsistency which looks more like a historical accident than a planned feature to me. A possible reason is that with -S there is an obvious choice for the output file name, i.e. .s, but there is no conventional

Re: The "loop and a half"

2017-10-08 Thread Gregory Ewing
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. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: The "loop and a half"

2017-10-08 Thread Gregory Ewing
Chris Angelico wrote: But personally, I'd have looked for a "print to PS" of some sort, using a gigantic 'page' size, and then convert the PS to PNG. I don't know for certain that I can do the latter conversion, It would be easy on MacOSX. Anything you can print can be sent to a PDF file, and P

Re: The "loop and a half"

2017-10-08 Thread Gregory Ewing
bartc wrote: And within an application, it can do what it likes. With regards to editing, there are some common conventions that I absolutely hate: In other words, you would like all authors of text editors to adopt a certain set of conventions for these things. So much for each program "doing

Re: The "loop and a half"

2017-10-08 Thread Gregory Ewing
Grant Edwards wrote: Which took it from RSX-11. Or probably more specifically from FILES-11. I woldn't be surprised if the enineers at DEC got it from somewhere else before that. Quite possibly it goes back to the very earliest DEC OS that had files, whatever that was. The reason for it was

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

2017-10-11 Thread Gregory Ewing
bartc wrote: While on the subject of C syntax, here are some fun ambiguities: f(x);// call function with arg x, or declare x of type f? a*b; // multiply a by b, or declare b of type pointer to a? (a)*b// multiply a by b, or cast *b to type a? Technically these are not ambiguous i

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

2017-10-11 Thread Gregory Ewing
bartc wrote: tokenrec * (*)[] > the original source and that type is written like this: ref [] ref tokenrec The idiomatic way to write that type in C would be tokenrec ** -- Greg -- https://mail.python.org/mailman/listinfo/python-list

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

2017-10-11 Thread Gregory Ewing
Neil Cerutti wrote: I dig const qualifiers, even though I'm comletely fine with their absence from Python. Out of curiosity, do you have any insights into why you like them in C++, if you don't miss them in Python? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

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

2017-10-11 Thread Gregory Ewing
bartc wrote: The original has an extra pointer so idiomatic C might be more: tokenrec *** I was going by your English description, which when translated into C gives only two pointers. But I think you're right that the C version really has 3 levels of indirection, so the meaning of "array

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

2017-10-11 Thread Gregory Ewing
Ben Bacarisse wrote: That's a different type. I think you mean that a human writing C (rather than bartc's code generator) would probably design the code to use tokenrec ** then I agree, but the latter is not just a different way to write the former. Yes, I was translating his English descript

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

2017-10-12 Thread Gregory Ewing
bartc wrote: (2) Declare data to be put into read-only memory as you say. That's fine with a 'const int * p', but what about a 'int * const p'? If the compiler can tell where p is initially pointing, it could put the pointer in read-only memory. Probably unlikely to happen in real code, though.

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

2017-10-12 Thread Gregory Ewing
Stefan Ram wrote: void i_know_i_was_passed_a_pointer_to_an_array_and_how_many_elements_are_in_it ( char( *a )[ 4 ] ) { for( int i = 0; i < 4; ++i ) putchar( ( *a )[ i ]); } Only because you've statically made the array size part of the type. Your original example didn't do that; presumably it

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

2017-10-12 Thread Gregory Ewing
Grant Edwards wrote: It sure was an education the first I wrote C code for a machine where 1 == sizeof char == sizeof int == sizeof long == sizeof float == sizeof double All were 32 bits. Unicode-ready -- way ahead of its time! -- Greg -- https://mail.python.org/mailman/listinfo/python-list

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

2017-10-12 Thread Gregory Ewing
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« ISO C standard Hmmm. So an architecture with memory addressed in octets and Unicode

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

2017-10-12 Thread Gregory Ewing
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 days when ROM was actual ROM, burned

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

2017-10-12 Thread Gregory Ewing
Chris Angelico wrote: Certainly not. A byte would be 21 bits! Only if 21 bits were *also* an addressable unit of storage in addition to octets. That would be an interesting architecture indeed. If you really wanted that, it might be easier just to make the memory bit-addressable. In which case

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

2017-10-13 Thread Gregory Ewing
Steve D'Aprano wrote: I wasn't questioning where the data came from, but how the compiler can write to READ ONLY MEMORY which might not even be in the same continent as the compiler that generated the code. I thought it would be fairly obvious that by "put it in read-only memory" I meant "arran

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

2017-10-13 Thread Gregory Ewing
Neil Cerutti wrote: I can tell at a glance if a parameter is expected to be modifiable just by looking at the function signature. The question is why doesn't anyone feel the need to be able to do that for Python functions? Whether a function modifies things passed to it is just as important to

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

2017-10-13 Thread Gregory Ewing
Steve D'Aprano wrote: For example, pressing delete when there is no text to delete should just silently do nothing. That's really just a matter of deciding what should count as an error and what shouldn't. You've decided that "pressing Delete when there's nothing to delete does nothing" is a re

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

2017-10-13 Thread Gregory Ewing
alister wrote: in the past for large quantitys the data in a ROM chip was part of the chip etching mask I know, I'm considering the masking process to be a kind of write operation. The Apollo lunar lander used a magnetic core store that was hard coded at the time it was "Woven" I doubt that

Re: Compression of random binary data

2017-10-22 Thread Gregory Ewing
danceswithnumb...@gmail.com wrote: On Monday, July 11, 2016 at 11:52:27 AM UTC-6, jonas.t...@gmail.com wrote: What is to say that you can not do it if the symbolic representation is richer than the symbolic represenatation of the dataset. The more symbols you have in your alphabet, the more

Re: Compression of random binary data

2017-10-23 Thread Gregory Ewing
danceswithnumb...@gmail.com wrote: 12344321 It only takes seven 8 bit bytes to represent this This is not surprising. The theoretical minimum size for 16 arbitrary decimal digits is: log2(10) * 16 = 53.15 bits = 6.64 bytes I think you misunderstand what is meant by the phrase "random

Re: Compression of random binary data

2017-10-23 Thread Gregory Ewing
danceswithnumb...@gmail.com wrote: I did that quite a while ago. 352,954 kb. Are you sure? Does that include the size of all the code, lookup tables, etc. needed to decompress it? But even if you have, you haven't disproved the theorem about compressing random data. All you have is a program t

Re: Compression of random binary data

2017-10-24 Thread Gregory Ewing
danceswithnumb...@gmail.com wrote: Compress this: 4135124325 Bin to dec...still very large 0110 0000 1101 01100101 Wait right there! You're cheating by dropping off leading 0 bits. The maximum value of a 10 digit decimal number is 99, which in hex is 2540be3ff. That's 34

Re: Compression of random binary data

2017-10-24 Thread Gregory Ewing
danceswithnumb...@gmail.com wrote: My 8 year old can decode this back into base 10, Keep in mind that your 8 year old has more information than just the 32 bits you wrote down -- he can also see that there *are* 32 bits and no more. That's hidden information that you're not counting. -- Greg

Re: Compression of random binary data

2017-10-24 Thread Gregory Ewing
Paul Moore wrote: But that's not "compression", that's simply using a better encoding. In the technical sense, "compression" is about looking at redundancies that go beyond the case of how effectively you pack data into the bytes available. There may be a difference in the way the terms are use

Re: Compression of random binary data

2017-10-25 Thread Gregory Ewing
Steve D'Aprano wrote: - Encrypted data looks very much like random noise. There's actually a practical use for that idea. If you can feed the output of an encryption algorithm through a compressor and make it smaller, it means there is a cryptographic weakness in the algorithm that could potent

Re: Compression of random binary data

2017-10-25 Thread Gregory Ewing
Ben Bacarisse wrote: The trouble is a pedagogic one. Saying "you can't compress random data" inevitably leads (though, again, this is just my experience) to endless attempts to define random data. It's more about using terms without making sure everyone agrees on the definitions being used. I

Re: Compression of random binary data

2017-10-25 Thread Gregory Ewing
Lele Gaifax wrote: That's simple enough: of course one empty file would be "music.mp3.zip.zip.zip", while the other would be "movie.avi.zip.zip.zip.zip.zip"... some sort of https://en.wikipedia.org/wiki/Water_memory applied to file system entries :-) If you're allowed to alternate between two c

Re: Compression of random binary data

2017-10-28 Thread Gregory Ewing
Ben Bacarisse wrote: But that has to be about the process that gives rise to the data, not the data themselves. If I say: "here is some random data..." you can't tell if it is or is not from a random source. I can, as a parlour trick, compress and recover this "random data" because I chose it

Re: Compression of random binary data

2017-10-28 Thread Gregory Ewing
danceswithnumb...@gmail.com wrote: 10101011 This equals 61611 This can be represented using 0-6 log2(7)*5= 14.0367746103 bits 11010101 This equals 54543 This can be represented using 0-5 log2(6)*5= 12.9248125036 bits You're missing something fundamental about what entropy is

Re: Compression of random binary data

2017-10-28 Thread Gregory Ewing
Steve D'Aprano wrote: Random data = any set of data generated by "a source of random". Any set of data generated by Grant Thompson? https://www.youtube.com/user/01032010814 -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Compression of random binary data

2017-10-28 Thread Gregory Ewing
Stefan Ram wrote: Well, then one can ask about the entropy of a data source that only is emitting this message. You can, but it's still the *source* that has the entropy, not the message. (And the answer in that case is that the entropy is zero. If there's only one possible message you can

Re: Compression of random binary data

2017-10-28 Thread Gregory Ewing
Steve D'Aprano wrote: I don't think that's right. The entropy of a single message is a well-defined quantity, formally called the self-information. https://en.wikipedia.org/wiki/Self-information True, but it still depends on knowing (or assuming) the probability of getting that particular me

Re: Compression of random binary data

2017-10-29 Thread Gregory Ewing
Chris Angelico wrote: One bit. It might send the message, or it might NOT send the message. The entropy formula assumes that you are definitely going to send one of the possible messages. If not sending a message is a possibility, then you need to include an empty message in the set of messages

Re: Ideas about how software should behave

2017-11-08 Thread Gregory Ewing
Chris Angelico wrote: I don't understand why you would use "yield from" as a synonym for "await". They are not equivalent. Why would you use one in place of the other? As far as I understand, currently the implementations of "yield from" and "await" are sufficiently similar that they *would* be

Re: Ideas about how software should behave

2017-11-09 Thread Gregory Ewing
Chris Angelico wrote: And it's illogical to say "Windows is feeling cranky today" when something inexplicably fails. Everyone understands that to be a tongue-in-cheek metaphor for "Windows is misbehaving in unfathomable ways", and not "the people who wrote Windows were feeling cranky when they

Re: inspecting a callable for the arguments it accepts

2017-11-14 Thread Gregory Ewing
Chris Angelico wrote: wants_one_arg.__code__.co_argcount 1 wants_one_arg.__code__.co_varnames ('x',) That will give you some idea, but it's not foolproof -- e.g. if the function has * or ** arguments, it's impossible to tell in general how many arguments it accepts without studying the c

Re: "help( pi )"

2017-11-17 Thread Gregory Ewing
It *could* be made to work: import math class PI(float): __doc__ = "The circle constant (Note: tau is better :-)" math.pi = PI(math.pi) print(math.pi) help(math.pi) -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: "help( pi )"

2017-11-18 Thread Gregory Ewing
Cameron Simpson wrote: one could change implementations such that applying a docstring to an object _removed_ it from the magic-shared-singleton pool, Is there any need to bother? If another float happened to end up with exactly the same value as pi and got merged with it, the docstring wouldn'

Re: How to Generate dynamic HTML Report using Python

2017-11-21 Thread Gregory Ewing
Michael Torrie wrote: You also have this header set: X-Copyright: (C) Copyright 2017 Stefan Ram. All rights reserved. ... It is forbidden to change URIs of this article into links... What is "changing a URI into a link" meant to mean? Does it include automatically displaying something that l

Re: "help( pi )"

2017-11-21 Thread Gregory Ewing
Cameron Simpson wrote: one could change implementations such that applying a docstring to an object _removed_ it from the magic-shared-singleton pool, That's not sufficient, though. Consider: BUFFER_SIZE = 256 BUFFER_SIZE.__doc__ = "Size of the buffer" TWO_TO_THE_EIGHT = 256 TWO

Re: Python loop and web server (bottle) in the same script (Posting On Python-List Prohibited)

2017-11-24 Thread Gregory Ewing
Lawrence D’Oliveiro wrote: On Friday, November 24, 2017 at 3:27:17 AM UTC+13, zlju...@gmail.com wrote: Looks like I need some sort of parallelization. This is why coroutines were added to Python. Threading is notoriously bug-prone, and is best avoided in most situations. The OP claimed tha

Re: Python loop and web server (bottle) in the same script (Posting On Python-List Prohibited)

2017-11-24 Thread Gregory Ewing
Lawrence D’Oliveiro wrote: I naturally concluded that you didn’t care about updates being momentarily held up by a web request in progress--which would happen anyway if you used threads, at least with CPython. Not necessarily -- the web processing is probably I/O bound, in which case the GIL wi

Re: Stopping an iterator and continuing later

2017-11-26 Thread Gregory Ewing
november nihal wrote: I should have added I switch off the machine when I stop. ( I dont have options to keep it in a sleep mode or in hibernation ) The iterator returned by itertools.combinations is pickleable: >>> from pickle import dumps, loads >>> from itertools import combinations >>> c

Re: connect four (game)

2017-11-26 Thread Gregory Ewing
bartc wrote: (Maybe it's viable if working from an exacting specification that someone else has already worked out.) In my experience, for anything non-trivial that hasn't been done before, these "exacting specifications" never exist. Even if someone handles wnat they *think* are exact and comp

Re: connect four (game)

2017-11-26 Thread Gregory Ewing
Chris Angelico wrote: On Mon, Nov 27, 2017 at 1:11 AM, bartc wrote: > If I had to bother with such systematic tests as you suggest, and finish and sign off everything before proceeding further, then nothing would ever get done. (Maybe it's viable if working from an exacting specification that

Merits of otherwise of test-first (Re: connect four (game))

2017-11-26 Thread Gregory Ewing
bartc wrote: Testing everything comprehensively just wouldn't be useful for me who works on whole applications, whole concepts, not just a handful of functions with well-defined inputs and outputs. I had this experience with Pyrex (the precursor to Cython). The various parts are so interdepend

nospam ** infinity?

2017-11-26 Thread Gregory Ewing
There seems to be a gateway loop of some sort going on. I'm seeing multiple versions of the same posts in comp.lang.python with different numbers of "nospam"s prepended to the email address. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Increasing the diversity of people who write Python

2017-11-28 Thread Gregory Ewing
Chris Angelico wrote: Heh, you mean the term "Windows key"? It's not appropriate on keyboards that don't have an actual Windows logo on it. There are other names for it, but I figured the easiest way was to describe its location :D That doesn't work for all keyboards, though. The one I'm using

Re: we want python software

2017-12-06 Thread Gregory Ewing
Rick Johnson wrote: DOLT: "Programming is easy! Once you learn the langauge, it's just a matter of fill-in-the-blanks." To be fair to this person, for someone who has a natural aptitude for programming, it can be difficult to appreciate how hard it is for people who don't. When I firs

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-14 Thread Gregory Ewing
Rhodri James wrote: Even then there was RiscOS, which divorced file names from file types entirely. As did classic MacOS. I believe MacOSX also has the ability to store a file type as metadata, but it doesn't seem to be used much. -- Greg -- https://mail.python.org/mailman/listinfo/python-li

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-15 Thread Gregory Ewing
Steve D'Aprano wrote: They are still supported (-ish) by OS X, but have been superseded by Uniform Type Identifiers. https://en.wikipedia.org/wiki/Uniform_Type_Identifier I know, what I'm not sure about is how much those are used by apps these days, with so much of the widely used software be

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-15 Thread Gregory Ewing
Grant Edwards wrote: Where are the UTIs stored? Do OS X filesystems still have a "resource fork"? UTIs are stored as extended attributes. Resource forks still exist, but they're deprecated. Things that used to be kept in resource forks are now usually just files in the application bundle -- w

Repeated Names (Repeated Names)

2017-12-15 Thread Gregory Ewing
Anyone else now getting duplicate posts with the sender's name repeated in parentheses? -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Learning

2017-12-16 Thread Gregory Ewing
Bill wrote: In my experience, if they do not have the basic (~pre-calc) math behind them, then learning from a textbook on a programming language, say, may be a bit beyond them. Very little mathematical *knowledge* is needed to get started with programming. You can do a lot of useful things

Re: Repeated Names (Repeated Names)

2017-12-16 Thread Gregory Ewing
The duplicate posts all seem to have this header: Injection-Info: news.bbs.geek.nz; posting-host="M6YmRdZYyc42DJk0lNlt/X4dpP4dzvceBNabSmESN3E"; logging-data="4415"; mail-complaints-to="ab...@news.bbs.geek.nz" I've emailed the administrator of bbs.geek.nz, maybe he will be able to stop

Re: Python Learning

2017-12-17 Thread Gregory Ewing
Bill wrote: In my years of teaching experience, students who came to college without the equivalent of "college algebra" were under-prepared for what was expected of them. This could be simply because it weeds out people who aren't good at the required style of thinking. If that's true, anythi

Re: Python Learning

2017-12-17 Thread Gregory Ewing
Chris Angelico wrote: You do NOT have to go to college before you start creating software. That is also not an opinion; it's a fact backed by a number of proven instances (myself included). Me, too. I started programming (a tiny homebrew machine) when I was about 12 or 13. I was just starting t

Re: [META] Are the list admins honouring Posting Prohibited demands?

2017-12-20 Thread Gregory Ewing
Steve D'Aprano wrote: I notice that Lawrence D’Oliveiro has taken up labelling his posts with a demand that his posts are not to be posted to the Python-List mailing list. I don't think it's a demand. I gather that he has been banned from posting on the Python mailing lists, and I think he's ju

Re: acircle.getCenter() to (x,y) coordinates in Python

2017-12-23 Thread Gregory Ewing
G Yu wrote: The command gives , and I don't know how to determine the x-coordinate of the center from that output. Try this in an interactive session: p = circle.getCenter() help(p) This should give you a page of text showing all the attributes and methods your point object has. Somewhe

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Gregory Ewing
Stefan Ram wrote: BASIC has DEF FN... which /can/ define actual subroutines, limited to expressions. Now, what does this limitation remind me of? The equivalent limitation in Python is nowhere near as bad, since if you outgrow what lambda can do you can always use a def instead. BASIC

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Gregory Ewing
bartc wrote: C doesn't in general have local functions. My own languages don't implement them properly. So I tend not to use them. Looks like there's something circular going on here. You don't have much experience of using local functions, so you don't see a lot of value in them, so you haven'

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Gregory Ewing
bartc wrote: B and C occur twice, so a goto is a quick way to reuse B and C without needing to duplicate code, This only works if the repeated part happens to be at the tail of each case. Any other situation and you're back to local functions. -- Greg -- https://mail.python.org/mailman/listinf

Re: 7z archive reader akin to zipfile?

2018-01-03 Thread Gregory Ewing
Skip Montanaro wrote: I've got some 7z archives I'd like to treat the same way (read specific elements without first extractingg the entire tree to disk). If you're doing this a lot, it might be worth repackaging your 7z files as zip files. -- Greg -- https://mail.python.org/mailman/listinfo/p

Re: Simple graphic library for beginners

2018-01-11 Thread Gregory Ewing
bartc wrote: I downloaded Python 3.7. It didn't work. I uninstalled and reinstalled it, this time with the 'set environment variables' option (to allow 'pip' to be typed from anywhere). I suspect some of your problems might have been caused by 'pip' not using the Python you thought it was usin

Re: Simple graphic library for beginners

2018-01-11 Thread Gregory Ewing
Ned Batchelder wrote: so "pip install pygame" should work. Some people seem so determined to dislike a thing, they cannot be convinced there are solutions to their problems. But it clearly didn't work for bartc at first, and the error messages he got didn't make it at all clear why. You can't

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-11 Thread Gregory Ewing
Robert O'Shea wrote: I wrote a little bytecode interpreter in C (maybe should have upgrade to C++ but not yet) Don't feel bad about that -- IMO, C is perfectly fine for tnis kind of thing, and "upgrading" to C++ would gain you nothing while introducing extra headaches. -- Greg -- https://mail.

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Gregory Ewing
Steven D'Aprano wrote: (The day a programmer posts a WAV file of themselves reading their code out aloud, is the day I turn my modem off and leave the internet forever.) Shh! Don't give them ideas! -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Where has the practice of sending screen shots as source code come from?

2018-01-30 Thread Gregory Ewing
On Mon, 29 Jan 2018 22:41:36 + (UTC), Steven D'Aprano declaimed the following: Its the component of the router that actually handles the telecommunications side of things. Legend has it that once upon a time they were a stand alone device. Even more distant legend suggests that modems ex

Re: Respam levels.

2018-02-13 Thread Gregory Ewing
Mark Lawrence wrote: IIRC the same source for the "nospam" stuff of some months ago which I believe was purely accidental. I have told the site admin about this, hopefully he will be able to put a stop to it again. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-17 Thread Gregory Ewing
boB Stepp wrote: "Python is viewed as a ubiquitous programming language; however, its design limits its potential as a reliable and high performance systems language. Unfortunately, not every developer is aware of its limitations." "The Toyota Corolla is viewed as a ubiquitous family car; howev

Re: matrix multiplication

2018-02-26 Thread Gregory Ewing
Seb wrote: I was wondering is whether there's a faster way of multiplying each row (1x3) of a matrix by another matrix (3x3), compared to looping through the matrix row by row as shown in the code. Just multiply the two matrices together. If A is an nx3 matrix and B is a 3x3 matrix, then C = A

Re: Is there are good DRY fix for this painful design pattern?

2018-03-01 Thread Gregory Ewing
After this thread, the term "docstring" is never going to mean quite the same thing to me again. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-02 Thread Gregory Ewing
Paul Rubin wrote: So you want the programmer to put more head scratching into figuring out which reference should be strong and which should be weak? Also, sometimes weak references don't really solve the problem, e.g. if you have a graph where you can't identify any particular node as a "root"

<    1   2   3   4   5   6   7   8   9   10   >