Re: Python not showing correct version

2023-03-30 Thread Thomas Passin
On 3/30/2023 10:17 AM, Sumeet Firodia wrote: Hi Team, I have installed Python 3.8 for Snowpark but when I check the version in command prompt it shows me Python 3.10.10. C:\Users\admin>python --version Python 3.10.10 Also when I try to uninstall 3.10 it says no such version is installed. C:\

Re: built-in pow() vs. math.pow()

2023-03-30 Thread Thomas Passin
On 3/30/2023 5:15 AM, Andreas Eisele wrote: I sometimes make use of the fact that the built-in pow() function has an optional third argument for modulo calculation, which is handy when dealing with tasks from number theory, very large numbers, problems from Project Euler, etc. I was unpleasantl

Re: OT? Beware of ChatGPT

2023-03-30 Thread Thomas Passin
n this field). It's not about programming at all. Neural Networks and Fuzzy Systems: A Dynamical Systems Approach to Machine Intelligence Bart Kosko I wish I knew where my own copy of it is. I think it may be buried in a box in a storage locker. On Thursday, March 30, 2023 at 11:37:34 AM

Re: OT? Beware of ChatGPT

2023-03-30 Thread Thomas Passin
I'm a little ambivalent. I'd certainly like to play around with the stuff, and apparently the code in this post is set up to use actual GPT trained coefficients. But what I'm most interested just now is training with other specialized data sets, except that the ones I want don't exist, or I do

Re: OT? Beware of ChatGPT

2023-03-29 Thread Thomas Passin
GPT in 60 lines of Python - GPT in 60 lines <https://jaykmody.com/blog/gpt-from-scratch/#what-is-a-gpt?> On Tuesday, January 31, 2023 at 10:17:26 AM UTC-5 Thomas Passin wrote: > Here is an interesting link that among other things shows how ChatGPT has > major weaknesses in math

Re: Ole version set as default

2023-03-29 Thread Thomas Passin
On 3/29/2023 12:46 PM, Pranav Bhardwaj wrote: Dear sir, I am Pranav Bhardwaj and I stuck in a problem. My problem is that in my system I have python 3.11.2 but when I type python in my command prompt, my command prompt show that python version 2.7.13 as a default. And I can't be a

New Leo "Package" File Format?

2023-03-29 Thread Thomas Passin
There is a perennial problem when one wants to give a Leo outline to someone else. It happens when an outline contains external files, or images to display, or any other data files that might be needed. For example, an article written with the Viewrendered3 plugin in mind, or for a Sphinx do

Re: Standard class for time *period*?

2023-03-29 Thread Thomas Passin
On 3/29/2023 2:17 AM, Loris Bennett wrote: I am glad to hear that I am not alone :-) However, my use-case is fairly trivial, indeed less complicated than yours. So, in truth I don't really need a Period class. I just thought it might be a sufficiently generic itch that someone else with a more

Re: Images In Leo Nodes?

2023-03-29 Thread Thomas Passin
10:24:33 AM UTC-4 Edward K. Ream wrote: > On Tue, Mar 28, 2023 at 5:04 PM Thomas Passin wrote: > > It would be very useful if an image could be embedded into a Leo body. >> Probably no one would want to do this in a program or script, but for >> documentation it could be very

Re: New undo methods for multiple headline changes on branch 'boltex/issue3219'

2023-03-28 Thread Thomas Passin
Without a PR, it's hard to review the code without knowing what has been changed. On Tuesday, March 28, 2023 at 10:46:42 PM UTC-4 Félix wrote: > If you'd like to test out some new proposed methods to undo/redo commands > that alter many headlines at once: > https://github.com/leo-editor/leo-ed

Re: Images In Leo Nodes?

2023-03-28 Thread Thomas Passin
On Tuesday, March 28, 2023 at 8:59:01 PM UTC-4 gates...@gmail.com wrote: Not what you’re really looking for, but Leo already supports @svg nodes. Of course, those are just the image in a node, viewable in VR — no text around them in the same node, to my knowledge. Right, and VR3 has even mor

Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-28 Thread Thomas Passin
On 3/28/2023 1:50 PM, a a wrote: On Tuesday, 28 March 2023 at 18:12:40 UTC+2, Thomas Passin wrote: On 3/28/2023 8:47 AM, a a wrote: Ok, I can export bookmarks to html file and open it in Firefox to get a long list of clickable urls but icon of the bookmarked web page is missing. When I open

Images In Leo Nodes?

2023-03-28 Thread Thomas Passin
It would be very useful if an image could be embedded into a Leo body. Probably no one would want to do this in a program or script, but for documentation it could be very helpful. You can put an image into a ReST, MD, or Asciidoc node and view it with VR3 or by creating Sphinx output. But e

Re: Script To Automatically Change The Body Font Based On Node's @Language

2023-03-28 Thread Thomas Passin
Here's a script to reverse the effects of the change body script. On Tuesday, March 28, 2023 at 12:01:18 PM UTC-4 Edward K. Ream wrote: > On Tue, Mar 28, 2023 at 9:56 AM Thomas Passin wrote: > >> It would be easy to have a companion script that eliminates the >> font

Re: Standard class for time *period*?

2023-03-28 Thread Thomas Passin
On 3/28/2023 12:13 PM, Grant Edwards wrote: On 2023-03-28, Dennis Lee Bieber wrote: So far, you seem to be the only person who has ever asked for a single entity incorporating an EPOCH (datetime.datetime) + a DURATION (datetime.timedelta). It seems to me that tuple of two timdate objects (st

Re: [Request for Assistance] To uninstall python installed in other user profile (Win 10)

2023-03-28 Thread Thomas Passin
On 3/28/2023 12:56 AM, Yogesh Tirthkar wrote: Hi Team, Could you please advise on the scenario in windows 10 machine : Where we need to uninstall/remove python from user profile A (installed by user A in its own profile folder) - via an admin user or system account. Currently when we try to u

Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-28 Thread Thomas Passin
On 3/28/2023 8:47 AM, a a wrote: Ok, I can export bookmarks to html file and open it in Firefox to get a long list of clickable urls but icon of the bookmarked web page is missing. When I open Bookmarks as right a side-bar I can view and identify an individual Boomarks by icon, so I would like

Re: Script To Automatically Change The Body Font Based On Node's @Language

2023-03-28 Thread Thomas Passin
It would be easy to have a companion script that eliminates the font-changing behavior. If people say they want it, I'll work one up and post it. On Tuesday, March 28, 2023 at 10:45:14 AM UTC-4 Thomas Passin wrote: Nearly all Leo themes use a monospaced typeface for the body font. Th

Script To Automatically Change The Body Font Based On Node's @Language

2023-03-28 Thread Thomas Passin
Nearly all Leo themes use a monospaced typeface for the body font. This is what you want for programming, but for documentation and other non-code writing, many people would prefer a non-monospaced font. Some might event wish for a serif style typeface. The attached script installs a global s

Re: ENB: About headline numbers

2023-03-28 Thread Thomas Passin
On Tuesday, March 28, 2023 at 9:08:01 AM UTC-4 Edward K. Ream wrote: PR #3227 contains a draft implementation of issue #3121 : headline numbers. While working on this PR, several problems

Re: PR #3224: mod_autosave is ready for review

2023-03-28 Thread Thomas Passin
When verbose mode is on, then when autosave happens the Log pane switches to the Log tab to write the message. This can be really annoying if you are working in another tab at the time. Another reason for the verbose mode setting. On Monday, March 27, 2023 at 8:10:02 PM UTC-4 Edward K. Ream w

Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-27 Thread Thomas Passin
On 3/27/2023 8:37 PM, a a wrote: I can select All Opened Tabs (as from the given link) and get 1,000+ Opened Tabs ( I am afraid, this is s number of all saved bookmarks in the past) I go to menu, Bookmarks, Manage Boomarks and copy Tabs and https://www.textfixer.com/html/convert-url-to-html-lin

Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-27 Thread Thomas Passin
On 3/27/2023 8:37 PM, a a wrote: To save the tabs, right click any one of them and select the "Select All Tabs" item. They will all highlight. Right click on one of them and select the "Bookmark Tabs" item. A dialog box will open with an entry lone for the Name to use (like "Tabset1") and a locat

Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-27 Thread Thomas Passin
On 3/27/2023 4:02 PM, Thomas Passin wrote: On 3/27/2023 3:07 PM, a a wrote: On Monday, 27 March 2023 at 19:19:41 UTC+2, Thomas Passin wrote: On 3/27/2023 10:07 AM, a a wrote: Ok, I know, I need to switch to Windows 10 run on another PC next to me. I need to learn how to copy and move every

Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-27 Thread Thomas Passin
On 3/27/2023 3:07 PM, a a wrote: On Monday, 27 March 2023 at 19:19:41 UTC+2, Thomas Passin wrote: On 3/27/2023 10:07 AM, a a wrote: Ok, I know, I need to switch to Windows 10 run on another PC next to me. I need to learn how to copy and move every web page opened in Firefox as a reference to

Re: New Way To Expand/Contract Leo Trees

2023-03-27 Thread Thomas Passin
I did forget to uncomment the line, but I *thought* I had caught that with a later PR. Sorry! On Monday, March 27, 2023 at 4:40:47 AM UTC-4 Edward K. Ream wrote: On Mon, Mar 27, 2023 at 2:00 AM lewis wrote: I added *@bool **use-mouse-expand-gestures** - True* to myLeoSetttings.leo but the

Re: Standard class for time *period*?

2023-03-27 Thread Thomas Passin
On 3/27/2023 11:34 AM, rbowman wrote: On Mon, 27 Mar 2023 15:00:52 +0200, Loris Bennett wrote: I need to deal with what I call a 'period', which is a span of time limited by two dates, start and end. The period has a 'duration', which is the elapsed time between start and end. The d

Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-27 Thread Thomas Passin
On 3/27/2023 10:07 AM, a a wrote: Ok, I know, I need to switch to Windows 10 run on another PC next to me. I need to learn how to copy and move every web page opened in Firefox as a reference to social media, web sites for Python, chat and more (about 50 web pages live opened 😉 This sounds l

Re: New Way To Expand/Contract Leo Trees

2023-03-26 Thread Thomas Passin
I agree that making Leo do autosave smoothly every few seconds or at least often could be hard. I certainly wouldn't want it to freeze for a short (or sometimes longer) time while it saved. OTOH, I'm never sure I really want autosave. I've had plenty of times where I don't save on purpose sin

Re: New Way To Expand/Contract Leo Trees

2023-03-26 Thread Thomas Passin
On Sunday, March 26, 2023 at 10:53:47 AM UTC-4 Edward K. Ream wrote: On Sun, Mar 26, 2023 at 9:43 AM Thomas Passin wrote: I just now got repeated crashes when trying to do a particular operation - it started happening every time. My script goes out to the internet and tries to download a

Re: New Way To Expand/Contract Leo Trees

2023-03-26 Thread Thomas Passin
Ream wrote: > On Sun, Mar 26, 2023 at 8:06 AM Thomas Passin wrote: > >> I think it's a crash from Qt, but not from this new UI code. > > > Imo the new UI code isn't off the hook yet. Qt should never crash, but > Leo's tree drawing code has crashed Qt many

Re: Move Location Of ~/.leo File For Future Installs?

2023-03-26 Thread Thomas Passin
On Sunday, March 26, 2023 at 10:21:21 AM UTC-4 al...@laerios.com wrote: > @paolomi thinks it should not be in ~/ so as to reduce clutter in the > user's home directory. On 26.3.2023 07:25, Edward K. Ream wrote: > - The home directory is a natural place for this data. > - The home directory o

Re: Devel reverts recent UI work

2023-03-26 Thread Thomas Passin
I don't think it's the new code, as I said on the other thread. I think there are some Qt problems in general, but I don't think they are from this. I've submitted a new PR that has a setting that needs to be set to True to enable the new behavior. The code did require something new, and I s

Re: Patrick Sheehan: Major Issues with Python

2023-03-26 Thread Thomas Passin
On 3/25/2023 4:03 PM, Patrick Sheehan wrote: Hello, I have been working with the attached book (See photo) Photos do not come through on this list, so don't bother to attach any. Type or copy-paste any useful text. to try to learn Python and so far it has been a complete nightmare trying to g

Re: New Way To Expand/Contract Leo Trees

2023-03-26 Thread Thomas Passin
I think it's a crash from Qt, but not from this new UI code. That's because I have been getting hard crashes for weeks at least. I did not used to get them, so I'm thinking it's something about a particular version of Qt, or a Windows update (In fact, I had an update recently). I think it's Q

Re: Move Location Of ~/.leo File For Future Installs?

2023-03-26 Thread Thomas Passin
On Sunday, March 26, 2023 at 6:25:34 AM UTC-4 Edward K. Ream wrote: On Sat, Mar 25, 2023 at 8:36 PM Thomas Passin wrote: @paolomi has requested that Leo's user's home directory be moved - on Linux - from the location it has always had to a new one. The current location is ~/.leo.

Re: Move Location Of ~/.leo File For Future Installs?

2023-03-25 Thread Thomas Passin
Thanks for your thoughts, Felix. XDG is one of those not-quite-standards that is supposed to promote interoperability and "sane" locations for various kinds of system files and others. I'm no expert but it seems to me that some major distros follow it less strictly for user locations than oth

Move Location Of ~/.leo File For Future Installs?

2023-03-25 Thread Thomas Passin
@paolomi has requested that Leo's user's home directory be moved - on Linux - from the location it has always had to a new one. The current location is ~/.leo. @paolomi thinks it should not be in ~/ so as to reduce clutter in the user's home directory. Existing installations would not be chan

New Way To Expand/Contract Leo Trees

2023-03-25 Thread Thomas Passin
Just merged into the devel branch is a new way to expand or contract nodes using the mouse. When you hold the CTRL key and move the mouse over a node, it will expand. When you hold down the SHIFT key instead, the node will contract. In practice, this means that you can just wave the mouse ove

Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-23 Thread Thomas Passin
On 3/23/2023 3:38 PM, Mats Wichmann wrote: On 3/23/23 09:48, Thomas Passin wrote: I didn't realize that Christoph Gohlke is still maintaining this site. Unless the the last-changed stuff stopped working, it's in a static state: by Christoph Gohlke. Updated on 26 June 2022 at 07:

Python Infrequently Asked Questions

2023-03-23 Thread Thomas Passin
I bookmarked this years ago and just came across it again. An oldie but goodie! http://norvig.com/python-iaq.html -- https://mail.python.org/mailman/listinfo/python-list

Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-23 Thread Thomas Passin
On 3/18/2023 3:05 PM, Thomas Passin wrote: downloaded and run HWiNFO and AVE not supported, not greened out That's too bad; you may be out of luck. It's possible that someone has compiled the .pyd library in such a way that it does not need the instruction set extensions. I

Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-22 Thread Thomas Passin
On 3/22/2023 8:09 AM, a a wrote: On Saturday, 18 March 2023 at 20:12:22 UTC+1, Thomas Passin wrote: On 3/17/2023 11:52 AM, a a wrote: On Friday, 17 March 2023 at 16:32:53 UTC+1, a a wrote: On Friday, 17 March 2023 at 16:03:14 UTC+1, Thomas Passin wrote: On 3/16/2023 8:07 PM, a a wrote

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-20 Thread Thomas Passin
On 3/20/2023 11:21 AM, Edmondo Giovannozzi wrote: def sum1(): s = 0 for i in range(100): s += i return s def sum2(): return sum(range(100)) Here you already have the numbers you want to add. Actually using numpy you'll be much faster in this case: § imp

Re: How to get get_body() to work? (about email)

2023-03-19 Thread Thomas Passin
On 3/18/2023 10:49 PM, Peng Yu wrote: Hi, https://docs.python.org/3/library/email.parser.html It says "For MIME messages, the root object will return True from its is_multipart() method, and the subparts can be accessed via the payload manipulation methods, such as get_body(), iter_parts(), and

Re: Q: argparse.add_argument()

2023-03-18 Thread Thomas Passin
On 3/18/2023 10:52 PM, Gisle Vanem via Python-list wrote: Thomas Passin wrote: So please, try to think out how your questions will seem to the reader, and be clear about what you are asking.  You may not know the terminology that some other people use, but don't let that stop you from

Re: Q: argparse.add_argument()

2023-03-18 Thread Thomas Passin
On 3/18/2023 4:05 PM, Chris Angelico wrote: On Sun, 19 Mar 2023 at 06:35, Gisle Vanem via Python-list wrote: Thomas Passin wrote: Are you trying to troll here? You just showed how you got an error with this construction, so why are you asking how to get an error with this construction

Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-18 Thread Thomas Passin
On 3/17/2023 11:52 AM, a a wrote: On Friday, 17 March 2023 at 16:32:53 UTC+1, a a wrote: On Friday, 17 March 2023 at 16:03:14 UTC+1, Thomas Passin wrote: On 3/16/2023 8:07 PM, a a wrote: Crash report: Problem Caption: Problem Event Name: APPCRASH Application name: python.exe Application

Re: Q: argparse.add_argument()

2023-03-18 Thread Thomas Passin
On 3/18/2023 2:02 PM, Gisle Vanem via Python-list wrote: I accidentally used 'argparse' like this in my Python 3.9 program:   parser.add_argument ("-c, --clean",  dest="clean", action="store_true")   parser.add_argument ("-n, --dryrun", dest="dryrun", action="store_true") instead of:   parser

Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-18 Thread Thomas Passin
On 3/17/2023 11:32 AM, a a wrote: On Friday, 17 March 2023 at 16:03:14 UTC+1, Thomas Passin wrote: It would be worth trying to downgrade the multiarray version to an earlier one and see if that fixes the problem. Thank you Thomas for your kind reply. I am fully aware to be living on an old

Re: Unable to create Leo's Documentation locally

2023-03-18 Thread Thomas Passin
On Saturday, March 18, 2023 at 1:28:05 PM UTC-4 viktor@gmail.com wrote: Hello Thomas I used a slightly simpler version, since I did not want to add any dependency & make it non-windows specific: import sys import subprocess pyexe = sys.executable cmd = [pyexe, '-m', 'sphinx', '-C',

Re: Fwd: Friday finking: IDE 'macro expansions'

2023-03-18 Thread Thomas Passin
On 3/18/2023 8:15 AM, Peter J. Holzer wrote: On 2023-03-18 08:46:42 +, Alan Gauld wrote: On 17/03/2023 17:55, Thomas Passin wrote: I used Delphi and Smalltalk/V which both pretty much only exist within their own IDEs and I used their features extensively. Back when Delphi first came out

Re: Fwd: Friday finking: IDE 'macro expansions'

2023-03-18 Thread Thomas Passin
On 3/18/2023 4:46 AM, Alan Gauld wrote: On 17/03/2023 17:55, Thomas Passin wrote: I used Delphi and Smalltalk/V which both pretty much only exist within their own IDEs and I used their features extensively. Back when Delphi first came out, when I first used it, I don't remember any IDE

Re: Fwd: Friday finking: IDE 'macro expansions'

2023-03-17 Thread Thomas Passin
On 3/17/2023 1:13 PM, Alan Gauld wrote: Oops! I meant to send this to the group not just Dave. Forwarded Message On 16/03/2023 22:55, dn via Python-list wrote: Do you make use of your IDE's expansionist tendencies, and if-so, which ones? When I'm writing Java/C++/C# yes,

Re: Please test PR #3150: @font and @color bugs

2023-03-17 Thread Thomas Passin
I'm very confused here. On Friday, March 17, 2023 at 10:55:27 AM UTC-4 Edward K. Ream wrote: PR #3150 fixes problems with `@color` and `@font` settings. Apparently @font settings have not been working for a year or more. In that sense, the ch

Re: Numpy, Matplotlib crash Python 3.8 Windows 7, 32-bit - can you help ?

2023-03-17 Thread Thomas Passin
On 3/16/2023 8:07 PM, a a wrote: Crash report: Problem Caption: Problem Event Name: APPCRASH Application name: python.exe Application version: 3.8.7150.1013 Application time signature: 5fe0df5a Error module name: _multiarray_umath.cp38-win32.pyd Version of the module with t

Re: Friday finking: IDE 'macro expansions'

2023-03-17 Thread Thomas Passin
On 3/17/2023 9:38 AM, Simon Ward wrote: On Fri, Mar 17, 2023 at 02:05:50PM +0100, Roel Schroeven wrote: Even better than simply highlighting is (IMO) a thing called "Rainbow Braces" or "Bracket Pair Colorization" I recently learned about: both braces of a matching pair get the same color, while

Re: Unable to create Leo's Documentation locally

2023-03-17 Thread Thomas Passin
The following script will build everything except the slides. Either it needs to be run from the *leo/doc* directory or the path needs to be added to the script instead of the "." in the last line: #see https://github.com/leo-editor/leo-editor/issues/1566 import sys import subprocess pyexe=sys.

Re: Friday finking: IDE 'macro expansions'

2023-03-16 Thread Thomas Passin
On 3/16/2023 6:55 PM, dn via Python-list wrote: It is a long, long, time since I've thrown one of these into the maelstrom of our musings. (have the nightmares receded?) Do you make use of your IDE's expansionist tendencies, and if-so, which ones? NB this is where vi/emacs enthusiasts star

Re: Implementing a plug-in mechanism

2023-03-15 Thread Thomas Passin
On 3/15/2023 6:06 PM, Weatherby,Gerard wrote: I do something similar to Thomas. (Also MIT licensed). I like objects. I like type hints. Each plugin needs to have check and purpose functions and accepts either PluginSpec (by default) or AddonSpec if it defines addon = True I omitted the check

Re: Implementing a plug-in mechanism

2023-03-15 Thread Thomas Passin
On 3/15/2023 2:45 PM, dn via Python-list wrote: On 16/03/2023 01.47, Loris Bennett wrote: I have written a program which, as part of the non-core functionality, contains a module to generate email.  This is currently very specific to my organisation, so the main program contains    import myorg

More Git Techniques From The Old New Thing

2023-03-15 Thread Thomas Passin
Raymond Chen sometimes shares git-wrangling techniques. Today's offering: How can I create a git feature branch that can merge into multiple other branches? -- You received this message because you are subscribed to the Google

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-15 Thread Thomas Passin
On 3/15/2023 11:01 AM, Chris Angelico wrote: On Thu, 16 Mar 2023 at 01:26, David Raymond wrote: I'm not quite sure why the built-in sum functions are slower than the for loop, or why they're slower with the generator expression than with the list comprehension. For small-to-medium data sizes

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-15 Thread Thomas Passin
On 3/15/2023 10:24 AM, David Raymond wrote: Or use the sum() builtin rather than reduce(), which was *deliberately* removed from the builtins. The fact that you can get sum() without importing, but have to go and reach for functools to get reduce(), is a hint that you probably shouldn't use reduc

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-14 Thread Thomas Passin
On 3/14/2023 3:48 AM, Alexander Nestorov wrote: I'm working on an NLP and I got bitten by an unreasonably slow behaviour in Python while operating with small amounts of numbers. I have the following code: ```python import random, time from functools import reduce def trainPerceptron(perceptro

Re: Tkinter and cv2: "not responding" popup when imshow launched from tk app

2023-03-14 Thread Thomas Passin
On 3/14/2023 6:54 AM, John O'Hagan wrote: Hi list I'm trying to use cv2 to display images created as numpy arrays, from within a tkinter app (which does other things with the arrays before they are displayed as images). The arrays are colour-coded visualisations of genomes and can be over a bill

Re: How to exit program with custom code and custom message?

2023-03-13 Thread Thomas Passin
On 3/13/2023 10:34 PM, scruel tao wrote: Interesting, `raise SystemExit` seems to have the same behavior as `sys.exit`: ```shell python -c "raise SystemExit(100)" echo $? <<< 100 python -c " import sys; sys.exit(100)" echo $? <<< 100 OTOH, you don't want to get too tricky: (on Windows, obvio

Re: How to exit program with custom code and custom message?

2023-03-13 Thread Thomas Passin
On 3/13/2023 11:50 PM, MRAB wrote: On 2023-03-14 03:29, Thomas Passin wrote: On 3/13/2023 10:34 PM, scruel tao wrote: Lars: I totally understand your reasoning here, but in some way it follows the unix philosophy: Do only one thing, but do that good. I understand, python is not strongly

Re: How to exit program with custom code and custom message?

2023-03-13 Thread Thomas Passin
On 3/13/2023 10:34 PM, scruel tao wrote: Lars: I totally understand your reasoning here, but in some way it follows the unix philosophy: Do only one thing, but do that good. I understand, python is not strongly typed, so `sys.exit` will be able to accept any types parameters rather than just

Re: =- and -= snag

2023-03-13 Thread Thomas Passin
On 3/13/2023 9:47 PM, Chris Angelico wrote: On Tue, 14 Mar 2023 at 12:38, Thomas Passin wrote: On 3/13/2023 9:07 PM, Chris Angelico wrote: Of course, all this is predicated on you actually putting whitespace around your equals signs. If you write it all crunched together as "x=-5"

Re: =- and -= snag

2023-03-13 Thread Thomas Passin
On 3/13/2023 9:07 PM, Chris Angelico wrote: Of course, all this is predicated on you actually putting whitespace around your equals signs. If you write it all crunched together as "x=-5", there's no extra clues to work with. Linters and code reviewers can make use of all the available informatio

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Thomas Passin
On 3/13/2023 11:54 AM, Rich Shepard wrote:> On Mon, 13 Mar 2023, Thomas Passin wrote: > >> No doubt, depending on the data formats used. But it's still going >> to be a big task. > > Thomas, > > True, but once you have a dataframe with all the information

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Thomas Passin
On 3/13/2023 11:23 AM, Rich Shepard wrote: On Mon, 13 Mar 2023, Thomas Passin wrote: But what I need is analysis of seismograms from 4,000 seismographs world wide to detect P-wave energy distribution underground around the earthquake to verify EQ Domino Effect In that case, you will have

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Thomas Passin
On 3/13/2023 12:39 AM, a a wrote: But what I need is analysis of seismograms from 4,000 seismographs world wide to detect P-wave energy distribution underground around the earthquake to verify EQ Domino Effect In that case, you will have to do a great deal of work to get all that data into a

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-13 Thread Thomas Passin
On 3/13/2023 12:39 AM, a a wrote: But some unknown reasons Matplotlib and numpy crash my Python 3.8 for Windows , 32-bit and no support is offered It is possible, using pip, to downgrade versions (e.g., of Matplotlob and numpy) to see if you can find versions that work. Of course moving to

Re: Can you process seismographic signals in Python or should I switch to Matlab ?

2023-03-11 Thread Thomas Passin
On 3/11/2023 6:54 PM, a a wrote: My project https://www.mathworks.com/help/matlab/matlab_prog/loma-prieta-earthquake.html If your goal is to step through this Matlab example, then clearly you should use Matlab. If you do not have access to Matlab or cannot afford it, then you would have to us

Re: OT: Breakthrough: "Liquid" neural networks

2023-03-11 Thread Thomas Passin
Interesting! And also hot off the presses, the complete neural structure of the brain of the fruit fly larva has been mapped. It has 93 neuron types, 3016 neurons, with, get this, *548,000* interconnections. The "liquid neural network" described in the Quanta article has 19 neurons and 253

Re: Lambda returning tuple question, multi-expression

2023-03-10 Thread Thomas Passin
On 3/10/2023 11:15 PM, aapost wrote: On 3/10/23 22:16, Thomas Passin wrote: [...] The additional note in the above is, when taking the def route above, the thing you would have to consider is what scope is the dictionary pids? Do you need to submit it to the lambda and subsequently the

Re: Lambda returning tuple question, multi-expression

2023-03-10 Thread Thomas Passin
On 3/10/2023 10:37 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: On 2023-03-10 at 22:16:05 -0500, Thomas Passin wrote: I'd make the pattern in this example even more understandable and less error-prone: def update_pids(target): cmd = ["tail", "-n", &quo

Re: Python installation not full and python not working 3.11.0

2023-03-10 Thread Thomas Passin
On 3/10/2023 9:51 PM, Thomas Passin wrote: On 3/10/2023 6:27 PM, Jan Vasko wrote: Please note that you can't attach images in these posts, at least not so we can read them.  Instead, copy the messages from the console and paste them into your post. I suggest that you check to make sure

Re: Lambda returning tuple question, multi-expression

2023-03-10 Thread Thomas Passin
On 3/10/2023 7:07 PM, aapost wrote: which does start to break down readability due to line length, as there isn't really an indention rule set for something uncommonly used. but some renaming makes the pattern clearer pids.update({"messages" :subprocess.Popen(["cmd1"])}) if not pids["messages

Re: Python installation not full and python not working 3.11.0

2023-03-10 Thread Thomas Passin
On 3/10/2023 6:27 PM, Jan Vasko wrote: Please note that you can't attach images in these posts, at least not so we can read them. Instead, copy the messages from the console and paste them into your post. I suggest that you check to make sure that your system hasn't been damaged or corrupte

Re: For Devs: An @notImplemented Decorator

2023-03-10 Thread Thomas Passin
" pylint prefers NotImplementedError." - EKR Often during development I prefer not to handle an exception, and want the program continue to run. Though I suppose I could put exception handling into the decorator. -- You received this message because you are subscribed to the Google Groups "

For Devs: An @notImplemented Decorator

2023-03-09 Thread Thomas Passin
It can be helpful to be able to handle functions/methods that have not been implemented. This is often done by having them print a string (such as "Not Implemented") and returning. This is a bit clumsy and one needs to edit it out when the function is ready to test. As an alternative, I some

Re: Lambda returning tuple question, multi-expression

2023-03-09 Thread Thomas Passin
On 3/9/2023 3:29 AM, aapost wrote: The 'what I am trying to do' is ask a question regarding opinions and practices on issuing a sequence of actions within a lambda via a tuple (since the common practice approaches against it - mainly with tkinter - feel more convoluted), and in doing so leaving

Re: Lambda returning tuple question, multi-expression

2023-03-08 Thread Thomas Passin
On 3/8/2023 11:19 PM, aapost wrote: > In both cases (as per my intent) Well, that's the trouble. You haven't stated your intent, so we're forced to try to reverse engineer it. Below I state what my reverse-engineering effort thinks is your intent. It would be better if you actually said clea

Re: Lambda returning tuple question, multi-expression

2023-03-08 Thread Thomas Passin
On 3/8/2023 4:56 PM, aapost wrote: b = tk.Button(master=main, text="Enable") b.config(     command=lambda: (     e1.config(state="normal"),     e2.config(state="normal"),     e3.config(state="normal")     ) ) It's hard to understand what you are trying to do here. I don't rem

Re: Fast full-text searching in Python (job for Whoosh?)

2023-03-08 Thread Thomas Passin
On 3/8/2023 3:27 PM, Peter J. Holzer wrote: On 2023-03-08 00:12:04 -0500, Thomas Passin wrote: On 3/7/2023 7:33 AM, Dino wrote: in fact it's a dilemma I am facing now. My back-end returns 10 entries (I am limiting to max 10 matches server side for reasons you can imagine). As the user

Re: Winodws10 Command Prompt unresponsive to .py commands

2023-03-07 Thread Thomas Passin
On 3/7/2023 2:31 PM, Thomas Gregg wrote: Hi, I got python 11 to work with the esptool a few days ago. However, I must have something wrong, because now, when I enter any command with .py, Windows Command Prompt just returns without doing anything. Example C:\Users\gregg>esptool.py version C:

Re: Fast full-text searching in Python (job for Whoosh?)

2023-03-07 Thread Thomas Passin
On 3/7/2023 7:33 AM, Dino wrote: It must be nice to have a server or two... No kidding About everything else you wrote, it makes a ton of sense, in fact it's a dilemma I am facing now. My back-end returns 10 entries (I am limiting to max 10 matches server side for reasons you can imagine). A

Re: Fast full-text searching in Python (job for Whoosh?)

2023-03-06 Thread Thomas Passin
then yes, a full text indexer of some kind will be useful. Whoosh certainly looks good though I have not used it. But for populating dropdown lists in web forms, most likely the design of the form will provide a structure for the various searches. -Original Message- From: Python-li

Re: Fast full-text searching in Python (job for Whoosh?)

2023-03-06 Thread Thomas Passin
On 3/6/2023 7:28 AM, Dino wrote: On 3/5/2023 9:05 PM, Thomas Passin wrote: I would probably ingest the data at startup into a dictionary - or perhaps several depending on your access patterns - and then you will only need to to a fast lookup in one or more dictionaries. If your access

Re: Fast full-text searching in Python (job for Whoosh?)

2023-03-06 Thread Thomas Passin
are it would only be seconds at most to build the data cache, and then subsequent queries would respond very quickly. From: Python-list on behalf of Thomas Passin Date: Sunday, March 5, 2023 at 9:07 PM To: python-list@python.org Subject: Re: Fast full-text searching in Python (job for Whoosh

Re: Fast full-text searching in Python (job for Whoosh?)

2023-03-05 Thread Thomas Passin
On 3/4/2023 11:12 PM, Dino wrote: On 3/4/2023 10:43 PM, Dino wrote: I need fast text-search on a large (not huge, let's say 30k records totally) list of items. Here's a sample of my raw data (a list of US cars: model and make) I suspect I am really close to answering my own question... >>

Re: LeoInteg 1.0.12 Released!

2023-03-05 Thread Thomas Passin
Very nice work, Felix! On Sunday, March 5, 2023 at 1:55:39 AM UTC-5 Félix wrote: > > [image: banner1.0.12.png] > *Requires Leo Version 6.7.2 > * > > 🎉 *I'm happy to announce the release of LeoInteg 1.0.12 >

Re: Windows Console Colors To Match Your Leo Theme (Part 2)

2023-03-04 Thread Thomas Passin
This is Part 3 of the series on changing Windows console colors to match your Leo theme. This post is Part 3, the last part, of the series on making and using Windows console color themes. The ColorTool.exe program (see Part 1) makes it relatively easy to modify an existing theme. To create o

Re: Windows Console Colors To Match Your Leo Theme (Part 2)

2023-03-04 Thread Thomas Passin
To make changing your console color themes easier, it's worth while making either a batch file or some aliases. Doskey aliases are probably less familiar, so that's what I will cover in this post. Here is a doskey alias for making the console change to the tbp-dark.ini theme (the command shoul

Windows Console Colors To Match Your Leo Theme

2023-03-04 Thread Thomas Passin
Would you like your Windows console colors to be like your Leo theme? In this post I will explain how to make this happen, at least if you use one of my solarized or quasi-solarized themes. In the next post I will give you a few tips to make changing themes easier. In a post after that I will

Re: hi

2023-03-04 Thread Thomas Passin
On 3/4/2023 12:13 PM, Tom wrote: Bonjour je suis français et je ne comprend pas comment je peux acceder a python merci de me repondre CORDIALEMENT Lilian Envoyé à partir de [1]Courrier pour Windows Veuillez expliquer ce que vous entendez par "peux accéder à un python".

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-04 Thread Thomas Passin
closer to "eclectic" as I came to python late and found an expanding language with way too many ways to do anything and can choose. But I claim that too is pythonic! I think you are over-thinking this, Avi :) -Original Message- From: Python-list On Behalf Of Thomas Passin Sen

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