Re: 'Pygame Module' not working

2021-07-31 Thread Michael F. Stemper
le not found Are you running your program in the parent directory of "assets"? What happens when you go into the python interpreter (REPL) and import pygame followed by executing that function? -- Michael F. Stemper Why doesn't anybody care about apathy? -- https://mail.python.org/mailman/listinfo/python-list

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-06 Thread Michael F. Stemper
mber there at all: >>> s[3::-1] 'kcaJ' >>> Or, it you want to be more explicit, you could separately grab the substring and then reverse it: >>> s[:4][::-1] 'kcaJ' >>> Does any of this help? -- Michael F. Stemper If it isn't running programs and it isn't fusing atoms, it's just bending space. -- https://mail.python.org/mailman/listinfo/python-list

Re: on slices, negative indices, which are the equivalent procedures?

2021-08-13 Thread Michael F. Stemper
shing Company; (c) 1981; Page 125 It also says that zero increments are not supported. (Whew!) -- Michael F. Stemper 87.3% of all statistics are made up by the person giving them. -- https://mail.python.org/mailman/listinfo/python-list

Re: The sqlite3 timestamp conversion between unixepoch and localtime can't be done according to the timezone setting on the machine automatically.

2021-08-31 Thread Michael F. Stemper
/watch?v=-5wpm-gesOY> And amusingly. -- Michael F. Stemper Always remember that you are unique. Just like everyone else. -- https://mail.python.org/mailman/listinfo/python-list

Re: urgent

2021-09-02 Thread Michael F. Stemper
cense" for more information. REPL> import sys # in the original, this line will be messed up REPL> sys.exit(0) # this one, too username@hostname$ -- Michael F. Stemper What happens if you play John Cage's "4'33" at a slower tempo? -- https://mail.python.org/mailman/listinfo/python-list

Re: The sqlite3 timestamp conversion between unixepoch and localtime

2021-09-03 Thread Michael F. Stemper
get information/patches to our North American customers was annoying. [1] <https://www.congress.gov/bill/109th-congress/house-bill/6>, Sec 110 -- Michael F. Stemper If you take cranberries and stew them like applesauce they taste much more like prunes than rhubarb does. -- https://mail.python.org/mailman/listinfo/python-list

Re: on writing a while loop for rolling two dice

2021-09-04 Thread Michael F. Stemper
e do-while, but yeah --- it's not really worth it. Kernighan and Ritchie agree(d) with you. Per _The C Programming Language__: Experience shows that do-while is much less used that while and for. (Second edition, Section 3.6, page 63) -- Michael F. Stemper Outside of a dog, a book is man&#

Re: Question again

2021-09-18 Thread Michael F. Stemper
" or number == "8" or number == "9" or number == "10" : print("I cannot sense any luck today, try again next time") Same here. This is, of course, why comments shouldn't just translate the code into English. They'll get out of synch. Instead, comments should say *why* the code is doing what it does. -- Michael F. Stemper Exodus 22:21 -- https://mail.python.org/mailman/listinfo/python-list

XML Considered Harmful

2021-09-21 Thread Michael F. Stemper
for something that it wasn't designed for? If XML is not the way to package data, what is the recommended approach? -- Michael F. Stemper Life's too important to take seriously. -- https://mail.python.org/mailman/listinfo/python-list

Re: XML Considered Harmful

2021-09-21 Thread Michael F. Stemper
On 21/09/2021 13.49, alister wrote: On Tue, 21 Sep 2021 13:12:10 -0500, Michael F. Stemper wrote: On the prolog thread, somebody posted a link to: <https://dirtsimple.org/2004/12/python-is-not-java.html> One thing that it tangentially says is "XML is not the answer." I read

Re: XML Considered Harmful

2021-09-22 Thread Michael F. Stemper
On 21/09/2021 16.21, Pete Forman wrote: "Michael F. Stemper" writes: On 21/09/2021 13.49, alister wrote: On Tue, 21 Sep 2021 13:12:10 -0500, Michael F. Stemper wrote: It's my own research, so I can give myself the data in any format that I like. as far as I can see the main

Re: XML Considered Harmful

2021-09-22 Thread Michael F. Stemper
On 21/09/2021 19.30, Eli the Bearded wrote: In comp.lang.python, Michael F. Stemper wrote: I've heard of JSON, but never done anything with it. You probably have used it inadvertantly on a regular basis over the past few years. Websites live on it. I used to use javascript when

Re: XML Considered Harmful

2021-09-23 Thread Michael F. Stemper
On 22/09/2021 17.37, Dennis Lee Bieber wrote: On Wed, 22 Sep 2021 09:52:59 -0500, "Michael F. Stemper" declaimed the following: On 21/09/2021 19.30, Eli the Bearded wrote: In comp.lang.python, Michael F. Stemper wrote: How does CSV handle hierarchical data? For instance, I have

Re: XML Considered Harmful

2021-09-23 Thread Michael F. Stemper
On 23/09/2021 12.51, Eli the Bearded wrote: Am 22.09.21 um 16:52 schrieb Michael F. Stemper: On 21/09/2021 19.30, Eli the Bearded wrote: Yes, CSV files can model that. But it would not be my first choice of data format. (Neither would JSON.) I'd probably use XML. Okay. 'Go not to

Re: XML Considered Harmful

2021-09-25 Thread Michael F. Stemper
On 21/09/2021 13.12, Michael F. Stemper wrote: If XML is not the way to package data, what is the recommended approach? Well, there have been a lot of ideas put forth on this thread, many more than I expected. I'd like to thank everyone who took the time to contribute. Most of the re

Re: XML Considered Harmful

2021-09-27 Thread Michael F. Stemper
cates tabular displays that I used through most of my career. Or, did I miss something and others have already produced the data using other tools, in which case you have to read it in at least once/ Well, the "tool" is vi, but this is a good description of what I'm doing. -- Michael

Re: XML Considered Harmful

2021-09-27 Thread Michael F. Stemper
On 25/09/2021 16.48, 2qdxy4rzwzuui...@potatochowder.com wrote: On 2021-09-25 at 15:20:19 -0500, "Michael F. Stemper" wrote: ... For instance, if I modeled a fuel like this: ton 21.96 18.2 and a generating unit

Re: XML Considered Harmful

2021-09-28 Thread Michael F. Stemper
s (or fuels) to a program. Multiple test cases are then just multiple files, all of which are available to multiple programs. You may of course want to save it, perhaps as a log, to show what your program was working on. That's another benefit of having the data in external files. -- Micha

Re: XML Considered Harmful

2021-09-28 Thread Michael F. Stemper
n fact, doing so points me to something written by a guy I worked with back in the 1980s: <http://www2.econ.iastate.edu/classes/econ458/tesfatsion/EconomicDispatchIntroToOptimization.DKirschen2004.LTEdits.pdf> Slide 3 even shows a piecewise-linear curve. -- Michael F. Stemper A preposition i

Re: XML Considered Harmful

2021-09-28 Thread Michael F. Stemper
On 28/09/2021 10.53, Stefan Ram wrote: "Michael F. Stemper" writes: Well, I could continue to hard-code the data into one of the test programs One can employ a gradual path from a program with hardcoded data to an entity sharable by different programs. When I am hurried

Re: XML Considered Harmful

2021-09-28 Thread Michael F. Stemper
paper that a friend of mine is submitting to various journals gets accepted by one of them, I'll end up with a 4 or 5 through him. However, as the months pass, it's looking more like mine will end up NaN. -- Michael F. Stemper Isaiah 58:6-7 -- https://mail.python.org/mailman/listinfo/python-list

Re: XML Considered Harmful

2021-09-29 Thread Michael F. Stemper
On 28/09/2021 18.21, Greg Ewing wrote: On 29/09/21 4:37 am, Michael F. Stemper wrote: I'm talking about something made from tons of iron and copper that is oil-filled and rotates at 1800 rpm. To avoid confusion, we should rename them "electricity comprehensions". Hah! -- Mic

Re: Best way to check if there is internet?

2022-02-25 Thread Michael F. Stemper
On 25/02/2022 06.49, Abdur-Rahmaan Janhangeer wrote: Thanks for the in-between. I really like the Python comunity as, even though it's a 'scripting' language, To me, it's a programming language. In my usage, a "script" is a bunch of OS commands. -- Michael F. S

Re: Best way to check if there is internet?

2022-02-25 Thread Michael F. Stemper
2007. As a side note, if by scripting we mean OS commands, then Python started as a sysadmin language. I never knew this. Where can I read more about this origin? -- Michael F. Stemper If it isn't running programs and it isn't fusing atoms, it's just bending space. -- https:

Re: Best way to check if there is internet?

2022-02-25 Thread Michael F. Stemper
On 25/02/2022 14.30, 2qdxy4rzwzuui...@potatochowder.com wrote: On 2022-02-25 at 13:48:32 -0600, "Michael F. Stemper" wrote: On 25/02/2022 12.07, Abdur-Rahmaan Janhangeer wrote: I have been following language feature proposals from various languages. Some decide to avoid Python&#x

Re: Behavior of the for-else construct

2022-03-03 Thread Michael F. Stemper
used it probably half-a-dozen times. It seems quite elegant to me. -- Michael F. Stemper A preposition is something you should never end a sentence with. -- https://mail.python.org/mailman/listinfo/python-list

Re: Behavior of the for-else construct

2022-03-04 Thread Michael F. Stemper
n binary, and those that can't. 1, 10, many. No problem. Ah, a George Gamow fan. -- Michael F. Stemper Psalm 82:3-4 -- https://mail.python.org/mailman/listinfo/python-list

Re: Behavior of the for-else construct

2022-03-05 Thread Michael F. Stemper
cal, which was probably bigger in Germany and Austria in the 1980s than was C. -- Michael F. Stemper Psalm 94:3-6 -- https://mail.python.org/mailman/listinfo/python-list

Re: Feature Request

2022-03-23 Thread Michael F. Stemper
On 23/03/2022 03.55, Kazuya Ito wrote: Add "trun()" function to Python to truncate decimal part. Which of these should its behavior copy? from math import pi int(pi) 3 pi-int(pi) 0.14159265358979312 -- Michael F. Stemper This post contains greater than 95% post-consume

Re: Initializing error

2018-03-12 Thread Michael F. Stemper
On 2018-03-10 09:41, Harsh Bhardwaj wrote: On Mar 5, 2018 11:16 AM, "Harsh Bhardwaj" wrote: Plz fix this problem for me. I tried every way to fix this. Windows 7(32-bit) That's a pretty bad problem. Fortunately, there is a fix: <http://getlinux.sourceforge.net/> -- Mich

Re: number of loops

2018-03-17 Thread Michael F. Stemper
uesses) print ('good job, you guessed correctly') else: print('nope, you lose') Of course, since you never use this variable for anything, you could also drop it altogether. -- Michael F. Stemper Nostalgia just ain't what it used to be. -- https://mail.python.org/mailman/listinfo/python-list

Re: Simplest way to clobber/replace one populated directory with another?

2018-05-16 Thread Michael F. Stemper
sh script rather than a python program, you could just do: #!/bin/bash rm -r Previous mv Previous Current -- Michael F. Stemper This email is to be read by its intended recipient only. Any other party reading is required by the EULA to send me $500.00. -- https://mail.python.org/mailman/listinfo/python-list

Re: best way to remove leading zeros from a tuple like string

2018-05-20 Thread Michael F. Stemper
quot; ", tuple ) # following space(s) >>> tuple = sub( ",0*", ",", tuple ) # following comma >>> tuple = sub( "\(0*", "(", tuple ) # after opening parend >>> tuple '(128, 20, 8,12, 255)' >>> Or, if you li

Re: How to pass Python command line options (vs arguments) when running script directly vs via Python interpreter?

2018-08-14 Thread Michael F. Stemper
rse. I haven't made the switch myself because argparse appears (upon a cursory reading of the documentation) to muddle the difference between options and arguments. -- Michael F. Stemper Indians scattered on dawn's highway bleeding; Ghosts crowd the young child's fragile eggshell mind. -- https://mail.python.org/mailman/listinfo/python-list

Broken pip

2018-08-28 Thread Michael F. Stemper
-H option: user@host$ sudo -H pip install --upgrade pip Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages (18.0) user@host$ pip --version Traceback (most recent call last): File "/usr/bin/pip", line 9, in from pip import main ImportError: cannot import name main user@host$ -- Michael F. Stemper Galatians 3:28 -- https://mail.python.org/mailman/listinfo/python-list

Re: Broken pip

2018-08-28 Thread Michael F. Stemper
On 2018-08-28 13:19, Larry Martell wrote: > On Tue, Aug 28, 2018 at 2:10 PM, Michael F. Stemper > wrote: >> >> I'm trying to upgrade my pip on Ubuntu 16.04. I appear to have >> buggered things up pretty well. (Details follow) Any suggestions >> on how to u

Re: Broken pip

2018-08-28 Thread Michael F. Stemper
On 2018-08-28 13:45, Chris Angelico wrote: > On Wed, Aug 29, 2018 at 4:37 AM, Michael F. Stemper > wrote: >> On 2018-08-28 13:19, Larry Martell wrote: >>> On Tue, Aug 28, 2018 at 2:10 PM, Michael F. Stemper >>> wrote: >>>> I'm trying to u

Re: Broken pip

2018-08-29 Thread Michael F. Stemper
On 2018-08-29 03:10, Thomas Jollans wrote: > On 2018-08-28 20:10, Michael F. Stemper wrote: >> I'm trying to upgrade my pip on Ubuntu 16.04. I appear to have >> buggered things up pretty well. (Details follow) Any suggestions >> on how to undo this and get everythin

Re: Broken pip

2018-08-31 Thread Michael F. Stemper
On 2018-08-29 16:02, Thomas Jollans wrote: > On 08/29/2018 09:05 PM, Michael F. Stemper wrote: >>> Also, PLEASE use Python 3. Still using Python 2 today is like still >>> using Windows XP in early 2013. >> I'm using the default version for the current relea

Object-oriented philosophy

2018-09-06 Thread Michael F. Stemper
self ): class ConstantImpedance( LoadModel ): def __init__( self, xmlmodel, V ): super().__init__( xmlmodel, V, self.name ) def Resistance( self, V ): def Power( self, V ): def FixedValue( self ): def Update( self, V ): === end revised = -- Michael F. Stemper Thi

Re: Object-oriented philosophy

2018-09-06 Thread Michael F. Stemper
On 2018-09-06 09:34, Marko Rauhamaa wrote: > "Michael F. Stemper" : > >> Since the three classes all had common methods (by design), I >> thought that maybe refactoring these three classes to inherit from >> a parent class would be beneficial. I went ahead and

Re: Object-oriented philosophy

2018-09-06 Thread Michael F. Stemper
On 2018-09-06 09:35, Rhodri James wrote: > On 06/09/18 15:04, Michael F. Stemper wrote: >> Net net is that the only thing that ended up being common was the >> __init__ methods. Two of the classes have identical __init__ >> methods; the third has a superset of that method. The

Re: Object-oriented philosophy

2018-09-06 Thread Michael F. Stemper
On 2018-09-06 10:40, Abdur-Rahmaan Janhangeer wrote: > Also, get someone, preferrable a python engineer to review your code. Sounds like an advertisement to me. -- Michael F. Stemper Why doesn't anybody care about apathy? -- https://mail.python.org/mailman/listinfo/python-list

Re: Object-oriented philosophy

2018-09-06 Thread Michael F. Stemper
On 2018-09-06 12:32, Stefan Ram wrote: > "Michael F. Stemper" writes: >> Is there really any benefit to this change? Yes, I've eliminated >> some (a few lines per class) duplicate code. On the other hand, >> I've added the parent class and the (probably sm

Re: Object-oriented philosophy

2018-09-07 Thread Michael F. Stemper
On 2018-09-06 16:00, MRAB wrote: > On 2018-09-06 21:24, Michael F. Stemper wrote: >> On 2018-09-06 09:35, Rhodri James wrote: >>> Is it worth creating the superclass in Python?  It sounds like it's a >>> bit marginal in your case.  I'm not that seasoned in o

Re: Object-oriented philosophy

2018-09-07 Thread Michael F. Stemper
On 2018-09-07 14:51, Michael F. Stemper wrote: > On 2018-09-06 16:00, MRAB wrote: >> On 2018-09-06 21:24, Michael F. Stemper wrote: >> A word of advice: don't use a "bare" except, i.e. one that doesn't >> specify what exception(s) it should catch. > I

Re: Object-oriented philosophy

2018-09-07 Thread Michael F. Stemper
On 2018-09-07 15:39, MRAB wrote: > On 2018-09-07 20:51, Michael F. Stemper wrote: >> On 2018-09-06 16:00, MRAB wrote: >>> A word of advice: don't use a "bare" except, i.e. one that doesn't >>> specify what exception(s) it should catch. >> >&

Re: Object-oriented philosophy

2018-09-08 Thread Michael F. Stemper
On 2018-09-06 16:04, Stefan Ram wrote: > "Michael F. Stemper" writes: >>> You have a operation »Resistance( V )«. >> Mathematically, that's an operation, I suppose. I tend to think of it >> as either a function or a method. > > I deliberately did n

Re: don't quite understand mailing list

2018-09-08 Thread Michael F. Stemper
s on staff. Sometimes, it was to meet a crunch that was anticipated to be brief. Sometimes, it was to fill an open slot while trying to find somebody to hire for that slot. -- Michael F. Stemper 87.3% of all statistics are made up by the person giving them. -- https://mail.python.org/mailman/listinfo/python-list

Re: Object-oriented philosophy

2018-09-11 Thread Michael F. Stemper
On 2018-09-11 01:59, Marko Rauhamaa wrote: > Rick Johnson : > >> Michael F. Stemper wrote: >>> Object-oriented philosophy >> [...] [...] [...] >> >> So, to make a long story short, you may want to do some >> googling... > > Long story short, Mic

Re: How to achieve pyc only deployment for module in python3.6

2018-10-02 Thread Michael F. Stemper
zzz.c have the following vulnerability." Those guys were (are) *sharp*. [1] <https://www.nerc.com/pa/Stand/Pages/CIPStandards.aspx> [2] <https://www.energy.gov/oe/technology-development/energy-delivery-systems-cybersecurity/national-scada-test-bed> -- Michael F. Stemper Outs

Re: how to match list members in py3.x

2018-11-26 Thread Michael F. Stemper
l > run AFTER the first loop completes, not for each step of the loop, > because you outdented the code. > > Also, you unconditionally add the word, and THEN check if it is in the list. And the first thing that I note is that he checks to see if it is in the list from which it came. -- Michael F.

Re: How to access a folder in a zip file?

2019-01-20 Thread Michael F. Stemper
by one and store > them in a list/array so that I could work with it easily) > > here is the path: home/name/tutorial/prof/ks.zip/projects Are you sure? Could it possibly be: /home/name/tutorial/prof/ks.zip/projects instead? -- Michael F. Stemper What happens if you play John Cage&

Re: How to print out html tags excluding the attributes

2019-07-21 Thread Michael F. Stemper
> for a in tags: > print(a) > > > the output is : > > > > > > > > > But I just want the tag, not the attributes Try this: for a in tags: a = re.sub( " .*>", ">", a ) print(a) (The two statements could be combined.) -- Michael F. Stemper Galatians 3:28 -- https://mail.python.org/mailman/listinfo/python-list

Creating time stamps

2019-07-22 Thread Michael F. Stemper
ime from time import strftime timestamp = datetime.now().strftime( "%Y-%m-%d %H:%M" ) The first seems a little clunky with its accessing of multiple attributes, but the second has an additional import. Is there any reason to prefer one over the other? -- Michael F. Stemper Ther

Re: Creating time stamps

2019-07-22 Thread Michael F. Stemper
On 22/07/2019 15.58, Chris Angelico wrote: > On Tue, Jul 23, 2019 at 6:34 AM Michael F. Stemper > wrote: >> >> I have some code that generates a time-stamp as follows: >> >> from datetime import datetime >> tt = datetime.now() >> timestamp = &qu

Re: Creating time stamps

2019-07-22 Thread Michael F. Stemper
On 22/07/2019 16.00, Stefan Ram wrote: > "Michael F. Stemper" writes: >> The first seems a little clunky with its accessing of multiple >> attributes, but the second has an additional import. Is there >> any reason to prefer one over the o

Re: Definite or indefinite article for non-singletons?

2019-07-28 Thread Michael F. Stemper
ty set..." T is indeed "a" set, but it's the only set that has the same elements as T. Therefore, once you've let T be some specific non-empty set, it is *the* set T. -- Michael F. Stemper Life's too important to take seriously. -- https://mail.python.org/mailman/listinfo/python-list

Re: Boolean comparison & PEP8

2019-07-29 Thread Michael F. Stemper
> > This is a fairly unusual case, though. More commonly, the default > would be None, not False, and "if bar is None:" is extremely well > known and idiomatic. That's certainly how I would have done it until I read your post. But reading it immediately raised the question of why not: def foo( bar=[] ): if len(bar)==0: print( "Pretty short" ) else: print( bar ) return Seems to work just fine. -- Michael F. Stemper Deuteronomy 24:17 -- https://mail.python.org/mailman/listinfo/python-list

Re: Boolean comparison & PEP8

2019-07-29 Thread Michael F. Stemper
On 29/07/2019 12.56, Rob Gaddi wrote: > On 7/29/19 10:44 AM, Michael F. Stemper wrote: >> On 28/07/2019 19.04, Chris Angelico wrote: >>> On Mon, Jul 29, 2019 at 9:48 AM Michael Torrie >>> wrote: >>>> Yet the recommended solution to the problem of wanting a

Style suggestions/critiques

2019-08-20 Thread Michael F. Stemper
l2p2 spattered all over. Although this is simple enough, I find it aesthetically unappealing. Is there some better idiom that I should be using, or is this really in accord with The Zen of Python? [1] (I could have done sets, I suppose, but orientation might be useful at some point.) -- Mich

Re: Style suggestions/critiques

2019-08-23 Thread Michael F. Stemper
On 20/08/2019 21.57, DL Neil wrote: > On 21/08/19 9:11 AM, Michael F. Stemper wrote: >> I recently wrote a couple of modules (more to come) to help me >> use the tikz package in TeX/LaTeX. Since it's all to do with >> drawing, I have a lot of points in R^2. Being uni

Re: 3 cubes that sum to 42

2019-09-08 Thread Michael F. Stemper
truly amazing! In fact, I ended up writing a tiny program to cube its arguments and report the sum. Took about 40 ms to run, no matter the size of the arguments, which tells me that the only cost is the fixed overhead. -- Michael F. Stemper This sentence no verb. -- https://mail.python.org/mailman/listinfo/python-list

Re: Function returns old value

2020-12-17 Thread Michael F. Stemper
ce between that and :set ai and :set noai With newer vims that's rarely necessary though since they can distinguish between input that was pasted and input that was typed. I thought that I was going nuts when I encountered that. Any idea how to defeat such a so-called 'feature"?

Re: Function returns old value

2020-12-19 Thread Michael F. Stemper
On 18/12/2020 00.09, Cameron Simpson wrote: On 17Dec2020 14:22, Michael F. Stemper wrote: On 17/12/2020 03.57, Peter J. Holzer wrote: On 2020-12-17 03:06:32 -, Bischoop wrote: With newer vims that's rarely necessary though since they can distinguish between input that was paste

Re: dayofyear is not great when going into a new year

2021-01-05 Thread Michael F. Stemper
tetime >>> datetime.toordinal(date(2020,1,1)) 737425 >>> datetime.toordinal(date(2021,1,5)) 737795 >>> datetime.toordinal(date(2021,1,5)) - datetime.toordinal(date(2020,1,1)) 370 >>> -- Michael F. Stemper This post contains greater than 95% post-consumer bytes by weight. -- https://mail.python.org/mailman/listinfo/python-list

Re: primitive password cracker

2021-01-09 Thread Michael F. Stemper
#x27;a', 'b', 'c', 'aa', 'ab', 'ac', 'aaa', 'aab', 'aac', 'aba', 'abb', 'abc', 'aca', 'acb', 'acc', 'ba', 'bb', 'bc', 'baa', 'bab', 'bac', 'bba', 'bbb', 'bbc', 'bca', 'bcb', 'bcc', 'ca', 'cb', 'cc', 'caa', 'cab', 'cac', 'cba', 'cbb', 'cbc', 'cca', 'ccb', 'ccc'] >>> words = embiggen(words) >>> len(words) 120 >>> It's obvious that this could be called from a for-loop with no modification, which I believe is what the OP wanted. -- Michael F. Stemper Deuteronomy 24:17 -- https://mail.python.org/mailman/listinfo/python-list

Re: dayofyear is not great when going into a new year

2021-01-09 Thread Michael F. Stemper
e "weekend". Starting on Sunday is weird for us, because then the weekend is split into the first and last day of the week (?) A week is like a piece of string. It has two ends. -- Michael F. Stemper Deuteronomy 24:17 -- https://mail.python.org/mailman/listinfo/python-list

Re: A beginning beginner's question about input, output and . . .

2021-01-12 Thread Michael F. Stemper
- composition of permutations of a set - properties of minimal paths through a C_m x C_n lattice - generating tikz commands for geometric diagrams in TeX documents - unstructured and uneducated exploration of Conway's Game of Life -- Michael F. Stemper 2 Chronicles 19:7 -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: Phases of the moon [was Re: A Moronicity of Guido van Rossum]

2005-10-01 Thread Paul F. Dietz
Bart Lateur wrote: > As a similar example: I've been told by various women independently, > that "there are more babies born near a full moon." That's also a myth. Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expresiveness in a Computer Language?

2005-07-10 Thread Ramon F Herrera
[Peter Barret wrote:] > It may just be me, but I tend to think of a computer language as a > tool for directing computers to perform specific actions. Do we talk > about the expressiveness of a spade? yes, it is just you. :-) Your comparison is a very poor match. How can you even begin to compa

Changing the value of a for loop index on the fly

2005-03-23 Thread Gabriel F. Alcober
Hi! There goes a newbie trouble: for i in range(0, len(subject)): if subject[i] in preps: psubject.append(noun_syn_parser(subject[0:i])) subject[0:i] = [] Since the last line eliminates some elements of the list, I'm wondering if it's somehow possible to change the val

Re: Changing the value of a for loop index on the fly

2005-03-23 Thread Gabriel F. Alcober
Uh! I've not even thought in using a while... Thanks! Lonnie Princehouse wrote: i = 0 while i < len(subject): if subject[i] in preps: psubject.append(noun_syn_parser(subject[0:i])) subject[0:i] = [] i = 0 else: i += 1 Gabriel F. Alcober wrote: Hi! There goes a newbie trou

Re: Changing the value of a for loop index on the fly

2005-03-23 Thread Gabriel F. Alcober
Bengt Richter wrote: On Thu, 24 Mar 2005 02:48:28 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: On Wed, 23 Mar 2005 23:27:54 +0100, "Gabriel F. Alcober" <[EMAIL PROTECTED]> wrote: Hi! There goes a newbie trouble: for i in range(0, len(subject)): if sub

Re: Fast plotting?

2005-04-28 Thread Paul F. Kunz
William Park <[EMAIL PROTECTED]> writes: > Russell E. Owen <[EMAIL PROTECTED]> wrote: > > Can anyone recommend a fast cross-platform plotting package for 2-D > > plots? > > > > Our situation: > > We are driving an instrument that outputs data at 20Hz. Control is via > > an existing Tkinter appl

RESTful API for own python application

2013-02-02 Thread Julio F Schwarzbeck
Howdy folks, I have a couple of questions that imo requires some feedback by the smarts, I'd appreciate any comments you can add to this issue, here's my situation: I am developing an application, the application stores small text snippets (think of something similar to evernote), and it has t

Re: What is a type error?

2006-07-15 Thread Chris F Clark
Joachim Durchholz wrote: > > You can have aliasing without pointers; e.g. arrays are fully sufficient. > If i = j, then a [i] and a [j] are aliases of the same object. "Marshall" <[EMAIL PROTECTED]> writes: > I am having a hard time with this very broad definition of aliasing. > Would we also

Re: What is a type error?

2006-07-16 Thread Chris F Clark
"Marshall" <[EMAIL PROTECTED]> wrote: > In general, I feel that "records" are not the right conceptual > level to think about. Unfortunately, they are the right level. Actually,the right level might even be lower, the fields within a record, but that's moving even farther away from the direction

Re: ANN: Quest for the Holy Grail (a PyGame game)

2006-07-31 Thread Horst F. JENS
very nice game, i like it. -Horst -- http://mail.python.org/mailman/listinfo/python-list

An oddity in list comparison and element assignment

2006-06-01 Thread michael . f . ellis
The following script puzzles me. It creates two nested lists that compare identically. After identical element assignments, the lists are different. In one case, a single element is replaced. In the other, an entire column is replaced. ---

Re: An oddity in list comparison and element assignment

2006-06-01 Thread michael . f . ellis
Hi Alex, With all due respect to your well-deserved standing in the Python community, I'm not convinced that equality shouldn't imply invariance under identical operations. Perhaps the most fundamental notion is mathematics is that the left and right sides of an equation remain identical after any

Re: An oddity in list comparison and element assignment

2006-06-01 Thread michael . f . ellis
oops! last sentence of 2nd paragraph in previous message should read "If my expectation is NOT met ..." -- http://mail.python.org/mailman/listinfo/python-list

Re: An oddity in list comparison and element assignment

2006-06-01 Thread michael . f . ellis
Hi Tim, In your example, a & b are references to the same object. I agree they should compare equally. But please note that a==b is True at every point in your example, even after the ValueError raised by b.remove(1). That's good consistent behavior. My original example is a little different.

Re: An oddity in list comparison and element assignment

2006-06-01 Thread michael . f . ellis
Yes. You stated it quite precisely. I believe l1==l2 should always return True and l1==l3 should always be False. (unless l3 is reassigned as l3=l1). Your idea of a separate operator for 'all elements have numerically equal values at the moment of comparision' is a good one. For want of a better

Re: An oddity in list comparison and element assignment

2006-06-01 Thread michael . f . ellis
Considering the number of new programmers who get bit by automatic coercion, I wish Dennis Ritchie had made some different choices when he designed C. But then I doubt he ever dreamed it would become so wildly successful. Being a curmudgeon purist I'd actually prefer it if Python raised a TypeErr

Re: An oddity in list comparison and element assignment

2006-06-01 Thread michael . f . ellis
Yes (unless I was testing the assertion that the second envelope did not contain counterfeits of the first) Scott David Daniels wrote: > Would you say that envelope containing five $100 bills is equal to > an envelope containing five $100 bills with different serial numbers? -- http://mail.pytho

Re: An oddity in list comparison and element assignment

2006-06-01 Thread michael . f . ellis
Truthfully, I wouldn't mind it at all. In Python, I frequently write things like i == int(f) or vice versa just to avoid subtle bugs that sometimes creep in when later modifications to code change the original assumptions. When working in C, I always set the compiler for maximum warning

Re: An oddity in list comparison and element assignment

2006-06-01 Thread michael . f . ellis
I believe that 'is' tests equality of reference, such that >>> a = range(1,3) >>> b = range(1,3) >>> a is b False The 'is' operator tells you whether a and b refer to the same object. What I've been discussing is whether == should test for "structural" equality so that a and b remain equivalent u

Re: An oddity in list comparison and element assignment

2006-06-02 Thread michael . f . ellis
'. I haven't used such perjoratives in any of my posts and would appreciate the same courtesy. Cheers, Mike ''' StrongEquality -- a first cut at the definition proposed by M. Ellis. Author: Michael F. Ellis, Ellis & Grant, Inc. ''' def indices(ite

Re: An oddity in list comparison and element assignment

2006-06-03 Thread michael . f . ellis
Hey Alex, lighten up! Python is a programming language -- not your family, religion, or civil rights. Cheers, Mike Alex Martelli wrote: > <[EMAIL PROTECTED]> wrote: >... > > (As an aside, may I point out that Python In A Nutshell states on page > > 46 "The result of S*n or n*S is the concatena

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Chris F Clark
Chris Smith wrote: > Marshall <[EMAIL PROTECTED]> wrote: > > While I am quite sympathetic to this point, I have to say that > > this horse left the barn quite some time ago. > > I don't think so. Perhaps it's futile to go scouring the world for uses > of the phrase "dynamic type" and eliminating t

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Chris F Clark
Chris F Clark wrote: > A static > type system eliminates some set of tags on values by syntactic > analysis of annotations (types) written with or as part of the program > and detects some of the disallowed compuatations (staticly) at compile > time. Adreas relied: > Explicit a

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Chris F Clark
Chris F Clark schrieb: > In that sense, a static type system is eliminating tags, because the > information is pre-computed and not explicitly stored as a part of the > computation. Now, you may not view the tag as being there, but in my > mind if there exists a way of perfoming the

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Chris F Clark
Pascal Costanza wrote: > Consider a simple expression like 'a + b': In a dynamically typed > language, all I need to have in mind is that the program will attempt to > add two numbers. In a statically typed language, I additionally need to > know that there must a guarantee that a and b will always

Re: What is Expressiveness in a Computer Language

2006-06-24 Thread Chris F Clark
Chris Smith <[EMAIL PROTECTED]> writes: > I thought about this in the context of reading Anton's latest post to > me, but I'm just throwing out an idea. I think there is some sense of convergence here. In particular, I reason about my program using "unsound types". That is, I reason about

Re: What is Expressiveness in a Computer Language

2006-06-24 Thread Chris F Clark
Chris Smith <[EMAIL PROTECTED]> writes: > I thought about this in the context of reading Anton's latest post to > me, but I'm just throwing out an idea. I wrote: > I think there is some sense of convergence here. Apologies for following-up to my own post, but I forgot to describe the converg

Re: What is Expressiveness in a Computer Language

2006-06-24 Thread Chris F Clark
Chris Smith <[EMAIL PROTECTED]> writes: > Unfortunately, I have to again reject this idea. There is no such > restriction on type theory. Rather, the word type is defined by type > theorists to mean the things that they talk about. Do you reject that there could be something more general th

Re: What is Expressiveness in a Computer Language

2006-06-25 Thread Chris F Clark
Chris F Clark (I) wrote: > I'm particularly interested if something unsound (and perhaps > ambiguous) could be called a type system. I definitely consider such > things type systems. "Marshall" <[EMAIL PROTECTED]> wrote: > I don't understand. You ar

Re: What is Expressiveness in a Computer Language

2006-06-25 Thread Chris F Clark
Chris F Clark <[EMAIL PROTECTED]> (I) wrote: > Do you reject that there could be something more general than what a > type theorist discusses? Or do you reject calling such things a type? Chris Smith <[EMAIL PROTECTED]> wrote: > I think that the correspondence partly in t

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Chris F Clark
I wrote: > These informal systems, which may not prove what they claim to prove > are my concept of a "type system". Chris Smith <[EMAIL PROTECTED]> replied: > Okay, that works. I'm not sure where it gets us, though Ok, we'll get there. First, we need to step back in time, to when there was

<    1   2   3   4   >