Re: Find the path of a shell command

2022-10-13 Thread Eli the Bearded
In comp.lang.python, jkn wrote: > On Wednesday, October 12, 2022 at 6:12:23 AM UTC+1, jak wrote: >> I'm afraid you will have to look for the command in every path listed in >> the PATH environment variable. > erm, or try 'which rm' ? It is so hilarious seeing the responses to this thread.

-ffast-math

2022-09-07 Thread Eli the Bearded
https://twitter.com/moyix/status/1567167774039973888 Brendan Dolan-Gavitt @moyix New blog post is live! In which I download 4 TB of Python packages containing native x86-64 libraries and see how many of them use -ffast-math, potentially altering floating point behavior in any

news to me today: RIP Aahz

2021-11-18 Thread Eli the Bearded
Aahz, co-author of Python for Dummies with Stef Maruch, recently passed away. Tiny death notice (with name typo) from the wilds of the Internet: http://file770.com/pixel-scroll-10-15-21-i-know-what-pixel-you-scrolled-last-summer/ (12) AAHZ MARUCH (1967-2021). [Item by James Davis Nicoll.]

Re: The task is to invent names for things

2021-10-27 Thread Eli the Bearded
In comp.lang.python, Peter J. Holzer wrote: ^^ > On 2021-10-27 12:41:56 +0200, Karsten Hilbert wrote: >> In that situation, is it preferable to choose a nonsensical >> name over a mediocre one ? > I don't know. A mediocre name conveys at least some information, and > that seems

Re: XML Considered Harmful

2021-09-25 Thread Eli the Bearded
In comp.lang.python, Chris Angelico wrote: > Eli the Bearded <*@eli.users.panix.com> wrote: >> I'd use one of the netpbm formats instead of JPEG. PBM for one bit >> bitmaps, PGM for one channel (typically grayscale), PPM for three >> channel RGB, and PAM for anything

Re: XML Considered Harmful

2021-09-23 Thread Eli the Bearded
In comp.lang.python, Christian Gollwitzer 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 pro

Re: XML Considered Harmful

2021-09-21 Thread Eli the Bearded
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. > How does CSV handle hierarchical data? For instance, I have > generators[1], each of

Re: basic auth request

2021-08-25 Thread Eli the Bearded
In comp.lang.python, Barry wrote: > It is possible to sign an ip address in a certificate, but that is not > often done. It's bad practice. I've never seen one in the wild. > Getting to reuse the IP address that example.com was using will not help > the attacker unless they can make a cert

Re: basic auth request

2021-08-25 Thread Eli the Bearded
In comp.lang.python, Jon Ribbens wrote: > On 2021-08-25, Eli the Bearded <*@eli.users.panix.com> wrote: >> $COMPANY puts out a lot of things on different IP addresses from >> a shared public(ish) pool like AWS and assigns different names >> to them. Later $COMPA

Re: basic auth request

2021-08-25 Thread Eli the Bearded
In comp.lang.python, Jon Ribbens wrote: > Another attempt at combatting this problem is DNS CAA records, > which are a way of politely asking all CAs in the world except the > ones you choose "please don't issue a certificate for my domain". > By definition someone who had hacked a CA would pay

Re: python text://protocol client?

2021-04-09 Thread Eli the Bearded
In comp.lang.python, Petite Abeille wrote: > Would you know of any python text://protocol client? Or server? The whole thing was started (judging by git commits) about a month ago. https://github.com/textprotocol?tab=overview=2021-03-01=2021-03-31 March 7: First repository I suspect no

Re: A 35mm film camera represented in Python object

2021-04-01 Thread Eli the Bearded
In comp.lang.python, Richard Damon wrote: > On 4/1/21 6:41 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: >> Richard Damon wrote: >>> If you keep track of the positions as a floating point number, the >>> precision will be more than you could actually measure it. >> I won't disagree with

Re: A 35mm film camera represented in Python object

2021-03-17 Thread Eli the Bearded
In comp.lang.python, D.M. Procida wrote: > Eli the Bearded <*@eli.users.panix.com> wrote: >> I see you don't even attempt to tackle ISO outside of >> supported range (and I have no idea how the camera itself deals with >> that). Is the camera sensing the ISO from t

Re: A 35mm film camera represented in Python object

2021-03-17 Thread Eli the Bearded
In comp.lang.python, D.M. Procida wrote: > Hi everyone, I've created - > a representation of a Canonet G-III QL17 in Python. > > There's also documentation: . This is interesting. Some feedback. > It's a pure

Re: Exploring terminfo

2021-01-19 Thread Eli the Bearded
In comp.lang.python, Greg Ewing wrote: > On 18/01/21 3:34 am, Alan Gauld wrote: >> The problem is terminfo is not really part of curses. >> Curses is built on top of terminfo. > As far as I can tell from the man pages, terminfo itself > is just a file format. The only programmatic interfaces I >

Re: why sqrt is not a built-in function?

2021-01-15 Thread Eli the Bearded
In comp.lang.python, Chris Angelico wrote: > Michael F. Stemper wrote: >> On 15/01/2021 14.01, Stefan Ram wrote: >>> __import__( "math" ).sqrt( 4 ) >> I had no idea that syntax existed, and find it completely at odds >> with The Zen of Python. I'm torn between forgetting that I ever saw >> it

Re: why sqrt is not a built-in function?

2021-01-14 Thread Eli the Bearded
In comp.lang.python, Ethan Furman wrote: > On 1/14/21 11:06 AM, Eli the Bearded wrote: >> "There should be one-- and preferably only one --obvious way to do it." >> Plus the ** operation ("root = x ** 0.5"), that's now three ways. > Yes, but which

Re: Exploring terminfo

2021-01-14 Thread Eli the Bearded
In comp.lang.python, Barry Scott wrote: > Alan Gauld via Python-list wrote: >> I've written a short program that is supposed to >> - *clear the screen*, >> - read some input >> - display the result in a message *highlighted in bold*. >> - get input to end the program > It seems that curses does

Re: why sqrt is not a built-in function?

2021-01-14 Thread Eli the Bearded
In comp.lang.python, Skip Montanaro wrote: > Finally, should have never considered it, I think you might want to > study the output of > > import this > > Think on the second and last lines in particular. >>> import this The Zen of Python, by Tim Peters Beautiful is better than

Re: Application window geometry specifier

2021-01-12 Thread Eli the Bearded
In comp.lang.python, Rich Shepard wrote: >> Keep in mind that if you target Linux, the "modern" window server >> (Wayland) will not allow user code to decide the positioning and size of > I suspect that Slackware will continue with X11. Even with traditional X11, geometry is "preferred" size

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

2021-01-05 Thread Eli the Bearded
In comp.lang.python, Mats Wichmann wrote: > "workweeks" has always been fun, ISO standard or not, there's been a > variation for ages since people don't seem to always follow ISO for > that. I spent over a decade at a place that lived and died by their > WorkWeek references ("due WW22" or

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

2021-01-05 Thread Eli the Bearded
In comp.lang.python, Chris Angelico wrote: > There are multiple definitions for "day of year", depending on how you > want to handle certain oddities. The simplest is to identify Jan 1st > as 1, Jan 2nd as 2, etc, to Dec 31st as either 365 or 366; but some > libraries will define the year as

Re: Changing strings in files

2020-11-10 Thread Eli the Bearded
In comp.lang.python, Chris Angelico wrote: > Eli the Bearded <*@eli.users.panix.com> wrote: >> Read first N lines of a file. If all parse as valid UTF-8, consider it text. >> That's probably the rough method file(1) and Perl's -T use. (In >> particular allow no nu

Re: Changing strings in files

2020-11-10 Thread Eli the Bearded
In comp.lang.python, Loris Bennett wrote: > Manfred Lotz writes: > > My idea was to do > > > > - os.scandir and for each file > >- check if a file is a text file ^^ > >- if it is not a text file skip that file > >- change the string as often as it

Re: why no camelCase in PEP 8?

2020-05-18 Thread Eli the Bearded
In comp.lang.python, Paul Rubin wrote: > Eli the Bearded <*@eli.users.panix.com> writes: >> One of those is easier to "grep" for than the other. > grep -i might help. Or might not, if I want case sensitivity in the rest of my RE. Elijah -- can, bu

Re: why no camelCase in PEP 8?

2020-05-18 Thread Eli the Bearded
In comp.lang.python, Paul Rubin wrote: > I don't know if this was the explicit motivation for PEP 8, but it > has always seemed valid to me: > > https://en.wikipedia.org/wiki/Camel_case#Readability_studies There are three things cited there. One is a NYTimes story from 2009 "Against Camel

news.bbs.nz is spewing duplicates to comp.lang.python

2020-04-22 Thread Eli the Bearded
This just arrived at my newserver: Path: reader2.panix.com!panix!goblin2!goblin.stu.neva.ru!news.unit0.net!2.eu.feeder.erje.net!4.us.feeder.erje.net!feeder.erje.net!xmission!csiph.com!news.bbs.nz!.POSTED.agency.bbs.nz!not-for-mail From: Eli the Bearded <*@eli.users.panix.com>

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread Eli the Bearded
In comp.lang.python, wrote: > On Monday, April 20, 2020 at 5:02:23 PM UTC-4, Eli the Bearded wrote: > > For an example, back to telnet again. > > > > $ telnet example.com 80 > > Trying 255.11.22.123... > > Connected to example.com > > Escape character is '

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread Eli the Bearded
In comp.lang.python, wrote, in reply to me: > "What do you think it is doing?" > I thought the timeout was waiting for a successful connection. A successful *connection* and a successful *authentication* are different things. $ telnet example.com 80 Trying 255.11.22.123... Connected to

Re: Getting a 401 from requests.get, but not when logging in via the browser.

2020-04-20 Thread Eli the Bearded
In comp.lang.python, wrote: > However, one of them immediately returns a 401. I'm using the exact > same credentials to check this site, as when loggin in. > > Also, interestingly, it returns the 401 right away. I tried setting the > timeout value for a ridiculously long time, but it passes

Re: on sorting things

2019-12-19 Thread Eli the Bearded
In comp.lang.python, Peter Otten <__pete...@web.de> wrote: > Eli the Bearded wrote: >> But what caught my eye most, as someone relatively new to Python but >> with long experience in C in Perl, is sorting doesn't take a s/C in /C and/ Ugh. >> *comparison* function

on sorting things

2019-12-18 Thread Eli the Bearded
I recently saw a link to an old post on a blog and then started looking at the newer posts. This one: https://leancrew.com/all-this/2019/11/the-key-to-sorting-in-python/ discusses ways to deal with useful sorting of movie / television show titles. Some initial words should be re-ordered for

Re: Artifact repository?

2019-10-31 Thread Eli the Bearded
In comp.lang.python, Paul Rubin wrote: > Dan Stromberg writes: >> By an Artifact Repository, I mean something that can version largish >> binaries that are mostly produced by a build process. > I'm not familiar with the term "artifact repository" and hadn't heard of > the ones you mentioned,

Re: How to decode UTF strings?

2019-10-26 Thread Eli the Bearded
In comp.lang.python, DFS wrote: > On 10/25/2019 10:57 PM, MRAB wrote: >> Here's a simple example, based in your code: >> >> from email.header import decode_header >> >> def test(header, default_encoding='utf-8'): >> parts = [] >> >> for data, encoding in decode_header(header): >>

Re: question about making an App for Android

2019-10-11 Thread Eli the Bearded
In comp.lang.python, Dennis Lee Bieber wrote: > pyotr filipivich declaimed the following: >> "A simple program" to divide the amount of "today's" daylight into 12 >> even '"hours", so that Dawn begins the First hour, the third hour is >> mid-morning, noon is the middle of the day, the ninth

Re: Generate simple image on a standalone Raspberrry Pi

2019-09-27 Thread Eli the Bearded
In comp.lang.python, Roy Hann wrote: > I am designing a mobile application to run on a Raspberry Pi 3 model B. > It will not have any Internet access. I need to generate a static image > consisting of a simple arc representing (say) a speedometer or a > pressure gauge. The image will need to be

Re: python3 subprocess run sudo cmd in remote failed

2019-09-17 Thread Eli the Bearded
In comp.lang.python, lampahome wrote: > what I tried many times like enter password, but it failed. > I just want to use ps.stdin.write(password) to send password, but it always > jump password prompt immediately. Passwords are frequently read from stderr, not stdin, so that tools can get a

Re: Unicode UCS2, UCS4 and ... UCS1

2019-09-17 Thread Eli the Bearded
In comp.lang.python, moi wrote: > I hope, one day, for those who are interested in Unicode, > they find a book, publication, ... which will explain > what is UCS1. There isn't anything called UCS1. There is a UTF-1, but don't use it. UTF-8 is better in every way.

Re: [OT(?)] Ubuntu 18 vim now defaults to 4-space tabs

2019-09-10 Thread Eli the Bearded
In comp.lang.python, Tobiah wrote: >> Your subject missed a critical word: vim. > It's there! I added it. > > Run vim. Then ':set' to see what's set different than default. Then, > > if it is tabstop you want to know about, ':verbose set tabstop?' will > > tell you where that setting was last

Re: [OT(?)] Ubuntu 18 vim now defaults to 4-space tabs

2019-09-09 Thread Eli the Bearded
In comp.lang.python, Tobiah wrote: > We upgraded a server to 18.04 and now when I start typing Your subject missed a critical word: vim. There are a lot of editors in Ubuntu, and probably they don't all do that. > This is more of a vim question perhaps, but I'm already > subscribed here and I

Re: Proper shebang for python3

2019-07-25 Thread Eli the Bearded
In comp.lang.python, Thomas 'PointedEars' Lahn wrote: > Michael Torrie wrote: >> On 7/24/19 4:20 PM, Cameron Simpson wrote: >>> That is some progress, hooray. Then there's just sbin -> bin to go. >> I suppose in the olden days sbin was for static binaries, […] > No, “sbin” is short for “*system*

Re: Hermetic environments

2019-07-24 Thread Eli the Bearded
In comp.lang.python, DL Neil wrote: > Is Python going 'the right way' with virtual environments? ... > Am I 'getting away with it', perhaps because my work-pattern doesn't > touch some 'gotcha' or show-stopper? > > Why, if so much of 'the rest of the world' is utilising "containers", > both

Re: Proper shebang for python3

2019-07-22 Thread Eli the Bearded
In comp.lang.python, Tim Daneliuk wrote: > On 7/20/19 1:20 PM, Chris Angelico wrote: > > On Sun, Jul 21, 2019 at 4:13 AM Michael Speer wrote: > >> You may want to use `#!/usr/bin/env python3` instead. I no longer have one to verify, but I recall Solaris boxen used /bin/env not /usr/bin/env. >

Re: convert .py to Android ?

2019-05-14 Thread Eli the Bearded
In comp.lang.python, Ben Finney wrote: > "Steve" writes: >> I have a working .py program >> that I want to get into my Android Moto G phone. > To my knowledge, an Android app must be implemented, at some level, in > Java and specifically linked to Android Java libraries. That's a hard >

Re: Conway's game of Life, just because.

2019-05-07 Thread Eli the Bearded
In comp.lang.python, MRAB wrote: > I've never seen a version of Conway's Game of Life where the board > doesn't wrap around. The one I wrote in vi macros doesn't. It's a design choice you can make. (Thanks for the explainations everyone.) Elijah -- the vi macro one is included in the vim

Re: Conway's game of Life, just because.

2019-05-07 Thread Eli the Bearded
In comp.lang.python, Paul Rubin wrote: Thanks for posting this. I'm learning python and am very familiar with this "game". > #!/usr/bin/python3 > from itertools import chain > > def adjacents(cell):# generate coordinates of cell neighbors > x, y = cell # a cell

Re: Generating generations of files

2019-04-29 Thread Eli the Bearded
In comp.lang.python, DL Neil wrote: > On 30/04/19 10:59 AM, Chris Angelico wrote: >>> bet a FAT filesystem would produce a different error >> Probably it'd raise BadFileSystemError or something. Which is a > Fortunately, it runs on a Linux 'compute server'. I mount FAT under Linux all the time.

Re: Generating generations of files

2019-04-29 Thread Eli the Bearded
In comp.lang.python, Peter J. Holzer wrote: > On 2019-04-29 20:12:28 -, Grant Edwards wrote: >> Well, the FILES-11 filesystem on VAX/VMS did that automatically, but >> that's probably not too helpful. > Until this is finished you could use something like this: > > #!/usr/bin/python3 > >

Re: need help understanding: converting text to binary

2019-04-23 Thread Eli the Bearded
In comp.lang.python, Cameron Simpson wrote: > On 23Apr2019 20:35, Eli the Bearded <*@eli.users.panix.com> wrote: >> That feels entirely wrong. I don't know what b'\x9A' means without >> knowing the character set and character encoding. If the encoding is a >> multibyt

Re: need help understanding: converting text to binary

2019-04-23 Thread Eli the Bearded
In comp.lang.python, Paul Rubin wrote: > Eli the Bearded <*@eli.users.panix.com> writes: >> # decode a single hex digit >> def hord(c): ... > >def hord(c): return int(c, 16) That's a good method, thanks. > > # decode quoted printable, specifically the

Re: need help understanding: converting text to binary

2019-04-23 Thread Eli the Bearded
In comp.lang.python, Chris Angelico wrote: > Have you checked to see if Python can already do this? You mention I'm sure there's a library already. I'm trying to mix library usage with my own code to get practice writing in python. In this case, I want code to deal with MIME encoding in email

need help understanding: converting text to binary

2019-04-22 Thread Eli the Bearded
Here's some code I wrote today: -- cut here 8< -- HEXCHARS = (b'0', b'1', b'2', b'3', b'4', b'5', b'6', b'7', b'8', b'9', b'A', b'B', b'C', b'D', b'E', b'F', b'a', b'b', b'c', b'd', b'e', b'f') # decode a single hex digit def hord(c): c = ord(c) if c >=

Re: question about speed of sequential string replacement vs regex or

2011-09-28 Thread Eli the Bearded
In comp.lang.perl.misc, Willem wil...@toad.stack.nl wrote: In Perl, it would be applicable. You see, in Perl, you can call a function in the replacement of the regex substitution, which can then look up the html entity and return the wanted unicode literal. A function? I'd use a hash. I