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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
>
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.
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
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
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
;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
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
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,
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
thon is available that don't support
> signed zeroes?
--
Grant Edwards grant.b.edwardsYow! This ASEXUAL PIG
at really BOILS my BLOOD
gma
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
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
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
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!!
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
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&
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
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
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
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 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.
-
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
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
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
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
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 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
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:
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
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.
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
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?
>
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.
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
>
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
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, &
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
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 _
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
&
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
$ 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
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
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
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
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
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
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
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 == ' ':
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
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
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
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 ==
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
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
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
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
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
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
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
, 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
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
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
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.
--
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
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
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
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'
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
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
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
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
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
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...
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
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.
--
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
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
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
901 - 1000 of 4299 matches
Mail list logo