Re: After a year using Node.js, the prodigal son returns

2016-05-06 Thread Grant Edwards
lines in JavaScript, but for small stuff it seems OK -- though as others have noted there are some oddly missing batteries that result in use of a lot of small external libraries for things that any C, PHP, or Python user would have expected to be in the standard library. -- Grant Edw

Re: How to get a directory list sorted by date?

2016-05-15 Thread Grant Edwards
On 2016-05-15, Tim Chase wrote: > On 2016-05-15 11:46, Peter Otten wrote: >> def sorted_dir(folder): >> def getmtime(name): >> path = os.path.join(folder, name) >> return os.path.getmtime(path) >> >> return sorted(os.listdir(folder), key=getmtime, reverse=True) >> >> The

Re: How to get a directory list sorted by date?

2016-05-15 Thread Grant Edwards
On 2016-05-15, Michael Selik wrote: > On Sun, May 15, 2016, 10:37 AM Grant Edwards > wrote: >> On 2016-05-15, Tim Chase wrote: >>> >>> unless sorted() returns a lazy sorter, >> >> What's a lazy sorter? > > One that doesn't calculate

OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
p a simple Python HTTP server to try some other approaches: 1) Only allow the listening socket to accept 1 connection at a time. 2) Accept the TCP connection, but don't allow the SSL handshaking to start on the "extra" connections. 3) ??? 4) Profits! Any

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
On 2016-05-16, Chris Angelico wrote: > On Tue, May 17, 2016 at 2:06 AM, Grant Edwards> > wrote: >> So, when a browser wants to load a page that has the main html file, a >> css file, a javascript library or two, and a few icons and background >> bitmaps, they browse

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
f reply" is for the server to close the connection. In theory I can fix that by adding support to the server for chunked encoding in the cases where the reply size is unknown. But that won't do me any good if the browser opens 4 more connections before it's even seen the response from the

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
On 2016-05-16, Steven D'Aprano wrote: > On Tue, 17 May 2016 02:06 am, Grant Edwards wrote: > >> This is not Python specific, though I'm turning to Python to do some >> experimentation and to try to prototype a solution. >> >> Is there any way to limit the

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
On 2016-05-16, Peter Otten <__pete...@web.de> wrote: > Grant Edwards wrote: > >> This is not Python specific, though I'm turning to Python to do some >> experimentation and to try to prototype a solution. >> >> Is there any way to limit the number of co

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
asking for isn't even pipelining. > > https://en.wikipedia.org/wiki/HTTP_persistent_connection Right. I just want convince browsers to use persistent connections and as few of them as possible. -- Grant Edwards grant.b.edwardsYow! One FISHWICH coming

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
Python prototype. :) -- Grant Edwards grant.b.edwardsYow! Gee, I feel kind of at LIGHT in the head now, gmail.comknowing I can't make my

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
On 2016-05-16, Paul Rubin wrote: > Grant Edwards writes: >> I've actually got plenty of RAM. I just can't afford the CPU time >> it takes to do the public-key crypto stuff that happens each time >> an SSL connection starts up. > > I think you should on

Re: OT: limit number of connections from browser to my server?

2016-05-16 Thread Grant Edwards
On 2016-05-16, Steven D'Aprano wrote: > On Tue, 17 May 2016 02:06 am, Grant Edwards wrote: > >> This is not Python specific, though I'm turning to Python to do some >> experimentation and to try to prototype a solution. >> >> Is there any way to limit the

Re: OT: limit number of connections from browser to my server?

2016-05-17 Thread Grant Edwards
sly closed connection. That's not what I need: I need to speed up opening of a new connection while the first connection is still open. -- Grant Edwards grant.b.edwardsYow! Mary Tyler Moore's at SEVENTH HUSB

Re: OT: limit number of connections from browser to my server?

2016-05-17 Thread Grant Edwards
end less stuff? No. Somebody else decides what the pages look like and behaves. I don't get to toss out logos, background images, customized checkbox glyphs, etc. I get to make it work. :) -- Grant Edwards grant.b.edwardsYow! I have a very good

Re: OT: limit number of connections from browser to my server?

2016-05-17 Thread Grant Edwards
thought about that. It's probably more work than going the "single-fetch" route via server-side includes, and probably more fragile. -- Grant Edwards grant.b.edwardsYow! An air of FRENCH FRIES at

Re: OT: limit number of connections from browser to my server?

2016-05-17 Thread Grant Edwards
or discussion. The customer is a large, somewhat bureaucratic German corporation, and they generally mean it when they say something is non-negotiable. > Is is a device that needs to be accessed in untrusted networks? > Sorry for asking the obvious :o) -- Grant Edwards grant.

Re: OT: limit number of connections from browser to my server?

2016-05-17 Thread Grant Edwards
a Chromebook or Atom based laptop) get much more complicated when > you're resource constrained. And that's what keeps me paid. :) -- Grant Edwards grant.b.edwardsYow! I know th'MAMBO!! at I have a TWO-TONE CHEMISTRY gmail.comSET!! -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: limit number of connections from browser to my server?

2016-05-18 Thread Grant Edwards
On 2016-05-17, Dennis Lee Bieber wrote: > On Tue, 17 May 2016 18:42:12 + (UTC), Grant Edwards > declaimed the following: > > >>40MHz with multiple MB of RAM is pretty high-end in my book. I've > > How about a 68040 running at 30MHz (when not running in

Re: OT: limit number of connections from browser to my server?

2016-05-18 Thread Grant Edwards
On 2016-05-16, Grant Edwards wrote: > Is there any way to limit the number of connections a browser uses to > download a web page? [Long-winded tail of woe...] > So now I'm going to set up a simple Python HTTP server to try some > other approaches: > > 1) Only allow

Re: Extract the middle N chars of a string

2016-05-18 Thread Grant Edwards
On 2016-05-18, Steven D'Aprano wrote: > Getting the middle N seems like it ought to be easy: I'm still trying to figure out when one would want to do that... -- Grant Edwards grant.b.edwardsYow! My CODE of ETHICS at

Re: for / while else doesn't make sense

2016-05-20 Thread Grant Edwards
On 2016-05-20, Steven D'Aprano wrote: > On Sat, 21 May 2016 05:20 am, Christopher Reimer wrote: > >> According to "Effective Python: 59 Specific Ways to Write Better Python" >> by Brett Slatkin, Item 12 recommends against using the else block after >> for and while loops (see page 25): "Avoid usin

Re: for / while else doesn't make sense

2016-05-21 Thread Grant Edwards
On 2016-05-21, Ian Kelly wrote: > On Sat, May 21, 2016 at 5:26 AM, Steven D'Aprano wrote: > >> Does anyone know of other languages that include the same feature? >> It's very rare for Python to innovate in language features. >> >> (I wonder if it came from ABC?) > > According to Raymond Hettinger

Re: OT: limit number of connections from browser to my server?

2016-05-22 Thread Grant Edwards
On 2016-05-22, Random832 wrote: > On Wed, May 18, 2016, at 18:58, Gregory Ewing wrote: >> Grant Edwards wrote: >>> Product spec explicitly states HTTPS only. I'm told that is not open >>> for discussion. The customer is a large, somewhat bureaucratic German >

Re: for / while else doesn't make sense

2016-05-23 Thread Grant Edwards
of ℚ). > > And of course I realized after sending that I forgot about complex > numbers. But even there Python merely represents 2-tuples of ℚ. OK, admit it, now you're all just showing off the fact that you know how to type in those fancy symbols. -- Grant Edwards grant.b.

Re: for / while else doesn't make sense

2016-05-24 Thread Grant Edwards
ain". The adjectives "8-bit" and "ASCII" were both modifying brain. -- Grant Edwards grant.b.edwardsYow! I'm pretending that at we're all watching PHIL

Re: OT: limit number of connections from browser to my server?

2016-05-31 Thread Grant Edwards
On 2016-05-30, Paul Rubin wrote: > Grant Edwards writes: > >> The 40MHz one is a Samsung ARM7TDMI. There's a newer model with a >> 133MHz Cortex-M3. > > Another thing occurs to me-- do you have to support older browsers? > Newer TLS stacks support elliptic cur

Re: OT: limit number of connections from browser to my server?

2016-06-06 Thread Grant Edwards
On 2016-05-16, Grant Edwards wrote: [...] > Is there any way to limit the number of connections a browser uses to > download a web page? Browser writers seems to assume that all https > servers are massively parallel server farms with hardware crypto > support. In case anyb

Re: Operator precedence problem

2016-06-06 Thread Grant Edwards
;m not sure I would include all of them if _I_ were writing the code, but in this specific example, I think they're fine. That said, I have seen lots of cases where fully parenthising an expression would harm readability... -- Grant Edwards grant.b.edwardsYow! My nose feel

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-20 Thread Grant Edwards
ht-hand "windows" key is . If I used it a lot, I'd probably configure the left hand one to be the same. > It's still probably a horrible idea to have it in a programming > language, though, unless the original behaviour still also works. Definitely. And we should allow overba

Re: value of pi and 22/7

2016-06-20 Thread Grant Edwards
e time, 3 is a good-enough approximation of π (it's less than 5% off). Yesterday I needed to know if the globe on a light fixture was 5", 6", or 7" diameter. Measure the circumference with a tape, divide by 3, and Bob's your uncle. Of course if you have to do that very often,

Re: value of pi and 22/7

2016-06-20 Thread Grant Edwards
trumentation, and when a device is used for doing a measurement that affects how much tax gets paid, things get deadly serious. > although their scribes probably did, a bit. -- Grant Edwards grant.b.edwardsYow! Vote for ME -- I'm at

Re: Is signed zero always available?

2016-06-22 Thread Grant Edwards
thon is available that don't support > signed zeroes? -- Grant Edwards grant.b.edwardsYow! This ASEXUAL PIG at really BOILS my BLOOD gma

Re: Is signed zero always available?

2016-06-22 Thread Grant Edwards
On 2016-06-22, Random832 wrote: > On Wed, Jun 22, 2016, at 10:19, Grant Edwards wrote: > >> Is that guaranteed by Python, or just a side-effect of the >> implementation? Back in the days when Python used native C >> integers I think the latter. > > AIUI, native

Re: Is signed zero always available?

2016-06-22 Thread Grant Edwards
On 2016-06-22, Christopher Reimer wrote: >> On Jun 22, 2016, at 7:59 AM, Grant Edwards wrote: >> >>> On 2016-06-22, Random832 wrote: >>>> On Wed, Jun 22, 2016, at 10:19, Grant Edwards wrote: >>>> >>>> Is that guaranteed by Python, or ju

Re: Which one is the best JSON parser?

2016-06-24 Thread Grant Edwards
On 2016-06-23, MRAB wrote: > On 2016-06-23 21:58, David Shi via Python-list wrote: >> Can any one tell me? >> Regards. >> David >> > There's one in the standard library. Which has always worked fine for me... -- Grant Edwards grant.b

Re: Assignment Versus Equality

2016-06-27 Thread Grant Edwards
guages that did something similar? Why would a language designer think it a good idea? Did the poor sod who wrote the compiler think it was a good idea? -- Grant Edwards grant.b.edwardsYow! I left my WALLET in at the BATHROOM!!

Re: Operator Precedence: One Thing Python Got Right

2016-06-27 Thread Grant Edwards
on code into C programs. The more validated code I can use verbatim, the less likely I'll bork something up by having to translate it from Python to C. -- Grant Edwards grant.b.edwardsYow! ... I see TOILET

Re: Operator Precedence: One Thing Python Got Right

2016-06-27 Thread Grant Edwards
On 2016-06-27, BartC wrote: > On 27/06/2016 15:04, Grant Edwards wrote: >> On 2016-06-27, Steven D'Aprano wrote: >> >>> Do you write much Python code that you expect to also be valid C code? >> >> Depends on what you mean by "much", but yes, it&

Re: Assignment Versus Equality

2016-06-27 Thread Grant Edwards
On 2016-06-27, MRAB wrote: > On 2016-06-27 14:59, Grant Edwards wrote: >> On 2016-06-26, BartC wrote: >> >>> (Note, for those who don't know (old) Fortran, that spaces and tabs are >>> not significant. So those dots are needed, otherwise "a eq b" w

Re: Where do i find the 32 bit libraries on my 64 bit ubuntu system

2016-06-27 Thread Grant Edwards
use for 32 bit and 64 bit programming ?? In my experience all you have to do is pass "-m32" to gcc. It should know where the 32-bit libraries are. -- Grant Edwards grant.b.edwardsYow! UH-OH!! I put on at

Re: Iteration, while loop, and for loop

2016-06-28 Thread Grant Edwards
long the first "thing" is len = handle_thing(data[:len]) data = data[len:] > But then, if you wrap up your "while" loop as a generator that yields > things, you can then use it in a "for" loop which seems to me like > the Pythonic way

Re: "for/while ... break(by any means) ... else" make sense?

2016-06-29 Thread Grant Edwards
On 2016-06-29, Steven D'Aprano wrote: [...] > is "insane" too, but still legal. The Python interpreter does not > judge your code. That's what Usenet is for. -- Grant Edwards grant.b.edwardsYow! I'm a nuclear

Re: Operator Precedence/Boolean Logic

2016-06-29 Thread Grant Edwards
re there was either a boolean type or built-in True/False integer values. Those programs often did this at the top: True = 1 False = 0 Having True and False evaluate as 1 and 0 in an integer expression context guaranteed that those programs would to continue to work with minimal changes. -

Re: [OT] Compression of random binary data

2016-07-13 Thread Grant Edwards
no pattern to discern, and having more chunks of random > data won't make it possible to compress. You might as well be arguing with Ludwig Plutonium. -- Grant Edwards grant.b.edwardsYow! I wonder if I should

Re: Why not allow empty code blocks?

2016-08-02 Thread Grant Edwards
in various combinations? It turns out there's a English word for that. It's called a "language". > if the details are even exposed when the format is proprietary. > > A traditional language exists as text and can be stored as plain > te

Re: Why not allow empty code blocks?

2016-08-03 Thread Grant Edwards
rouble to make sure they never went dead. -- Grant Edwards grant.b.edwardsYow! If I pull this SWITCH at I'll be RITA HAYWORTH!! gmail.comOr a SCIENTOLOGIST! -- https://mail.pyth

Re: Python slang

2016-08-06 Thread Grant Edwards
On 2016-08-06, Michael Torrie wrote: > Sadly it has become an epidemic of late for folks to misuse the > word, "myself." I think it comes from people not wanting to sound > presumptuous when referring to themselves. It drives me crazy to > hear so many people say something like, "this research

Re: multiple JSON documents in one file, change proposal

2018-12-01 Thread Grant Edwards
On 2018-11-30, Marko Rauhamaa wrote: > Paul Rubin : >> Maybe someone can convince me I'm misusing JSON but I often want to >> write out a file containing multiple records, and it's convenient to >> use JSON to represent the record data. >> >> The obvious way to read a JSON doc from a file is with

How to reset TCP connection on Linux?

2018-12-03 Thread Grant Edwards
How does one reset a TCP connection on Linux? Note that I want to reset the connection, not close it. I need to emulate the rude behavior of a particular app (that's sending the RST packet) in order to try to find a bug another app (the one that's receiving the RST). -- Gra

Re: How to reset TCP connection on Linux?

2018-12-03 Thread Grant Edwards
On 2018-12-03, Jon Ribbens wrote: > On 2018-12-03, Grant Edwards wrote: >> How does one reset a TCP connection on Linux? Note that I want to >> reset the connection, not close it. > > Something like the following should work I believe, although I have > not tested it:

Re: Why Python don't accept 03 as a number?

2018-12-08 Thread Grant Edwards
On 2018-12-08, Cameron Simpson wrote: > On 07Dec2018 20:24, Jach Fong wrote: >>Ian at 2018/12/8 UTC+8 AM11:28:34 wrote: >>> What is it exactly that you're trying to accomplish with this? Perhaps >>> there's a better way than using eval. >> >>This problem comes from solving a word puzzle, >>ab

Re: Undocumented issue: Open system call blocks on named pipes (and a feature request)

2018-12-28 Thread Grant Edwards
racter-mode device could block -- serial ports are the only "common" example I can think of. -- Grant Edwards grant.b.edwardsYow! How many retured at bricklayers from FLORIDA gmail.

Re: the python name

2019-01-03 Thread Grant Edwards
ler (which was written in Python) was called Anaconda. -- Grant Edwards grant.b.edwardsYow! What UNIVERSE is this, at please?? gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: the python name

2019-01-03 Thread Grant Edwards
On 2019-01-03, Grant Edwards wrote: > On 2019-01-03, Gene Heskett wrote: > >> Do I miss-remember that there was an anaconda language at sometime in the >> past? Not long after python made its debute? I've not see it mentioned >> in a decade so maybe its died? >

Re: the python name

2019-01-05 Thread Grant Edwards
On 2019-01-05, Michael Torrie wrote: > On 01/03/2019 06:35 PM, Gene Heskett wrote: >> On Thursday 03 January 2019 15:28:49 Grant Edwards wrote: >>> About 20 years ago, the RedHat Linux (way before RHEL) installer >>> (which was written in Python) was called Anaconda.

Re: the python name

2019-01-06 Thread Grant Edwards
On 2019-01-06, Peter J. Holzer wrote: > On 2019-01-06 13:43:02 -0500, Dennis Lee Bieber wrote: >> On Sun, 6 Jan 2019 13:26:15 +0100, "Peter J. Holzer" >> declaimed the following: >> >> >For example, about 10 years ago I built a continuous integration >> >pipeline for a project I was working on >

Re: The following modules appear to be missing ['_sysconfigdata']

2019-01-09 Thread Grant Edwards
install Python and whatever other dependenceis are required by my applications. That said, I've recently switched from py2exe to cx_freeze. However, even that isn't simple enough for my users, and I bundle the output from those with Inno Setup. -- Grant Edwards grant.b.edward

Re: The following modules appear to be missing ['_sysconfigdata']

2019-01-09 Thread Grant Edwards
when your requirement is to support Windows users who are not capable of installing Python, WxWindows, and a half-dozen other libraries, you can't simply hand out .py files, push your fingers into your ears, close your eyes, and start yelling "your problem now, not mine, na, na, na, na, na, &

Re: The following modules appear to be missing ['_sysconfigdata']

2019-01-09 Thread Grant Edwards
On 2019-01-09, Chris Angelico wrote: > On Thu, Jan 10, 2019 at 2:37 AM Grant Edwards > wrote: > >> > How many platforms support .exe files that were compiled for Windows? >> >> None. >> >> But when your requirement is to support Windows users w

Re: get the terminal's size

2019-01-14 Thread Grant Edwards
the terminal size at the time Python was started. If the terminal size has changed while Python was running, those environment variables will be wrong. You need to use the TIOCGWINSZ ioctl call: http://www.delorie.com/djgpp/doc/libc/libc_495.html And to detect the size changes (so you know _

Re: get the terminal's size

2019-01-14 Thread Grant Edwards
On 2019-01-14, Peter Otten <__pete...@web.de> wrote: > Grant Edwards wrote: > > os.environ["COLUMNS"] > >> [...] will tell you the terminal size at the time Python was started. > > I admit that none of my scripts is ambitious enough to try and track &

Re: get the terminal's size

2019-01-14 Thread Grant Edwards
On 2019-01-14, Schachner, Joseph wrote: > Note sure why you couldn't capture $ echo $COLUMNS from a subprocess > call. You can. But, the subprocess is going to inherit the value from the Python program's environment, so it's just pointless complexit

Re: get the terminal's size

2019-01-16 Thread Grant Edwards
$ python2 Python 2.7.15 (default, Sep 12 2018, 15:19:18) [GCC 7.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import shutil >>> shutil.get_terminal_size() Traceback (most recent cal

Re: Pythonic Y2K

2019-01-17 Thread Grant Edwards
en, and for which third-party packages and libraries don't exist. I also don't think an experience Python2 developer would be turned down for a position on a project that's using Python3. -- Grant Edwards grant.b.edwardsYow! Do you guys know we

Re: Pythonic Y2K

2019-01-18 Thread Grant Edwards
y current Thinkpad is over 10 years old.] -- Grant Edwards grant.b.edwardsYow! BARBARA STANWYCK makes at me nervous!! gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Find and display gif file/s in web browser, according to the passed string, compared to files names in the folder.

2019-01-22 Thread Grant Edwards
r I'd likely be asking > for $75-100 US$ PER HOUR SPENT. That seems a bit low to me. And don't forget the 4 hour minimum... -- Grant Edwards grant.b.edwardsYow! I'm rated PG-34!! at gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-22 Thread Grant Edwards
lot of pain. Everything else is pretty minor. -- Grant Edwards grant.b.edwardsYow! Are we live or on at tape? gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-23 Thread Grant Edwards
On 2019-01-22, Cameron Simpson wrote: > On 22Jan2019 19:20, Grant Edwards wrote: >>On 2019-01-22, Schachner, Joseph wrote: >>> For anyone who has moved a substantial bunch of Python 2 to Python >>> 3, can you please reply with your experience? >> >>If yo

Re: How to replace space in a string with \n

2019-01-31 Thread Grant Edwards
output += i >> >> print(output) > But this is an awful, O(n*n) way to solve an inherently O(n) problem, How is it O(n^2)? It loops through the input sequence exactly once. That looks like O(n) to me. -- Grant Edwards grant.b.edwards

Re: How to replace space in a string with \n

2019-01-31 Thread Grant Edwards
On 2019-01-31, Grant Edwards wrote: > On 2019-01-31, Terry Reedy wrote: >> On 1/31/2019 11:19 AM, Ian Clark wrote: >>> text = "The best day of my life!" >>> output = '' >>> >>> for i in text: >>> if i == ' ':

Re: How to replace space in a string with \n

2019-01-31 Thread Grant Edwards
best > day > of > my > life! Here's a solution. But don't turn it in. You're not supposed to know how to do this yet, and your instructor will know you copied it from the internet: print(''.join('\n' if c == ' ' el

Re: The sum of ten numbers inserted from the user

2019-02-07 Thread Grant Edwards
than list of the numbers? > I've not been following assiduously, so maybe I missed some other > requirement... Because you think it likely that tomorrow the marketing people are going to say "oh, and we want to know the min, max, mode, median, standard deviation, and count of odd

Re: more pythonic way

2019-02-11 Thread Grant Edwards
default values is wrong and needs be changed. ;) -- Grant Edwards grant.b.edwardsYow! I always have fun at because I'm out of my gmail.commind!!! -- https://mail.python.org/mailman/listinfo/python-list

Re: Why float('Nan') == float('Nan') is False

2019-02-13 Thread Grant Edwards
On 2019-02-13, ast wrote: > Hello > > >>> float('Nan') == float('Nan') > False If you think that's odd, how about this? >>> n = float('nan') >>> n nan >>> n is n True >>> n ==

Re: Why float('Nan') == float('Nan') is False

2019-02-13 Thread Grant Edwards
of the quantum mechanics of computer science. At first glance, it seems sort of weird. But after you work with it a while, it gets even worse. -- Grant Edwards grant.b.edwardsYow! Jesuit priests are at DATING CAR

What's up with Activestate Python?

2019-02-13 Thread Grant Edwards
he fact that they've stopped including "extra" libraries doesn't seem to be documented anywhere. I guess it's time to switch to Anaconda or ??? -- Grant Edwards grant.b.edwardsYow! Is this going to at

Re: What's up with Activestate Python?

2019-02-14 Thread Grant Edwards
On 2019-02-14, Liste guru wrote: > Il 14/02/2019 00:06, Grant Edwards ha scritto: >> For many, many years I've always installed ActiveState's ActivePython >> Community edition when forced to use Windows. It has always included >> ... >> I guess it's

Re: FW: Why float('Nan') == float('Nan') is False

2019-02-14 Thread Grant Edwards
On 2019-02-14, Avi Gross wrote: > I experimented a bit: > >>>> float("nan ") > nan >>>> float(" nan") > Nan >>>> float(" nAn") > nan That's curious. I've never seen "Nan" before. What versi

Re: What's up with Activestate Python?

2019-02-15 Thread Grant Edwards
On 2019-02-13, Grant Edwards wrote: > For many, many years I've always installed ActiveState's ActivePython > Community edition when forced to use Windows. It has always included > all of the "extra" libraries that I didn't wan't to install (or > could

Re: more pythonic way

2019-02-16 Thread Grant Edwards
On 2019-02-16, Barry wrote: > On 11 Feb 2019, at 20:00, Felix Lazaro Carbonell wrote: > >>> The most pythonic way is to do this: >>> >>> def find_monthly_expenses(month=datetime.date.today().month, >> year=datetime.date.today().year): >>>... > > This has subtle bugs. > The default is calcul

Re: Trying to compile Python 3.5 on Linux Mint 19, getting compiler warnings and failing tests

2019-02-18 Thread Grant Edwards
didn't, they'll forget to renew/replace them before they expire. Even if your app and certificates are OK, the app on the other end of the network connection won't work right. I'm only half joking... -- Grant Edwards grant.b.edwardsYow! They c

Re: What's the address for?

2019-02-19 Thread Grant Edwards
, that would be a rather odd way to do things. One would expect that first the RHS is evaluated (perhaps creating a new object), then the name is rebound. -- Grant Edwards grant.b.edwardsYow! I wish I was a at

Re: revisiting the "What am I running on?" question

2019-02-19 Thread Grant Edwards
27;t use a bare except clause even if your > code is 100% perfect every time. (And anyone who thinks their code is > perfect hasn't tested it.) IMO, you're allowed to use a bare except clause to do cleanup or logging as long as the execption handler ends with the line raise S

Re: What's the address for?

2019-02-19 Thread Grant Edwards
On 2019-02-19, Chris Angelico wrote: > On Wed, Feb 20, 2019 at 3:23 AM Grant Edwards > wrote: > >> Those object _may_ each have different identies. Is it required that >> they do? If an assignment is done on name referring to an object with >> no other references, w

Re: How to detect if a file is executable on Windows?

2019-02-19 Thread Grant Edwards
d +x .exe [I assume there's native Windows point-and-grunt means for doing that as well.] So, in addition to the suffix and associations, there's some sort of file-system meta-data that determines whether a file is "executable" in some contexts. --

Re: How to detect if a file is executable on Windows?

2019-02-19 Thread Grant Edwards
On 2019-02-19, MRAB wrote: > On 2019-02-19 18:31, Grant Edwards wrote: > >> FWIW, I've noticed that afer downloading a .exe under Linux and >> scp'ing the file to a Windows machine, it wont run when double-clicked >> until I fire up a Cygwin shell and do a

Re: Class Issue`

2019-03-06 Thread Grant Edwards
And I think I've know people for whom it is their religion. :) That said, I don't think that stating ones lack of respect for some particular programming language is uncivil -- particularly compared to the things I've said about PHP in the past (maybe not in t

Re: System Beep?

2019-03-08 Thread Grant Edwards
On 2019-03-08, Steve wrote: > I tried all three, nothing audio. I am beginning to wonder if > something I the operating system is at fault. The three lines do > produce symbols. The first two are a rectangle with a space in the > middle and the last one spelled out "bel" in short/small characte

Re: Python scope question

2019-03-12 Thread Grant Edwards
nd this code w.r.t to scope > in Python? https://www.ynonperek.com/2017/09/11/python-variable-scope-implicit-global-and-nonlocal/ -- Grant Edwards grant.b.edwardsYow! If I pull this SWITCH at I'

Re: subprocess svn checkout password issue

2019-03-16 Thread Grant Edwards
On 2019-03-16, dieter wrote: > Otherwise, you must monitor what it written to the subprocess' > "stdout" and "stderr", recognized the interaction request > perform the interaction with the user and send the result > to the subprocess' stdin. I don't know about svn specifically, but in the past i

Re: running "python -i" in subprocess shows no prompt

2019-03-18 Thread Grant Edwards
epending on whether they're connected to a tty or not. -- Grant Edwards grant.b.edwardsYow! I'm young ... I'm at HEALTHY ... I can HIKE gmail.comTHRU CAPT GROGAN'S LUM

Re: Block Ctrl+S while running Python script at Windows console?

2019-03-19 Thread Grant Edwards
nd those write calls are blocking due because the terminal emulator has stopped reading the other end of the pipe/pty/queue/buffer/whatever-it's-called-in-windows? -- Grant Edwards grant.b.edwardsYow! It's some people at

Re: File not closed

2019-03-20 Thread Grant Edwards
ort, throw-away progams, that's fine. For long running servers, it's bad style. -- Grant Edwards grant.b.edwardsYow! Hmmm ... A hash-singer at and a cross-eyed guy were gmail.com

Re: how to handle response data that is streaming and chunked?

2019-03-21 Thread Grant Edwards
You can do either, but not everbody is willing to click on links, so you're limiting your audience if you don't actually include the source code you're asking about in your post. -- Grant Edwards grant.b.edwardsYow! Am I in GRADUATE

Re: Might be doing this wrong? (Turtle graphics)

2019-03-25 Thread Grant Edwards
On 2019-03-25, Larry Martell wrote: > On Mon, Mar 25, 2019 at 3:45 PM CrazyVideoGamez > wrote: >> wait no nevermind im such an idiot > > Every programmer I have ever known has said that. And never saying that is a 100% reliable indicator that you really are one...

Re: configparser - which one?

2019-03-26 Thread Grant Edwards
ML than it is in JSON. As usual, YMMV. -- Grant Edwards grant.b.edwardsYow! HUMAN REPLICAS are at inserted into VATS of gmail.comNUTRITIONAL YEAST ... -- https://mail.python.org/mailman/listinfo/python-list

Re: Your IDE's?

2019-03-27 Thread Grant Edwards
On 2019-03-25, John Doe wrote: > What is your favorite Python IDE? Unix+Emacs I sometimes wish that Emacs had a better code folding mode when browsing other people's code, but the editors I've tried that do have nice code-folding fall down at too many other tasks. --

Re: Losing words

2019-04-01 Thread Grant Edwards
ting out the line you want to send before sending it, and > compare it with the example commands in the RFC.) What he said! Adding a few print() calls can shed a _lot_ of light on a problem. Also: if reading the RFC doesn't help, use wireshark to compare behavior of an app t

Re: Logging cf Reporting = Friday Filosofical Finking

2019-04-09 Thread Grant Edwards
given up and gone back to writing my own throw-away logging functions (typically containing a dozen or so lines of code). -- Grant Edwards grant.b.edwardsYow! You mean you don't at want to watch WRESTLING

Re: Friday Filosofical Finking: Import protections

2019-04-17 Thread Grant Edwards
dev-ops > environment? I have no idea what "a dev-ops environment means", and I plan on keeping it that way. :) -- Grant Edwards grant.b.edwardsYow! WHOA!! Ken and Barbie at

<    5   6   7   8   9   10   11   12   13   14   >