Python RPM Package build error

2011-04-28 Thread Wells, David J
Hello List, I am attempting to build an rpm from Python-3.1.3.tar.bz2 with the included spec file from /Python-3.1.3/Misc/RPM/ and it fails with the following error: Does anyone have any ideas? # rpmbuild -ba python-3.1.spec mv: cannot stat `idle': No such file or directory + echo '#!

Re: English Idiom in Unix: Directory Recursively

2011-05-17 Thread Pascal J. Bourguignon
Roland Hutchinson writes: > Sorry to have to contradict you, Don't be sorry. > but it really is a textbook example of > recursion. Try this psuedo-code on for size: > > FUNCTION DIR-DELETE (directory) > FOR EACH entry IN directory > IF entry IS-A-DIRECTORY THEN DIR-DELETE (entry).

Re: English Idiom in Unix: Directory Recursively

2011-05-18 Thread Pascal J. Bourguignon
t...@sevak.isi.edu (Thomas A. Russ) writes: > Well, unless you have a tree with backpointers, you have to keep the > entire parent chain of nodes visited. Otherwise, you won't be able to > find the parent node when you need to backtrack. A standard tree > representation has only directional link

Re: English Idiom in Unix: Directory Recursively

2011-05-19 Thread Pascal J. Bourguignon
t...@sevak.isi.edu (Thomas A. Russ) writes: > "Pascal J. Bourguignon" writes: > >> t...@sevak.isi.edu (Thomas A. Russ) writes: >> > >> > This will only work if there is a backpointer to the parent. >> >> No, you don't need backpointer

Re: English Idiom in Unix: Directory Recursively

2011-05-20 Thread Antti J Ylikoski
On 20.5.2011 3:38, Pascal J. Bourguignon wrote: t...@sevak.isi.edu (Thomas A. Russ) writes: "Pascal J. Bourguignon" writes: t...@sevak.isi.edu (Thomas A. Russ) writes: This will only work if there is a backpointer to the parent. No, you don't need backpointers; some

Re: List of WindowsError error codes and meanings

2011-05-21 Thread John J Lee
Andrew Berg writes: > This is probably somewhat off-topic, but where would I find a list of > what each error code in WindowsError means? WindowsError is so broad > that it could be difficult to decide what to do in an except clause. > Fortunately, sys.exc_info()[1][0] holds the specific error co

Re: application level monitoring for python

2011-05-21 Thread John J Lee
Walter Chang writes: > Hi > > is there any open source library for python that can allow application > level monitoring ? For example,application can send per request level/ > aggregated monitoring events and some remote server dump it and show > in the monitoring graph in real time ? What's be

Re: Parsing a graph image

2011-05-21 Thread John J Lee
Bastian Ballmann writes: > Hi, > > the project sounds like the exact tool that i need but regarding the > user manual one has to mark the points on the graph manually. Therefore > it's more work to get the data out than doing it without a tool. Or may > I miss something here? > Greets Read the d

Re: checking if a list is empty

2011-05-21 Thread John J Lee
Gregory Ewing writes: > Hans Georg Schaathun wrote: >> 0 is a number as real and existent as any other, >> one would think that the empty list is also as real and existent as >> any other list. > > 0 does have some special properties, though, such as > being the additive identity and not having

Abandoning Python

2011-05-21 Thread John J Lee
I still like Python after using it for over a decade, but there are things I don't like. What are your favourite up-and-coming languages of the moment? Here's my wishlist (not really in any order): * A widely used standard for (optional) interface declaration -- or something better. I wan

Re: Abandoning Python

2011-05-22 Thread John J Lee
Daniel Kluev writes: > On Sun, May 22, 2011 at 2:49 AM, John J Lee wrote: >> Here's my wishlist (not really in any order): > > How come pony is not listed there? Language cannot be better than > python without pony! Pony, absolutely. I took that as read. >>

Re: and becomes or and or becomes and

2011-05-23 Thread Colin J. Williams
On 22-May-11 15:23 PM, Stef Mientki wrote: hello, must of us will not use single bits these days, but at first sight, this looks funny : a=2 b=6 a and b 6 a& b 2 a or b 2 a | b 6 cheers, Stef 5.2. Boolean Operations — and, or, not These are the Boolean operations, ordered by ascendi

Re: Functional Programing: stop using recursion, cons. Use map & vectors

2011-05-23 Thread Pascal J. Bourguignon
torb...@diku.dk (Torben Ægidius Mogensen) writes: > Xah Lee writes: > > >> Functional Programing: stop using recursion, cons. Use map & vectors. >> >> 〈Guy Steele on Parallel Programing〉 >> http://xahlee.org/comp/Guy_Steele_parallel_computing.html > > This is more or less what Backus said in his

Re: Functional Programing: stop using recursion, cons. Use map & vectors

2011-05-23 Thread Antti J Ylikoski
On 23.5.2011 16:39, Pascal J. Bourguignon wrote: torb...@diku.dk (Torben Ægidius Mogensen) writes: Xah Lee writes: Functional Programing: stop using recursion, cons. Use map& vectors. 〈Guy Steele on Parallel Programing〉 http://xahlee.org/comp/Guy_Steele_parallel_computing.html Thi

Re: Beginner needs advice

2011-05-25 Thread Colin J. Williams
On 25-May-11 02:22 AM, Lew Schwartz wrote: So, if I read between the lines correctly, you recommend Python 3? Does the windows version install with a development environment? It would be safer to stick with Python 2.7 initially and then consider the transition to 3.2 later. No, there is not

Re: Question about isodate

2011-05-28 Thread Colin J. Williams
named mx.DateTime.ISO_" , could you please give me your command and advice. Many thanks Quang Does this help? http://www.google.com/url?sa=t&source=web&cd=1&ved=0CB0QFjAA&url=http%3A%2F%2Fwww.egenix.com%2Fproducts%2Fpython%2FmxBase%2FmxDateTime%2F&rct=j&q=mxdate

Re: Updated blog post on how to use super()

2011-06-01 Thread Brian J Mingus
On Tue, May 31, 2011 at 8:44 PM, Raymond Hettinger wrote: > I've tightened the wording a bit, made much better use of keyword > arguments instead of kwds.pop(arg), and added a section on defensive > programming (protecting a subclass from inadvertently missing an MRO > requirement). Also, there

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

2017-10-06 Thread Peter J. Holzer
ys.stdin.fileno()? I'm not conviced that this is much more portable: A platform where stdin doesn't use file descriptor 0 under the hood might not even use simple integers as file descriptors at all. hp -- _ | Peter J. Holzer| Fluch der elektronischen Textver

Re: The "loop and a half"

2017-10-06 Thread Peter J. Holzer
? Short of putting it into /usr/lib or so, but that would make it hard to use in a pipe. I can see some merit in the idea that filters could print a short help message when reading from a terminal, but creating a second "interactive" version of each filter with a different name seems to

Re: The "loop and a half"

2017-10-06 Thread Peter J. Holzer
utf8dump). I'm sure I've used sort this way, too, though rather rarely. I usually don't type the input but paste it in, but the program can't distinguish that: All it sees is some input from the terminal at stdin. hp -- _ | Peter J. Holzer| Fluch der elektronis

Re: The "loop and a half"

2017-10-06 Thread Peter J. Holzer
On 2017-10-06 13:24, bartc wrote: > On 06/10/2017 14:11, Peter J. Holzer wrote: >> On 2017-10-06 12:38, bartc wrote: >>> On 06/10/2017 12:51, Chris Angelico wrote: >>>> What you REALLY mean is that you can't see the point of an interactive >>>>

Re: The "loop and a half"

2017-10-06 Thread Peter J. Holzer
then read by cc1. 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. hp -- _ | Peter J. Holzer| Fluch der elektronischen Textverarbeitung: |_|_) || Man feilt s

Re: The "loop and a half"

2017-10-06 Thread Peter J. Holzer
On 2017-10-06 15:08, Dennis Lee Bieber wrote: > On Fri, 6 Oct 2017 15:06:03 +0200, "Peter J. Holzer" > declaimed the following: > > >>I can see some merit in the idea that filters could print a short help >>message when reading from a terminal, but creating a

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

2017-10-06 Thread Peter J. Holzer
one of your output files (there have been a few security holes because of this). hp -- _ | Peter J. Holzer| Fluch der elektronischen Textverarbeitung: |_|_) || Man feilt solange an seinen Text um, bis | | | h...@hjp.at | die Satzbestandteil

Re: The "loop and a half"

2017-10-08 Thread Peter J. Holzer
good interface for entering 33000 lines of text, even though pasting 33000 lines from the clipboard into xterm works (I vaguely recall that there is or was a size limit, but 33000 shortish lines doesn't seem to be enough to reach it). hp -- _ | Peter J. Holzer| Fluch der elekt

Re: The "loop and a half"

2017-10-08 Thread Peter J. Holzer
n the same packet. hp -- _ | Peter J. Holzer| Fluch der elektronischen Textverarbeitung: |_|_) || Man feilt solange an seinen Text um, bis | | | h...@hjp.at | die Satzbestandteile des Satzes nicht mehr __/ | http://www.hjp.at/ | zusammen

Python platforms without long long

2017-10-08 Thread Peter J. Holzer
was standardized in C99 (and was a popular extension before that). Python 3.3 was released in 2012 - 13 years later. Were any of the supported platforms of Python3 really still missing this type at that time? hp -- _ | Peter J. Holzer| Fluch der elektronisc

Re: The "loop and a half"

2017-10-08 Thread Peter J. Holzer
On 2017-10-08 12:53, Gregory Ewing wrote: > 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

Re: The "loop and a half"

2017-10-09 Thread Peter J. Holzer
lso use the mouse. They are just restricted to a rectangular grid of characters for display purposes. Not much of a restriction if you want to edit only text. hp -- _ | Peter J. Holzer| Fluch der elektronischen Textverarbeitung: |_|_) || Man feilt solange

Re: The "loop and a half"

2017-10-09 Thread Peter J. Holzer
So where does the redrawing happen? The machine youre sitting on (let's >>> call it 'A') and send remote commands or retrieving text files? Or the >>> redrawing must be synced on both A and >>> the remote machine? If so, then why so? > > Peter J. Holzer w

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

2017-10-13 Thread Peter J. Holzer
would result in a 16 bit byte and char (and most likely UTF-16 as the multibyte character representation). > Not only does "byte" not always mean "8 bits", but > "char" isn't always short for "character"... True. A character often occu

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

2017-10-13 Thread Peter J. Holzer
ould be a bit >> useless! > > Macs used a ROM for at least a decade and probably more. The ROM contained > data such as mouse cursors, toolbox routines, icons, sounds, and a > bootloader. No Mac was capable of writing to their ROMs any more than they > could write to their mou

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

2017-10-13 Thread Peter J. Holzer
/2 probably used segments because it was originally designed for the 286.) hp -- _ | Peter J. Holzer| Fluch der elektronischen Textverarbeitung: |_|_) || Man feilt solange an seinen Text um, bis | | | h...@hjp.at | die Satzbestandteile des Satzes nicht mehr

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

2017-10-13 Thread Peter J. Holzer
y homogenous. hp [1] Except in a demo: "As you can see, this button is now disabled. Nothing happens when I click on it!" Everbody dives under the table just in time before the espresso machine in the corner explodes. -- _ | Peter J. Holzer| Fluch der elekt

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

2017-10-13 Thread Peter J. Holzer
the is "not read-only". Obviously the wafer is modified during the etching process and afterwards it contains information it didn't before. Would you say a piece of paper is "read-only" because you can't program it using address and data lines? I can write on it, I ju

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

2017-10-14 Thread Peter J. Holzer
On 2017-10-14 01:05, Steve D'Aprano wrote: > On Sat, 14 Oct 2017 07:15 am, Peter J. Holzer wrote: >> On 2017-10-13 15:11, alister wrote: >>> On Sat, 14 Oct 2017 01:48:44 +1300, Gregory Ewing wrote: >>>> Steve D'Aprano wrote: >>>>> I w

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

2017-10-14 Thread Peter J. Holzer
mming language and therefore deemed it safer. hp -- _ | Peter J. Holzer| Fluch der elektronischen Textverarbeitung: |_|_) || Man feilt solange an seinen Text um, bis | | | h...@hjp.at | die Satzbestandteile des Satzes nicht mehr __/ | ht

Re: An endless loop

2017-10-15 Thread Peter J. Holzer
7;t familiar enough with it to see what it does without running the program: It displays a turtle running through the same (pentagon-shaped) loop over and over again. Yes, that's a very nice visualization of an endless loop. hp -- _ | Peter J. Holzer| Fluch der elek

Re: Compression of random binary data

2017-10-24 Thread Peter J. Holzer
ee. If the distribution is not equal, then the average needs to take the different probabilities into account. Let's assume that (0, 0) has a probability of 90 %, (0, 1) a probability of 10 % and (1, 0) and (1, 1) a probability of 5 % each. Then the average length is 0.9 * 1 bit

Re: Compression of random binary data

2017-10-26 Thread Peter J. Holzer
On 2017-10-24 22:30, Steve D'Aprano wrote: > On Wed, 25 Oct 2017 07:09 am, Peter J. Holzer wrote: > >> On 2017-10-23 04:21, Steve D'Aprano wrote: >>> On Mon, 23 Oct 2017 02:29 pm, Stefan Ram wrote: >>>> >>> If the probability of certain codes

Re: Python noob having a little trouble with strings

2017-10-27 Thread Peter J. Holzer
ly between 2.x and 3.x) and you'll be hopelessly confused if you use 2.6 and your professor's examples are written for 3.5. hp -- _ | Peter J. Holzer| Fluch der elektronischen Textverarbeitung: |_|_) || Man feilt solange an seinen Text um, bis | |

Re: [TSBOAPOOOWTDI]using names from modules

2017-11-04 Thread Peter J. Holzer
ame lookup and therefore is faster. What is the > one way to do it?) I'm not worried about performance unless there is clear performance advantage (for real programs, not benchmarks). hp -- _ | Peter J. Holzer| Fluch der elektronischen Textverarbeitung: |_|_) |

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-27 Thread Peter J. Holzer
gmatical basis? When I use German identifiers (which I generally don't) I do use umlauts. When I need to do some physical computations, I might use greek letters (or maybe not - as a vim user I can type Δt easily enough, but can the colleague using PyCharm on Windows? I have no idea). S

Re: What is wrong with this regex for matching emails?

2017-12-21 Thread Peter J. Holzer
ive mail without an MX record. This is rare, but I have seen it in the wild (although usually not for email addresses for people but for services (e.g. trouble ticket systems). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || beca

Re: Goto (Posting On Python-List Prohibited)

2017-12-30 Thread Peter J. Holzer
where you would use goto in C (the rest is probably mostly in micro-optimizations: If you care about the run-time difference between a goto and a subroutine call, you probably shouldn't use Python in the first place). hp -- _ | Peter J. Holzer| we build much bigger, be

Re: Goto (Posting On Python-List Prohibited)

2018-01-01 Thread Peter J. Holzer
On 2017-12-30 11:07:56 -0500, Dennis Lee Bieber wrote: > On Sat, 30 Dec 2017 13:46:14 +0100, "Peter J. Holzer" > declaimed the following: > > >I don't think this is correct. Structured programming is much older: > >ALGOL 60 was already a block structured

Re: ... (Posting On Python-List Prohibited)

2018-01-01 Thread Peter J. Holzer
as zero > privilege? Because they pay for the server which runs the list. Their server, their rules. If you set up a server which hosts a mailing list, a web forum, or whatever, you get to decide ther rules for your server. hp -- _ | Peter J. Holzer| we build m

Re: 7z archive reader akin to zipfile?

2018-01-06 Thread Peter J. Holzer
hive)? I think it does what you want and it transparently supports several archive types (including zip and 7z). hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at |

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

2018-01-28 Thread Peter J. Holzer
audio-clips as signatures. Thank god he was wrong about that. hp [1] 280 now. -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at | management tools. __/ | http://www.hjp.a

Re: New to Python and understanding problem

2018-02-03 Thread Peter J. Holzer
, not under /usr/lib/python-3.5/site-packages or /usr/lib/python-3.5/dist-packages (although the latter is on sys.path). Unless you have modified this yourself, please report it to Debian. hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) |

Re: 2.6.7: Does socket.gethostbyaddr truncate?

2018-02-03 Thread Peter J. Holzer
> When I call socket.gethostbyaddr(IP) entry [1] of the result is a list of > > 34 addresses. gethostbyaddr just calls the underlying C library function. It is possibly that this has a limit (either on the number of names or more likely on the packet size). hp -- _ | Pet

Re: auto-correct a speech-to-text output and relate to of the words based on syllables

2018-02-03 Thread Peter J. Holzer
;l" or an "r"? This not as unambiguous as you seem to think. So a speech-to-text program may hear "right" when the speaker was really saying "light". If you have only the output from that program you must determine whether "right" is correct or must be corre

Re: This newsgroup (comp.lang.python) may soon be blocked by Google Groups

2018-02-03 Thread Peter J. Holzer
;t have a spam problem, and it is already (lightly) moderated. The newsgroup does have a spam problem (as well as a few other problems, like gmane mangling message-ids and breaking threads). Google groups is an interface to the newsgroup. There is a bi-directional gateway between them, but th

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

2018-02-05 Thread Peter J. Holzer
te publishes source-code: https://video.golem.de/files/1/9/20542/twitterreplybotpython.pdf?start=0.00 hp -- _ | Peter J. Holzer| we build much bigger, better disasters now |_|_) || because we have much more sophisticated | | | h...@hjp.at

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

2018-02-20 Thread Geldenhuys, J, Prof
Hi Marcel, I have read through the article and it seems to me that all of the problems described boil down to one important point: use the right tool for the right job. Python is probably not the best language for developing large, complex systems (although there are such systems). Most (or a

Re: Why does datetime.timedelta only have the attributes 'days' and 'seconds'?

2022-04-17 Thread Peter J. Holzer
On 2022-04-16 20:35:22 -, Jon Ribbens via Python-list wrote: > On 2022-04-16, Peter J. Holzer wrote: > > On 2022-04-16 14:22:04 -, Jon Ribbens via Python-list wrote: > >> ... although now having looked into the new 'zoneinfo' module slightly, > >&

Re: Pre-Pre-PEP: The datetime.timedeltacal class

2022-04-17 Thread Peter J. Holzer
On 2022-04-17 06:08:54 +1000, Chris Angelico wrote: > On Sun, 17 Apr 2022 at 03:37, Peter J. Holzer wrote: > > Datetime arithmetic in the real world is typically not done in seconds, > > but in calendaric units: Hours, days, weeks, months, years, ... > > The problem is that

Re: Pre-Pre-PEP: The datetime.timedeltacal class

2022-04-17 Thread Peter J. Holzer
On 2022-04-17 10:15:54 +0200, Peter J. Holzer wrote: > On 2022-04-17 06:08:54 +1000, Chris Angelico wrote: > > On Sun, 17 Apr 2022 at 03:37, Peter J. Holzer wrote: > > > Therefore a new class (provisionally called timedeltacal, because it is > > > calendaric, not a

Re: Pre-Pre-PEP: The datetime.timedeltacal class

2022-04-18 Thread Peter J. Holzer
this thread. It doesn't test canonicalization yet (and indeed the prototype implementation is a mess in this regard) and subtracting timedeltacals from datetimes is also still missing. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: tail

2022-04-23 Thread Peter J. Holzer
gt; that I'm not going to end up iterating over it all, I would pay the > memory price. Me, too. Problem with a library function (as Marco proposes) is that you don't know how it will be used. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_

Re: How to have python 2 and 3 both on windows?

2022-04-24 Thread Peter J. Holzer
that question with the information you gave us. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signatur

Re: Why no list as dict key?

2022-04-25 Thread Peter J. Holzer
dicts are a good fit if want to group records by subset of their attributes (think "group by" in SQL) * Objects in general are often though of as units, even if they have composite values and you might want to look up something by that value. hp -- _ | Peter J. Holzer

Re: Python/New/Learn

2022-05-07 Thread Peter J. Holzer
r: Most people are probably even worse at observing the position of their various mouth parts while speaking than at listening, so without feedback from a native speaker (preferably a trained voice coach) they can't really tell whether they are doing it right.

Re: Convert the decimal numbers expressed in a `numpy.ndarray` into a matrix representing elements in fractional form

2022-05-17 Thread Peter J. Holzer
ially when neither the search nor the replacement terms are > regular expressions) with simple string operations... > > stripped = "".join(quoted.split("'")) Whether that's easier to understand it very much in the eye of the beholder. hp --

Re: Tkinter module test: widget class not inserted in application frame

2022-06-18 Thread Peter J. Holzer
et is placed. In my case, as > MRAB taught me, the proper syntax is > self,'lname'... There is a comma (U+002C) here ... > self.'fname'... And a dot (U+002E) here. I don't think this is correct. I would also recommend to always add a space after a

Re: "CPython"

2022-06-23 Thread David J W
>> Let's say they reimplement "reference python" CPython in Rust. What is >> better? Change the "reference python" CPython name to RPython, for >> example, or let it as CPython? >The C implementation would still be called CPython, and the new >implementation might be called RPython, or RustyPython

Re: "CPython"

2022-06-24 Thread David J W
about. > So the name "python" would be left intact rather than mangled, even if > the name itself happens to be totally meaningless. So may I suggest > something like """rustic-python""" ? > > > > -Original Message- > From: D

Re: Subtract n months from datetime

2022-06-27 Thread Peter J. Holzer
ermail/python-list/2022-April/906045.html (the latter also contains some prototype code). (I apologize for not pursuing that further at the time. I wanted to bolster that case with some real world applications, but I was a bit swamped with Real Work™ and didn't find anything suitable.)

Re: Logging into single file from multiple modules in python when TimedRotatingFileHandler is used

2022-06-27 Thread Peter J. Holzer
WatchedFileHandler (https://docs.python.org/3/library/logging.handlers.html#watchedfilehandler) to automatically detect when a logile has been rotated. Alternatively you can use a central logging service (like syslog) which handles all that stuff. hp -- _ | Peter J. Holze

Re: Why do I see digest replies to posts I never saw in a digest?

2022-07-23 Thread Peter J. Holzer
to the start of the thread (although the one by Barry has neither an In-Reply-To nor a References header so it isn't sorted in at the correct spot). hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at

Re: mailbox misbehavior with non-ASCII

2022-07-30 Thread Peter J. Holzer
What would be nice if you could get at that content directly. There doesn't seem to be documented method to do that. You can use h._chunks, but as the _ in the name implies, that's implementation detail which might change in future versions (and it's not quite straightf

Re: Parallel(?) programming with python

2022-08-08 Thread Peter J. Holzer
elease the lock while they are busy. hp PS: I also agree with what others have said about the perils of multi-threaded programming. -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Cr

Re: Parallel(?) programming with python

2022-08-10 Thread Peter J. Holzer
or maybe even 20 seconds, the producer might not even notice. (This of course depends very much on the details which we know nothing about.) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at

Re: Problem using cx_Freeze

2022-08-17 Thread Peter J. Holzer
h more convenient to extend/shorten/reorder a list. Otherwise you alway have to remember add or remove a comma in the right place. (Some people (especially SQL programmers for some reason) resorted to put the comma at the start of each line to get around this, which is really ugly.) h

Re: Mutating an HTML file with BeautifulSoup

2022-08-21 Thread Peter J. Holzer
lem can be solved with regular expressions (and given the constraints I think I would prefer that to using Beautiful Soup), but getting the regexps right is not trivial, at least in the general case. It may become a lot easier if you know that certain conventions

Re: Mutating an HTML file with BeautifulSoup

2022-08-22 Thread Peter J. Holzer
On 2022-08-22 00:09:01 -, Jon Ribbens via Python-list wrote: > On 2022-08-21, Peter J. Holzer wrote: > > On 2022-08-20 21:51:41 -, Jon Ribbens via Python-list wrote: > >> result = re.sub( > >> r"""(<\s*a\s+[^>]*href\s*=\s*

Re: Mutating an HTML file with BeautifulSoup

2022-08-22 Thread Peter J. Holzer
tly) then you have to know the the character set. (By parsing I mean only "create a syntax tree". Obviously you have to know the encoding to know whether to display «c3 bc» as «ü» or «Ã¼».) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: Mutating an HTML file with BeautifulSoup

2022-08-23 Thread Peter J. Holzer
On 2022-08-22 19:27:28 -, Jon Ribbens via Python-list wrote: > On 2022-08-22, Peter J. Holzer wrote: > > On 2022-08-22 00:45:56 -, Jon Ribbens via Python-list wrote: > >> With the offset though, BeautifulSoup made an arbitrary decision to > >> use ISO-8859

Re: What can I do about this?

2022-08-28 Thread Peter J. Holzer
first thing to do is to create the venv and activate it. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" si

Re: How to make a variable's late binding crosses the module boundary?

2022-08-29 Thread Peter J. Holzer
at this name must be hidden later. But I don't think this is the case. The module is imported but it isn't bound to any name in the current (global) namespace (obviously there must be some variable bound to it, but that's probably a local variable in the importer and it isn't cal

Re: What can I do about this?

2022-08-29 Thread Peter J. Holzer
mes of the packages depend on the distribution, it will often be vague unless you happen to use the same distribution as the developer. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles

Re: What can I do about this?

2022-08-29 Thread Peter J. Holzer
On 2022-08-29 11:12:17 -0400, gene heskett wrote: > I've not had to deal with venv's before. Can more than one of these > venv things peacefully coexist? Yes. Having multiple venvs is the main reason for their existence. hp -- _ | Peter J. Holzer| Story must

Re: Local variable definition in Python list comprehension

2022-09-01 Thread Peter J. Holzer
robably a bit more complex than `x**2`, but by the time a temporary variable really improves readability it's probably a good time to split that across multiple lines, too.) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h..

Re: any author you find very good has written a book on Python?

2022-09-06 Thread Peter J. Holzer
quite ware of authors who write books on lots of different languages. hp [1] Possibly the hand of a carpenter. -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative

Re: memoization (original Subject lost because mailer lost the whole thread)

2022-09-20 Thread Peter J. Holzer
tml#functools.lru_cache hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature.asc Des

Re: python developer

2022-09-30 Thread Peter J. Holzer
s indeed "Peter J. Holzer", you can be sure that all the messages signed with the same key came from the same person and that they were not modified by somebody else (at least not the signed part). I've been signing all my (private) mails for 25 years or so. hp -- _ | P

Re: python developer

2022-10-01 Thread Peter J. Holzer
[2] Yeah! Anniversary! (Throws confetti, blows a vuvuzela) -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" signature

Re: for -- else: what was the motivation?

2022-10-09 Thread Peter J. Holzer
special case first", but ordering the cases in an if/elif/else statement by length seems like ordering books by color: It may be pretty, but it doesn't make them easy to find. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: What to use for finding as many syntax errors as possible.

2022-10-09 Thread Peter J. Holzer
;t say anything about its quality. The blog entry about Lezer was interesting, though. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http:/

Re: for -- else: what was the motivation?

2022-10-09 Thread Peter J. Holzer
_some_more(item) we_are_done(item) which shows visually what the main purpose of the loop (or function or other block) is. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross

Re: for -- else: what was the motivation?

2022-10-09 Thread Peter J. Holzer
simplified it into a simple generator expression. In fact I would say that I code tends to be shorter after I fixed a bug than before. > So although size may matter, so can sighs. :-) hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: What to use for finding as many syntax errors as possible.

2022-10-09 Thread Peter J. Holzer
27;s requirement of continuing after an error. It uses just the normal python parser so it has exactly the same limitations. Some of the mentioned tools may do what Antoon wants, though. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) |

Re: What to use for finding as many syntax errors as possible.

2022-10-09 Thread Peter J. Holzer
d got the result back next week. So neither the parser nor you need to be perfect. Just better than one error at a time. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creat

Re: What to use for finding as many syntax errors as possible.

2022-10-09 Thread Peter J. Holzer
possible and they are also better equipped to do this. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!"

Re: for -- else: what was the motivation?

2022-10-09 Thread Peter J. Holzer
On 2022-10-09 15:32:13 -0400, Avi Gross wrote: > and of course no pipelines. Since you've now used that term repeatedly: What is a pipeline in Python? hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h..

Re: for -- else: what was the motivation?

2022-10-10 Thread Peter J. Holzer
On 2022-10-10 12:40:44 +1300, dn wrote: > On 10/10/2022 05.56, Peter J. Holzer wrote: > > On 2022-10-09 12:18:09 -0400, Avi Gross wrote: > > > Some would argue for a rule related to efficiency of execution. When you > > > have multiple blocks as in an if-else or c

Re: for -- else: what was the motivation?

2022-10-10 Thread Peter J. Holzer
hought you might be referring to that. I've just never seen the term "pipeline" for that construct (I think "method chaining" is reasonably common). hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | |

Re: What to use for finding as many syntax errors as possible.

2022-10-10 Thread Peter J. Holzer
t you can usually get away with recompiling only a small part, so you don't have to wait that long during normal development. That cobol compiler couldn't do that. [2] "Recently" means "in the last 10 years or so". -- _ | Peter J. Ho

Re: Find the path of a shell command

2022-10-12 Thread Peter J. Holzer
what the actual environment is. A simple * * * * * nobody echo $PATH >> /tmp/path.$$ should do that. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing

Re: for -- else: what was the motivation?

2022-10-12 Thread Peter J. Holzer
cost. From the Web: Ah yes. Your infamous aversion against useful citations strikes again. For those too lazy to use a search engine, the excerpt seems to be from https://softwarebyscience.com/very-short-functions-are-a-code-smell-an-overview-of-the-science-on-function-length/ hp -- _

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