Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Skip Montanaro via Python-list
Modern debian (ubuntu) and fedora block users installing using pip. > Even if you're telling it to install in ~/.local? I could see not allowing to run it as root. I honestly haven't tried. Maybe I should... 🤔 I have an old laptop running XUbuntu 22.04 which I generally only use to compile the mo

Re: PyCon

2024-05-18 Thread Skip Montanaro via Python-list
> > > I’m at PyCon in Pittsburgh and I’m haven’t an amazing time! > > s/haven’t/having/ > No need to explain/correct. We understand you are excited. Many of us have been in the same state before. ;-) Enjoy, Skip > -- https://mail.python.org/mailman/listinfo/python-list

Re: xkcd.com/353 ( Flying with Python )

2024-03-30 Thread Skip Montanaro via Python-list
> > > https://xkcd.com/1306/ > > what does SIGIL mean? > > I think its' a Perl term, referring to the $/@/# symbols in front of > identifiers. > I had a vague recollection of hearing it elsewhere (*Game of Thrones,* on the armies' battle flags?), but didn't know what i

Re: Testing (sorry)

2024-02-19 Thread Skip Montanaro via Python-list
> > Here is a typical bounce message that I get: > > : host mail.python.org[188.166.95.178] said: > 450-4.3.2 > Service currently unavailable 450 4.3.2 > > Some time after I get one of these messages I re-send the post. Usually > it gets through then. > Looks kinda like greylisting to me. I'

Re: Testing (sorry)

2024-02-18 Thread Skip Montanaro via Python-list
I can't explain the delays, but will note that the gate-news program on the server runs every 5 minutes via cron. There are multiple moving parts in the overall system. You'll probably get a more useful answer from postmas...@python.org. Skip -- https://mail.python.org/mailman/listinfo/python-lis

Re: test-ignore

2024-02-15 Thread Skip Montanaro via Python-list
> > True, but did the poster really need to send another one to say "yes, > that worked"? > Maybe to test the bidirectionality of the gateway? 🤷 If the messages stop I think we can let it die. It's not like this sort of activity is a regular occurrence. (A bigger problem for me was always Usenet p

Re: test-ignore

2024-02-15 Thread Skip Montanaro via Python-list
> > > Test post to see if my Newsgroup post program is working. > > Aim your test messages at alt.test, please. > I agree that basic Usenet connectivity messages should go to alt.test. It's not clear from the original post, but if the poster's aim was to see if posts to comp.lang.python traverse t

Re: Question about garbage collection

2024-01-15 Thread Skip Montanaro via Python-list
> I do have several circular references. My experience is that if I do not > take some action to break the references when closing the session, the > objects remain alive. Below is a very simple program to illustrate this. > > Am I missing something? All comments appreciated. Python has normal ref

Re: Python 3.11.5 Pip Issue

2023-09-14 Thread Skip Montanaro via Python-list
> I downloaded Python 3.11.5, and there was nothing in the “Scripts” file, > and there was no Pip. I would like to know why. > Can't help with the empty/missing Scripts folder. Does running python -m ensurepip get you a working pip? Which you should then run as python -m pip ... Skip > -- ht

Re: What to use instead of nntplib?

2023-05-22 Thread Skip Montanaro
> > My understanding is that nntplib isn't being erased from reality, > it's merely being removed from the set of modules that are provided > by default. > > I presume that once it's removed from the core, it will still be > possible to install it via pip or some other mechanism. > It won't magica

Re: What to use instead of nntplib?

2023-05-15 Thread Skip Montanaro
> I got a nice warning today from the inews utility I use daily: > > DeprecationWarning: 'nntplib' is deprecated and slated for removal in > Python 3.13 > > What should I use in place of nntplib? I'd recommend creating a PyPI project with the existing 3.12 code, then using that from 3.13 onwa

Re: replacement for nntplib on Python3

2023-04-26 Thread Skip Montanaro
You could create a git repo with just nntplib and generate a package on PyPI, then use that when running a version of Python which lacks nntplib. Skip On Wed, Apr 26, 2023, 8:42 PM Retrograde wrote: > I used to use a script that relied on nntplib, which is currently still > available in Python3

Small lament...

2023-04-03 Thread Skip Montanaro
Just wanted to throw this out there... I lament the loss of waking up on April 1st to see a creative April Fool's Day joke on one or both of these lists, often from our FLUFL... Maybe such frivolity still happens, just not in the Python ecosystem? I know you can still import "this" or "antigravity"

Re: JOB | Lead Linux Sysadmin (Edinburgh/London)

2023-03-08 Thread Skip Montanaro
There's a link at the bottom of each message to the list info pager. Follow the directions on that page to unsubscribe. Skip On Wed, Mar 8, 2023, 5:38 PM Thomas Gregg wrote: > Is there any way to be removed from this list? > Thank you, Tom > > On Wed, Mar 8, 2023 at 3:51 

Re: JOB | Lead Linux Sysadmin (Edinburgh/London)

2023-03-08 Thread Skip Montanaro
> Hello, I'm working with an employer that is looking to hire someone in > (Edinburgh or London) that can administer on-prem and vmware > platforms. > James, If you haven't already, please post to the Phone Jobs Board: https://www.python.org/jobs/ Skip > -- https://mail.python.org/mailman/lis

Re: Python 3.10 Fizzbuzz

2023-02-26 Thread Skip Montanaro
Dang auto-correct... Should read ... double quotes around "strings" and single quotes around 'c'haracters ... On Sun, Feb 26, 2023, 6:28 PM Skip Montanaro wrote: > is there any reason to prefer"over' ? >> > > Not really. As an

Re: Python 3.10 Fizzbuzz

2023-02-26 Thread Skip Montanaro
> > is there any reason to prefer"over' ? > Not really. As an old C programmer for many years I used double quotes"around "strings" and single word around 'c'haracters, because that's what I was used to. (This was long before triple quoted strings appeared in the language.) Aside: G

Re: Is there a more efficient threading lock?

2023-02-26 Thread Skip Montanaro
> And yet, it appears that *something* changed between Python 2 and Python 3 such that it *is* atomic: I haven't looked, but something to check in the source is opcode prediction. It's possible that after the BINARY_OP executes, opcode prediction jumps straight to the STORE_FAST opcode, avoiding t

Re: Is there a more efficient threading lock?

2023-02-25 Thread Skip Montanaro
Thanks for the responses. Peter wrote: > Which OS is this? MacOS Ventura 13.1, M1 MacBook Pro (eight cores). Thomas wrote: > I'm no expert on locks, but you don't usually want to keep a lock while > some long-running computation goes on. You want the computation to be > done by a separate thr

Is there a more efficient threading lock?

2023-02-25 Thread Skip Montanaro
I have a multi-threaded program which calls out to a non-thread-safe library (not mine) in a couple places. I guard against multiple threads executing code there using threading.Lock. The code is straightforward: from threading import Lock # Something in textblob and/or nltk doesn't play nice wit

Re: Upgrading Python on Ubuntu 22.04.1 LTS

2023-02-01 Thread Skip Montanaro
> > > I have a server with Ubuntu 22.04.1 LTS and the Python version there > is Python 3.10.6. Is there a safe way to upgrade to the latest version of > Python 3.10 (3.10.9)? I tried with the OS update and upgrade but the Python > version remained the same. > > I have an Ubuntu 22.04 system. The in

Re: Android APK

2023-01-25 Thread Skip Montanaro
> > Is there a good python library for converting python3 to android APK > I'm not an app type of person, so don't watch that space. I've heard of Kivy: https://kivy.org/ I also something called python-for-android on PyPI with a recent release: https://pypi.org/project/python-for-android/ I'd

Re: argparse — adding a --version flag in the face of positional args

2022-11-28 Thread Skip Montanaro
Thanks. It occurs to me that instead of providing two special actions ("help" and "version"), it might be worthwhile to provide a standard way of saying, "if present, process this option and exit before considering other details of the command line." Matt's example action works well enough for my n

Re: argparse — adding a --version flag in the face of positional args

2022-11-27 Thread Skip Montanaro
> > ummm, hate to say this, but have you checked the documentation? this > case is supported using an action named 'version' without doing very much. > Thanks, Mats. I actually searched all over the argparse docs. (There's a lot to digest. Honestly, if I wasn't attempting to be sort of up-to-dat

Re: argparse — adding a --version flag in the face of positional args

2022-11-27 Thread Skip Montanaro
> class VersionAction(argparse.Action): > def __call__(self, parser, namespace, values, option_string): > print(VERSION) > exit() ... > parser.add_argument("-v", "--version", nargs=0, action=VersionAction) Thanks. An action class didn't occur to me. I looked briefly at the code

argparse — adding a --version flag in the face of positional args

2022-11-27 Thread Skip Montanaro
I have a script to which I'd like to add a --version flag. It should print the version number then exit, much in the same way --help prints the help text then exits. I haven't been able to figure that out. I always get a complaint about the required positional argument. I think I could use somethi

Re: Ref-strings in logging messages (was: Performance issue with CPython 3.10 + Cython)

2022-10-07 Thread Skip Montanaro
Dang autocorrect. Subject first word was supposed to be "f-strings" not "ref-strings." Sorry about that. S On Fri, Oct 7, 2022, 10:45 AM Skip Montanaro wrote: > > > On Fri, Oct 7, 2022 at 9:42 AM Andreas Ames > wrote: > >> 1. The culprit was me. As laz

Ref-strings in logging messages (was: Performance issue with CPython 3.10 + Cython)

2022-10-07 Thread Skip Montanaro
On Fri, Oct 7, 2022 at 9:42 AM Andreas Ames wrote: > 1. The culprit was me. As lazy as I am, I have used f-strings all over the > place in calls to `logging.logger.debug()` and friends, evaluating all > arguments regardless of whether the logger was enabled or not. > I thought there was some dis

Python gets a mention on Reddit - in r/tifu

2022-08-07 Thread Skip Montanaro
Not exactly where I expected to see Python mentioned on Reddit, but I found this amusing (yes, despite the subreddit, it should be safe for work): https://www.reddit.com/r/tifu/comments/wibmkh/tifu_by_teaching_my_13yo_brother_python/ Just a little diversion for a Sunday afternoon. I was particula

Re: Dictionary order?

2022-08-01 Thread Skip Montanaro
> > So I decided to write a little test program to run on a variety of > CPythons, to confirm what I was thinking. > > And instead I got a surprise. > > On 1.4 through 2.1 I got descending key order. I expected the keys to be > scattered, but they weren't. > > On 2.2 through 3.5 I got ascending ke

Re: Resolving Weekday Schedules to Dates

2022-07-21 Thread Skip Montanaro
> Do you know of a library that resolves schedules like every Wednesday > at 3:00pm to absolute time, that is return the datetime of the next > occurrence? Take a look at the `rrule` module in the `dateutil` package: https://dateutil.readthedocs.io/en/stable/rrule.html Skip -- https://mail.pyth

Now for something completely different...

2022-05-22 Thread Skip Montanaro
This isn't really Python-related, but I don't wander around any more general software engineering/computer science places on the web, so I will throw this out here. I start a framebuilding class next week (lugged steel construction for those into bikes). After about three weeks of work, I should h

Re: Do projects exist to audit PyPI-hosted packages?

2022-05-06 Thread Skip Montanaro
> > A related problem is that even if a package is maintained by somebody with > good intentions, the account might be hijacked by a malicious actor and > since PyPi is separate from source control, people might not be able to > find out easily and malware could spread through PyPi. > I hadn't con

Do projects exist to audit PyPI-hosted packages?

2022-05-06 Thread Skip Montanaro
I woke with a start in what amounted to the middle of the night (I really need to get about three more hours of sleep, but you'll understand why I was awake to write this). Many years ago, so as to preserve my wrists, I wrote a tool

Re: Receive a signal when waking or suspending?

2022-04-25 Thread Skip Montanaro
> https://duckduckgo.com/?t=ffab&q=python+up+time pointed-out the > "uptime — Cross-platform uptime library" > - TLDR; I'm not sure if "uptime" and "boot" relate only to a > 'cold-start' or if they include bringing the machine out of 'stand-by' > or 'hibernation' Yeah, that won't help. uptime(1) g

Re: Receive a signal when waking or suspending?

2022-04-23 Thread Skip Montanaro
> I don't know in Python, but maybe you can create a script that writes > on a named pipe and read it from Python? > https://askubuntu.com/questions/226278/run-script-on-wakeup Thanks, that gives me something to munch on. -- https://mail.python.org/mailman/listinfo/python-list

Receive a signal when waking or suspending?

2022-04-23 Thread Skip Montanaro
It's not clear there is a straightforward way to catch a signal or get an event notification when my computer (Dell running XUbuntu 20.04) is about to sleep or when it's just awakened. The app uses tkinter. Is there some more-or-less easy way to do this? Mac support would be nice (I have my eye on

Re: asyncio+tkinter

2022-03-31 Thread Skip Montanaro
> > > Given that both asyncio & tkinter are modules in the standard lib and > both > > have event loops, I would have expected to find some "best practice" > > solution to mixing the two. > > Agreed. For GTK, you can use a dedicated loop policy like this: > > import asyncio_glib > asyncio.set_event

Re: Set tkinter top-level window to "always on visible workspace"

2022-03-29 Thread Skip Montanaro
> Also, wmctrl accepts window names instead of ids if you omit the -i > option. In case winfo_id() is not returning the id you need. Nice. That worked. FWIW, Tk never gave me the very outermost window as the parent of the tkinter.Tk instance. Here's the start of hierarchy: % xwininfo -tree xwini

Re: Set tkinter top-level window to "always on visible workspace"

2022-03-28 Thread Skip Montanaro
> Would you accept a solution that involves a subprocess call? > > wmctrl -ir {id} -b add,sticky I'm already checking idle time with xprintidle(1), so what's one more (one-time) subprocess call? Small amount of history, I'm referring to this mouse/typing watcher: https://github.com/smontanaro/py

Re: Set tkinter top-level window to "always on visible workspace"

2022-03-28 Thread Skip Montanaro
> I think you must be using xfce4, not fvwm4 (there's an fvwm3 in > development). See https://xfce.org/ Both? % pgrep -fla xfwm4 1803 xfwm4 --replace 539426 xfwm4-settings % pgrep -fla xfce 1599 xfce4-session 1755 /usr/bin/ssh-agent /usr/bin/im-launch startxfce4 1782 /usr/lib/x86_64-linux-gnu/xf

Re: Set tkinter top-level window to "always on visible workspace"

2022-03-28 Thread Skip Montanaro
> I might be misguided, but on modern desktops that should be possible > with a few mouseclicks. E.g. in KDE, there is a little pin icon > displayed in every title bar of a toplevel window on the left side. Correct, and that's what I'm currently doing. I'm lazy though. I want the program to start

Re: Set tkinter top-level window to "always on visible workspace"

2022-03-27 Thread Skip Montanaro
> So you might tell your window manager to keep that window on the main workspace. Thanks. I'd forgotten about the possibility of doing this sort of thing in the window manager config. That would certainly be fine in this case. (It's been ages since I messed with this sort of thing.) Skip -- htt

Set tkinter top-level window to "always on visible workspace"

2022-03-27 Thread Skip Montanaro
I have a tkinter app (Ubuntu/X11 env) whose main window should always be displayed on the currently visible workspace. Is there some way to set that attribute programmatically? I see that there is a tkinter.Wm class and that Toplevel widgets have a wm_attributes method, but haven't found any exampl

Re: How to detect an undefined method?

2022-03-27 Thread Skip Montanaro
> Let's say I have a Python app and have used an undefined method somewhere. > Let > us further assume I have not detected it thru my tests. > > Is there a way to detect it before deploying the app? pylint doesn't > notice it. > This is maybe not exactly what you're looking for, but writing a test

asyncio+tkinter

2022-03-21 Thread Skip Montanaro
a few solutions out in the wild, but this seems like something which might best be addressed in either the asyncio or tkinter documentation, or better yet, implemented in one or the other. Skip Montanaro -- https://mail.python.org/mailman/listinfo/python-list

Re: Gunicorn - HTTP and HTTPS in the same instance?

2022-01-08 Thread Skip Montanaro
Thanks all. I was hoping to get away without something more sophisticated like NGINX. This is just a piddly little archive of an old mailing list running on a single-core Ubuntu VM somewhere on the East Coast. Speed is not a real requirement. Load balancing seemed like overkill to me. Still, I gues

Gunicorn - HTTP and HTTPS in the same instance?

2022-01-07 Thread Skip Montanaro
Hopefully some Pythonistas are also Gunicornistas. I've had little success finding help with a small dilemma in the docs or in other more specific sources. I'm testing out a new, small website. It is just Gunicorn+Flask. I'd like to both listen for HTTP and HTTPS connections. Accordingly, in my co

Re: email.message_from_file & quoted printable

2021-12-25 Thread Skip Montanaro
> That sometimes you want the raw content as it was in the file? That if > you have that choice (decoded or raw) the default should be False, as it > does less? Yeah, thinking back later, the round-trip possibility seemed plausible. I'll stop overthinking this now... > That we my _first_ instinct

Re: email.message_from_file & quoted printable

2021-12-24 Thread Skip Montanaro
Cameron> Try decode=True. Skip> :dopeslap: Thanks. Never been all that consistent reading documentation. The more I think about it, the more I think maybe my lack of documentation reading wasn't all that unreasonable. The content transfer encoding and charset are properties of the message as a wh

Re: email.message_from_file & quoted printable

2021-12-23 Thread Skip Montanaro
> > From the docs: > > get_payload(i=None, decode=False) ... Try decode=True. :dopeslap: Thanks. Never been all that consistent reading documentation. Skip -- https://mail.python.org/mailman/listinfo/python-list

email.message_from_file & quoted printable

2021-12-23 Thread Skip Montanaro
I have a bunch of old email archives I'm messing around with, for example, rendering them on-demand in HTML. Some of the files use quoted printable content transfer encoding. Here's one (with a number of headers elided): >From classicrendezvous-admin Mon Dec 4 15:29:22 2000 Message-ID: <027801bf

Re: Sad news: Fredrik Lundh ("Effbot") has passed away

2021-12-12 Thread Skip Montanaro
Like many others, I'm saddened to hear of Fredrik Lundh's passing. I vaguely recall meeting him just once, probably at a Python workshop, before they grew big enough to be called conferences. Effbot.org was my Tkinter, ElemenTree, and PIL reference and cheat sheet. My attention to Python developme

Proliferation of Python packaging formats

2021-11-17 Thread Skip Montanaro
Is the proliferation of packaging formats in Python as nutzo as this author believes? https://drewdevault.com/2021/11/16/Python-stop-screwing-distros-over.html Asking because I've never been in the business of releasing "retail" Python applications or packages. Skip -- https://mail.python.org/m

Re: Package conflicts trying to install jpegdupes package

2021-09-27 Thread Skip Montanaro
Woo hoo! It's installed. The ultimate error was a missing turbojpeg.h file. Thank goodness for the apt-file command. I was able to track that down to the libturbojpeg0-dev package, install that, and after a bit more fussing around now have jpegdupes installed. Thanks for the help, Skip -- https:

Re: Package conflicts trying to install jpegdupes package

2021-09-27 Thread Skip Montanaro
> > For the most part, a proper colorizing compiler can make the > errors stand out among the spam of warnings, but it's hard when people > copy and paste just the text. > In my defense, the entire traceback was red. :-) It's quite possible that GCC colorized its error/warning messages, but colori

Re: Package conflicts trying to install jpegdupes package

2021-09-27 Thread Skip Montanaro
> > Those are all warnings. Are there any errors that follow them? > Maybe I just missed the actual errors, but the compiler exit status was 1, so there must have been. I'll give it another try. The package doesn't seem to have had a release since 2018, but the > GitHub repository has had change

Package conflicts trying to install jpegdupes package

2021-09-27 Thread Skip Montanaro
I'd like to use the jpegdupes package but can't seem to get past compilation issued related to jpegtrans-cffi. Attempts to install any available versions on my XUbuntu system crap out with this C compiler error message: In file included from jpegtran/__py

Track 3.9 instead of 3.10?

2021-07-27 Thread Skip Montanaro
I have a development branch in my fork of python/cpython, the register2 branch of https://github.com/smontanaro/cpython. As I am dealing with virtual machine internals I've found the changes to the virtual machine between 3.9 and 3.10 too disruptive. I'd like to track 3.9 instead. How would I go ab

Re: imaplib: is this really so unwieldy?

2021-05-25 Thread Skip Montanaro
> It's working (with Cyrus), but I have the feeling I'm doing it all wrong > because it seems so unwieldy. I have a program, Polly , which I wrote to generate XKCD 936 passphrases. (I got the idea - and the name - from Chris Angelico. See the README.) It builds

Re: Bloody rubbish

2021-05-06 Thread Skip Montanaro
> > Machine language is so much simpler, and you can code with just a hexpad. > Pshaa... All you need are front panel switches. ;-) (Yes, I had a professor who required is to 'key' in our programs on the front panel, of a rack mounted PDP-11 as I recall. Needless to say, we didn't use an assembler

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Skip Montanaro
> > Not that I support shutting down the Usenet/email gateway -- the > > signal/noise ration seems fine to me. > > > On that I quite agree. :-) I remind people that the existing Usenet<->Mail gateway keeps the mailing list software on mail.python.org from migrating to Mailman 3. I'm sure Mark Sap

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Skip Montanaro
> Are you saying that the messages that appear occasionally from people > such as Ethan Furman claiming to be moderators and alleging that > particular people have been banned or suspended are lies? And that the > message I received once saying that my comp.lang.python post had been > rejected from

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Skip Montanaro
> Are you unaware that the group is already gatewayed to a moderated > mailing list for which all of that work is already done? What is this moderation of which you speak? I'm one of the Python postmasters (I maintain the SpamBayes setup) and am aware of a multi-part tool chain (black hole lists,

Re: About \033[m

2021-04-04 Thread Skip Montanaro
>Porque quando se usa formatac,ao de cores, o python nao consegue > centralizar dentro da cadeia de 40 caracteres ? > >Tive que colocar 54 no parametro pois de alguma forma esta sendo >considerado os caracteres de dentro do comando \033[m Python doesn't know there is anything speci

Re: Code Formatter Questions

2021-03-28 Thread Skip Montanaro
> 1) Are there any major other formatters that I can/should look at? I see some > "online" pretty printers, but I'm after something I can run on whole > recursive directories of code. I use Emacs, so I'm kind of biased, but I find its python-mode does a good job, good enough that I wouldn't use

Re: [Python-ideas] Looking for people interested in a Python register virtual machine project

2021-03-23 Thread Skip Montanaro
> a) You're working with CPython bleeding edge. > b) You find that (bleeding edge) adding extra chore. > c) Nobody told you to work on bleeding (nor boss, nor a maintainer who > said "I'll merge it once you've done"), > > Then: why do you complicate your task by working on bleeding edge? > Could ta

Re: [Python-ideas] Looking for people interested in a Python register virtual machine project

2021-03-22 Thread Skip Montanaro
Thanks for the response. I will try to address your comments inline. > I guess it should be a good idea to answer what's the scope of this > project - is it research one or "production" one? If it's research one, > why be concerned with the churn of over-modern CPython versions? > Wouldn't it be b

Re: [Python-ideas] Looking for people interested in a Python register virtual machine project

2021-03-22 Thread Skip Montanaro
> Yeah, that is old writing, so is probably less clear (no pun intended) > than it should be. In frame_dealloc, Py_CLEAR is called for > stack/register slots instead of just Py_XDECREF. Might not be > necessary. Also, the intent is not to change any semantics here. The implementation of RETURN_VAL

Re: [Python-ideas] Looking for people interested in a Python register virtual machine project

2021-03-22 Thread Skip Montanaro
> In the "Object Lifetime" section you say "registers should be cleared upon > last reference". That isn't safe, since there can be hidden dependencies on > side effects of __del__, e.g.: > > process_objects = create_pipeline() > output_process = process_objects[-1] > return output_pr

Re: [Python-ideas] Looking for people interested in a Python register virtual machine project

2021-03-20 Thread Skip Montanaro
also intended to be the same thing, and for a while > had a fair number of contributors. Unfortunately, it never obtained the > performance wins that were good for. > > On Sat, Mar 20, 2021, 11:55 AM Skip Montanaro > wrote: > >> Back in the late 90s (!) I worked on a reimagi

Looking for people interested in a Python register virtual machine project

2021-03-20 Thread Skip Montanaro
hon's internals. Questions/comments/pull requests welcome. Skip Montanaro -- https://mail.python.org/mailman/listinfo/python-list

Re: .title() - annoying mistake

2021-03-19 Thread Skip Montanaro
> > That's annoying. You have to roll your own solution! > Certainly seems like a known issue: https://bugs.python.org/issue12737 That issue was opened in 2011. Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] Re: Python 0.9.1

2021-02-16 Thread Skip Montanaro
> Also mind > http://www.dalkescientific.com/writings/diary/archive/2009/03/27/python_0_9_1p1.html > for result comparison. Thanks, Paul. I had lost track of Andrew. Good to know he's still out there. I wonder why his tar file was never sucked up into the historical releases page. Whew! My stupid

Re: [Python-Dev] Re: Python 0.9.1

2021-02-16 Thread Skip Montanaro
> If someone knows how to get the original Usenet messages from what Google > published, let me know. Seems the original shar is there buried in a Javascript string toward the end of the file. I think I've got a handle on it, though it will take a Python script to massage back into correct format

Re: [Python-Dev] Re: Python 0.9.1

2021-02-16 Thread Skip Montanaro
> > Wow. Was white-space not significant in this release of Python? I see the >> lack of indentation in the first Python programs. >> > > Indentation most certainly was significant from day 0. I suspect what > happened is that these files got busted somehow by the extraction process > used by Skip

Python 0.9.1

2021-02-16 Thread Skip Montanaro
A note to webmas...@python.org from an astute user named Hiromi in Japan* referred us to Guido's shell archives for the 0.9.1 release from 1991. As that wasn't listed in the historical releases README file: https://legacy.python.org/download/releases/src/README I pulled the shar files (and a patc

Re: UTF-16 or something else?

2021-02-09 Thread Skip Montanaro
> > It's UTF-8 with a UTF-16 BOM prepended, which is not uncommon when you > have a file that's been converted to UTF-8 from UTF-16 or has been > produced by shitty Microsoft software. You can tell instantly at a > glance that it's not UTF-16 because the ascii dump would l.o.o.k. > .l.i.k.e. .t.h.i

Re: UTF-16 or something else?

2021-02-09 Thread Skip Montanaro
> > Try setting encoding to: "utf-8-sig". > > 'eb bb bf' is the byte order mark for UTF8 (most systems do not include > this in UTF-8 encoded files) > > Python will correctly read UTF8 BOMs if you use the 'utf-8-sig' encoding > when reading files > Excellent, thanks. That worked like a charm. Know

UTF-16 or something else?

2021-02-09 Thread Skip Montanaro
I downloaded US hospital ICU capacity data this morning from this page: https://healthdata.gov/dataset/covid-19-reported-patient-impact-and-hospital-capacity-facility (The download link is about halfway down the page.) Trying to read it using my personal CSV tools without specifying an encoding,

Log exception so traceback contains timestamp and level?

2021-02-06 Thread Skip Montanaro
The logging package can log exceptions and call stacks, but it does (in my opinion) a suboptimal job of it. Consider this simple example: >>> import logging >>> FORMAT = '%(asctime)-15s %(levelname)s %(message)s' >>> logging.basicConfig(format=FORMAT, force=True) >>> log.warning("msg", stack_info=

Best practice for handling exceptions raised at lower levels?

2021-02-01 Thread Skip Montanaro
I'm curious if there are best practices for handling exceptions raised by lower level modules and packages. For example, I wrote an application called polly[1] which constructs a personalized dictionary from email messages using IMAP4. That dictionary is then used as input to a password generator b

Re: IDE tools to debug in Python?

2021-01-28 Thread Skip Montanaro
> > > Python is an interactive language. You can develop a lot while working > > on a Python console. Then copy and paste into a program. > > Absolutely, the humble interactive prompt is often overlooked > as a development tool. It's not as good as the "evaluate > expression" tool in the Smalltalk

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread Skip Montanaro
CW> How do you troubleshooting/debugging in Python? GE> Mostly I read exception trace and read the code and think about it. GE> If that doesn't work, I add some print() or syslog() calls. CW> I know hardcore computer scientists would tell me about Python debugger. GE> I've been writing Python fo

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

2021-01-14 Thread Skip Montanaro
> I don't understand why sqrt is not a built-in function. > Why do we have to first import the function from the math module? > I use it ALL THE TIME! For one, it's specific to numeric types. You might use it all the time, but I (for example) almost never need to use it, or to import the math modu

Re: Python3 change logs

2020-12-15 Thread Skip Montanaro
Dang... I'm having very incomplete thoughts. Apologies for the multiple replies when one would have sufficed. https://docs.python.org/3/whatsnew/3.9.html Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 change logs

2020-12-15 Thread Skip Montanaro
Also, check www.python.org for "What's New" pages. I believe one is generated for every release. It will be less detailed than change logs in GitHub, but more reader friendly. Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3 change logs

2020-12-15 Thread Skip Montanaro
Change logs are kept as part of the source, I believe. Try browsing the cpython GitHub repo: https://github.com/python/cpython Skip On Tue, Dec 15, 2020, 10:05 AM Rich Shepard wrote: > I've upgraded from Python-3.7.x to Python-3.9.x and want to learn about > differences (if any) in tkinter bet

Re: How to run Jupyter notebook in command line and get full error message?

2020-11-29 Thread Skip Montanaro
> > My VPN keeps dropping and can not run Jupyter Notebook as it is. > You don't provide a lot of detail, but this seems similar to the kind of flaky networking we used to deal with in the Before Times. Simply connecting directly to a host over the Internet was often plagued by disconnects. For th

Re: Cannot marshal objects

2020-11-27 Thread Skip Montanaro
> Because the marshaling is happening in the guts of xmlrpc. Okay, I misunderstood your original message. You used the word "marshal" (and the xmlrpc error did as well). I thought you were referring to the marshal module. I didn't understand (and ignored) the references to the xmlrpc module. In Py

Re: Cannot marshal objects

2020-11-27 Thread Skip Montanaro
> I am getting this error. I assume you mean the email subject. It doesn't work in 3.8 either: >>> import decimal >>> d = decimal.Decimal(3.5) >>> d Decimal('3.5') >>> import marshal >>> marshal.dumps(d) Traceback (most recent call last): File "", line 1, in ValueError: unmarshallable object

Re: constant folding - why not more

2020-11-10 Thread Skip Montanaro
> > On the contrary, comparison remains for runtime: > >>> dis.dis(compile('1 < 2', filename='', mode='eval', > >>> optimize=2)) > 1 0 LOAD_CONST 0 (1) > 2 LOAD_CONST 1 (2) > 4 COMPARE_OP 0 (<) > 6 RETUR

Re: Help

2020-11-03 Thread Skip Montanaro
> > When I run this, my answer is 8 but it should be 336 can some help ._. > Looks like you are returning from inside the loop. Skip > -- https://mail.python.org/mailman/listinfo/python-list

Re: Artie 3000 the coding robot

2020-09-17 Thread Skip Montanaro
> > Sounds like an expensive way to do turtle graphics... > > > Really expensive -- From what I could make out, the "robot" has no > independent functioning. It is tethered (WiFi, maybe Bluetooth) to the > controlling computer. The programs run on the computer and send command > packe

Artie 3000 the coding robot

2020-09-16 Thread Skip Montanaro
I'm looking for feedback on Artie 3000 the Coding Robot. It's recommended by wirecutter.com for introductory programming for ages seven and up (though stemfinity.com says 7-12). I was thinking about getting it for my grandson who's turning 12

Re: Python Pandas split Date in day month year and hour

2020-08-19 Thread Skip Montanaro
> I would like know how can I get for this array the values for day, month > and hour: > > 2017-11-01 03:00:00 year = 2017 month = 11day = 1and > hour = 3 Pandas has a datetime type. You should probably be using it. It's been awhile (a year at least), but if your datetime co

Re: Syntax question

2020-08-16 Thread Skip Montanaro
> Typing is not required by > Python. However, you may find the extra error-checking helpful... I haven't used type hints much, if at all, but my understanding is that the "extra error-checking" of which you speak is gotten through other static checkers, correct? I know the syntax was developed wi

Re: Explicit is better than Implicit

2020-08-06 Thread Skip Montanaro
> > When Excel reads a file, it looks for stuff and decides to upgrade its > type. Eg dates etc (particularly pernicious with US-style dates versus > the rest of the planet). Mojibake for data ensues. > > As always, I am reminded of Heuer's Razor: > > If it can't be turned off, it's not a feat

Explicit is better than Implicit

2020-08-06 Thread Skip Montanaro
Hmmm... Rename genes, fix Excel, or dump Excel in favor of Python? I know what my choice would have been. :-) https://www.theverge.com/2020/8/6/21355674/human-genes-rename-microsoft-excel-misreading-dates Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: Strings: double versus single quotes

2020-05-23 Thread Skip Montanaro
> > > May I ask why not simply like this: > > stmt = """ > select foo from bar > where a = 'bag' > and c = 'dog' > """ > Sorry, I don't recall. I wouldn't be at all surprised that it has something to do with Emacs's Python mode behavior. Emacs wouldn't know what to do

  1   2   3   4   5   6   7   8   9   10   >