Re: subprocess.Popen does not launch audacity

2025-01-10 Thread Tim Johnson via Python-list
On 1/10/25 12:53, Thomas Passin via Python-list wrote: On 1/10/2025 4:00 PM, Tim Johnson via Python-list wrote: On 1/10/25 11:32, MRAB via Python-list wrote: ,,, snipped Below is the pertinent code:    Popen(choice, stdout=PIPE, stderr=PIPE,     stdin=PIPE, close_fds=True

Re: subprocess.Popen does not launch audacity

2025-01-10 Thread Tim Johnson via Python-list
On 1/10/25 11:32, MRAB via Python-list wrote: ,,, snipped Below is the pertinent code:    Popen(choice, stdout=PIPE, stderr=PIPE,     stdin=PIPE, close_fds=True) My guess is my argument list is either insufficient or an argument is causing the problem, but am unsure of which

subprocess.Popen does not launch audacity

2025-01-10 Thread Tim Johnson via Python-list
ld be great to make it work from this script. Thanks in advance Tim -- https://mail.python.org/mailman/listinfo/python-list

Re: No module name mutagen

2025-01-01 Thread Tim Johnson via Python-list
On 12/31/24 15:00, Tim Johnson wrote: . Snipped I resolved this by extrapolating known paths of other non-distro pipx installs, and am back in business now. I'm taking lots of notes. For some reason, even after running updatedb, I had no luck finding with locate. I was not

No module name mutagen

2024-12-31 Thread Tim Johnson via Python-list
I am at a loss. don't know what to do. I am only using python script for command line utilities on my desktop and local network. Must I be using a virtual environment? If so, I would be happy to set one up if I am given the python-approved directions (lots of conflicting info out there...

Re: ModuleNotFoundError for youtube_dl

2024-12-09 Thread Tim Johnson via Python-list
On 12/9/24 14:59, Tim Johnson wrote: Recently did a refresh of ubuntu 24.04 With no code changes am now getting a *ModuleNotFoundError *for youtube_dl Relevant code is import sys sys.path.append("/home/tim/.local/share/pipx/venvs/youtube-dl/lib/python3.12/site-packages/youtube_dl"

ModuleNotFoundError for youtube_dl

2024-12-09 Thread Tim Johnson via Python-list
Recently did a refresh of ubuntu 24.04 With no code changes am now getting a *ModuleNotFoundError *for youtube_dl Relevant code is import sys sys.path.append("/home/tim/.local/share/pipx/venvs/youtube-dl/lib/python3.12/site-packages/youtube_dl") import youtube_dl ' Navigatin

Re: Correct module for site customization of path

2024-11-01 Thread Tim Johnson via Python-list
ze.py # Thanks seems to work for me cheers -- Tim thjmm...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Correct module for site customization of path

2024-10-31 Thread Tim Johnson via Python-list
boatload of documentation of site path configuration, but still, I am not sure what option to take. Recommendations are invited and welcome. Thanks -- Tim thjmm...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: help: pandas and 2d table

2024-04-13 Thread Tim Williams via Python-list
On Sat, Apr 13, 2024 at 1:10 PM Mats Wichmann via Python-list < python-list@python.org> wrote: > On 4/13/24 07:00, jak via Python-list wrote: > > doesn't Pandas have a "where" method that can do this kind of thing? Or > doesn't it match what you are looking for? Pretty sure numpy does, but > that

Re: Is there a Python module to parse a date like the 'date' command in Linux?

2023-05-22 Thread Tim Williams
On Mon, May 22, 2023 at 12:41 PM Mats Wichmann wrote: > On 5/20/23 13:53, Chris Green wrote: > > I'm converting a bash script to python as it has become rather clumsy > > in bash. > > > > However I have hit a problem with converting dates, the bash script > > has:- > > > > dat=$(date --date

Re: Is npyscreen still alive?

2023-04-24 Thread Tim Daneliuk via Python-list
On 4/24/23 11:32, Grant Edwards wrote: On 2023-04-24, Grant Edwards wrote: The other big advantage of an ncurses program is that since curses support is in the std library, a curses app is simpler to distribute. Right now, the application is a single .py file you just copy to the destination

Re: Is npyscreen still alive?

2023-04-24 Thread Tim Daneliuk via Python-list
On 4/24/23 09:14, Stefan Ram wrote: Grant Edwards writes: The other big advantage of an ncurses program is that since curses support is in the std library, a curses app is simpler to distribute. IIRC curses is not in the standard library /on Windows/. I miss a platform independent (well

Re: Beautiful Soup - close tags more promptly?

2022-10-25 Thread Tim Delaney
iving of malformed input and edge cases. I use html5lib - it's fast enough for what I do, and the most likely to return results matching what the author saw when they maybe tried it in a single web browser. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list

Re: any author you find very good has written a book on Python?

2022-09-07 Thread Tim Daneliuk via Python-list
On 9/5/22 21:22, Meredith Montgomery wrote: I never read a book on Python. I'm looking for a good one now. I just searched the web for names such as Charles Petzold, but it looks like he never wrote a book on Python. I also searched for Peter Seibel, but he also never did. I also tried to sea

Re: Question about building Python-3.9.12 on OpenBSD 7.1

2022-06-03 Thread Tim Brazil
Thanks for the response HTH. Your comment led me to think that perhaps a "ports" dependency failed to be generated correctly. They are patched on the fly. I went back to "scratch" on fresh installation with a clean Python build. This time it worked correctly. Go figur

Question about building Python-3.9.12 on OpenBSD 7.1

2022-06-02 Thread Tim Brazil
t I do have a _sysconfigdata__openbsd7_amd64-unknown-openbsd7.1.py module under: ./build/lib.openbsd-7.1-amd64-3.9/_sysconfigdata__openbsd7_amd64-unknown-openbsd7.1.py I suspect somewhere, it's not picking up the full 7.1 version string. I am having a problem figuring it out. I kindly ask if yo

Accuracy of multiprocessing.Queue.qsize before any Queue.get invocations?

2022-05-12 Thread Tim Chase
The documentation says[1] > Return the approximate size of the queue. Because of > multithreading/multiprocessing semantics, this number is not > reliable. Are there any circumstances under which it *is* reliable? Most germane, if I've added a bunch of items to the Queue, but not yet launched an

No shortcut Icon on Desktop

2022-04-13 Thread Tim Deke
Dear Sir, I have successfully downloaded Python into my laptop but the shortcut icon is not appearing on the desktop. I am using Windows 10 with the PC specifications as per snap shot attached below. Can you advise what to do? Thank you Tim Deke [image: image.png] -- https://mail.python.org

Re: Add a method to list the current named logging levels

2022-03-30 Thread Tim Chase
On 2022-03-30 16:37, Barry wrote: > Is logging.getLevelNamesMapping() what you are looking for? Is this in some version newer than the 3.8 that comes stock on my machine? $ python3 -q >>> import logging >>> logging.getLevelNamesMapping() Traceback (most recent call last): File "", lin

Re: Behavior of the for-else construct

2022-03-04 Thread Tim Chase
On 2022-03-04 11:55, Chris Angelico wrote: > In MS-DOS, it was perfectly possible to have spaces in file names DOS didn't allow space (0x20) in filenames unless you hacked it by hex-editing your filesystem (which I may have done a couple times). However it did allow you to use 0xFF in filenames wh

Re: Behavior of the for-else construct

2022-03-03 Thread Tim Chase
On 2022-03-04 02:02, Chris Angelico wrote: >> I want to make a little survey here. >> >> Do you find the for-else construct useful? Have you used it in >> practice? Do you even know how it works, or that there is such a >> thing in Python? > > Yes, yes, and yes-yes. It's extremely useful. Just

Re: Timezone jokes (was: All permutations from 2 lists)

2022-03-03 Thread Tim Chase
On 2022-03-03 06:27, Grant Edwards wrote: > On 2022-03-03, Chris Angelico wrote: > > Awww, I was going to make a really bad joke about timezones :) > > As opposed to all the really good jokes about timezones... ;) And here I thought you were just Trolling with timezones... https://en.wikipedi

Re: How to store the result of df.count() as a new dataframe in Pandas?

2021-10-27 Thread Tim Williams
On Tue, Oct 26, 2021 at 6:36 PM Shaozhong SHI wrote: > Hello, > > The result of df.count() appears to be a series object. How to store the > result of df.count() as a new dataframe in Pandas? > > That is data anyhow. > > Regards, > > David > -- > https://mail.python.org/mailman/listinfo/python-l

Re: Create a contact book

2021-10-26 Thread Tim Chase
On 2021-10-25 22:40, anders Limpan wrote: > i would like to create a contact book were you can keep track of > your friends. With this contact book you will both be able to add > friends and view which friends that you have added. anyone > interested in helping me out with this one ?=) -- Python p

Re: string storage [was: Re: imaplib: is this really so unwieldy?]

2021-05-26 Thread Tim Chase
On 2021-05-26 18:43, Alan Gauld via Python-list wrote: > On 26/05/2021 14:09, Tim Chase wrote: >>> If so, doesn't that introduce a pretty big storage overhead for >>> large strings? >> >> Yes. Though such large strings tend to be more rare, largely >

Re: string storage [was: Re: imaplib: is this really so unwieldy?]

2021-05-26 Thread Tim Chase
On 2021-05-26 08:18, Alan Gauld via Python-list wrote: > Does that mean that if I give Python a UTF8 string that is mostly > single byte characters but contains one 4-byte character that > Python will store the string as all 4-byte characters? As best I understand it, yes: the cost of each "chara

Re: Pips for python2 and python3

2021-03-22 Thread Tim Johnson
On 3/21/21 5:44 PM, Dan Stromberg wrote: python3 -m pip install Got it. Thanks a lot. -- Tim tj49.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Pips for python2 and python3

2021-03-21 Thread Tim Johnson
On 3/21/21 5:14 PM, MRAB wrote: Tn 2021-03-21 23:13, Tim Johnson wrote: Using ubuntu 20.04 as a recent install with python3 (3.8.5) which was installed as part of the original distribution install and python2 (2.7.18) that has been installed using apt. I have a large amount of utilities

Pips for python2 and python3

2021-03-21 Thread Tim Johnson
python3 I see numerous caveats regarding the installing of pips for both these versions. I would welcome advice on how to proceed which could very well be accomplished by links to relevant discussions or documentation. thanks -- Tim tj49.com -- https://mail.python.org/mailman/listinfo/python

Re: name for a mutually inclusive relationship

2021-02-24 Thread Tim Chase
On 2021-02-24 08:12, Ethan Furman wrote: > I'm looking for a name for a group of options that, when one is > specified, all of them must be specified. [snip] > - ???: a group of options where, if one is specified, all must be > specified (mutually inclusive) [snip] > Is there a name out there alrea

Re: count consecutive elements

2021-01-15 Thread Tim Chase
On 2021-01-16 03:32, Bischoop wrote: >> The OP didn't specify what should happen in that case, so it would >> need some clarification. > > In that case maybe good solution would be to return three of them? That's the solution I chose in my initial reply, you get a tuple back of ([list of longest

Re: count consecutive elements

2021-01-13 Thread Tim Chase
On 2021-01-13 18:20, Dan Stromberg wrote: > I'm kind of partial to: > > import collections > import typing > > > def get_longest(string: str) -> typing.Tuple[int, str]: > """Get the longest run of a single consecutive character.""" > dict_: typing.DefaultDict[str, int] = > collections.de

Re: count consecutive elements

2021-01-13 Thread Tim Chase
On 2021-01-13 21:20, Bischoop wrote: > I want to to display a number or an alphabet which appears mostly > consecutive in a given string or numbers or both > Examples > s= ' aabskaaabad' > output: c > # c appears 4 consecutive times > 8bbakebaoa > output: b > #b appears 2 consecutive times I

Re: list() strange behaviour

2020-12-20 Thread Tim Chase
On 2020-12-20 21:00, danilob wrote: > b = ((x[0] for x in a)) here you create a generator > print(list(b)) > [1, 0, 7, 2, 0] and then you consume all the things it generates here which means that when you go to do this a second time > print(list(b)) the generator is already empty/exhausted so

Re: To check if number is in range(x,y)

2020-12-14 Thread Tim Chase
On 2020-12-14 21:21, Schachner, Joseph wrote: > >>> r = range(10) > So r is a list containing 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 In Python 3.x, r is *not* a list. It is a custom object/class. > >>> 2 in r > True > As expected. I'm not sure what your replies are suggesting here. I demonstrate

Re: To check if number is in range(x,y)

2020-12-12 Thread Tim Chase
On 2020-12-12 15:12, Bischoop wrote: > I need to check if input number is 1-5. Whatever I try it's not > working. Here are my aproaches to the problem: https://bpa.st/H62A > > What I'm doing wrong and how I should do it? A range is similar to a list in that it contains just the numbers listed:

Re: Returning from a multiple stacked call at once

2020-12-12 Thread Tim Chase
On 2020-12-12 07:39, ast wrote: > In case a function recursively calls itself many times, > is there a way to return a data immediately without > unstacking all functions ? Not that I'm aware of. If you use recursion (and AFAIK, Python doesn't support tail-recursion), you pay all the pushes & pa

Re: Any better way for this removal? [typo correction]

2020-11-07 Thread Tim Chase
On 2020-11-07 10:51, Tim Chase wrote: > from string import ascii_lowercase > text = ",".join(ascii_lowercase) > to_throw_away = 5 [derp] For obvious reasons, these should be s/\/to_throw_away/g To throw away the trailing N delimited portions: > new_string =

Re: Any better way for this removal?

2020-11-07 Thread Tim Chase
On 2020-11-07 13:46, Bischoop wrote: > text = "This is string, remove text after second comma, to be > removed." > > k= (text.find(",")) #find "," in a string > m = (text.find(",", k+1)) #Find second "," in a string > new_string = text[:m] > > print(new_string) How about: new_string = text.r

Re: Best way to determine user's screensize?

2020-10-31 Thread Tim Chase
On 2020-10-31 15:22, Grant Edwards wrote: > > A MUA may have to display hundreds of mailboxes, and maybe tens of > > thousands of mails in a single mailbox. > > No. It doesn't. It has to display a tree widget that shows N items > and holds tens of thousands of items, or a scrolling list widget >

Re: Python's carbon guilt

2020-10-10 Thread Tim Daneliuk
On 10/10/20 2:35 PM, Marco Sulla wrote: > He should also calculate the carbon dioxide emitted by brains that > works in C++ only. I omit other sources. > yes, methane is an alleged greenhouse gas as well -- https://mail.python.org/mailman/listinfo/python-list

Re: ValueError: arrays must all be same length

2020-10-05 Thread Tim Williams
data is another table. > > Regards, > > Shao > > > I'm fairly new to pandas myself. Can't help there. You may want to post this on Stackoverflow, or look for a similar issue on github. https://stackoverflow.com/questions/tagged/pandas+json https://github.com/pandas-de

Re: ValueError: arrays must all be same length

2020-10-04 Thread Tim Williams
On Sun, Oct 4, 2020 at 8:39 AM Tim Williams wrote: > > > On Fri, Oct 2, 2020 at 11:00 AM Shaozhong SHI > wrote: > >> Hello, >> >> I got a json response from an API and tried to use pandas to put data into >> a dataframe. >> >> However, I ke

Re: ValueError: arrays must all be same length

2020-10-04 Thread Tim Williams
On Fri, Oct 2, 2020 at 11:00 AM Shaozhong SHI wrote: > Hello, > > I got a json response from an API and tried to use pandas to put data into > a dataframe. > > However, I kept getting this ValueError: arrays must all be same length. > > Can anyone help? > > The following is the json text. Regard

Re: Pythonic style

2020-09-21 Thread Tim Chase
On 2020-09-21 09:48, Stavros Macrakis wrote: >> def fn(iterable): >> x, = iterable >> return x > > Thanks, Tim! I didn't realize that you could write (x,) on the LHS! > Very nice, very Pythonic! It also expands nicely for other cases, so you want th

Re: Pythonic style

2020-09-21 Thread Tim Chase
a can be hard to spot, so I usually draw a little extra attention to it with either (x, ) = iterable or x, = iterable # unpack one value I'm not sure it qualifies as Pythonic, but it uses Pythonic features like tuple unpacking and the code is a lot more concise. -tim -- https://mail.python.org/mailman/listinfo/python-list

Re: Regex to change multiple lines

2020-09-03 Thread Tim Chase
Derp, sorry about the noise. I mistook this message for a similar dialog over on the Vim mailing list. For Python, you want re.sub(r"%%(.*?)%%", r"\1", s, flags=re.S) or put the flag inline re.sub(r"(?s)%%(.*?)%%", r"\1", s) -tim On 2020-09-03 09

Re: Regex to change multiple lines

2020-09-03 Thread Tim Chase
e others that are following Should be able to use :%s/%%\(\_.\{-}\)%%/\1<\/del>/g It simplifies slightly if you use a different delimiter :%s@%%\(\_.\{-}\)%%@\1@g -tim -- https://mail.python.org/mailman/listinfo/python-list

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

2020-08-19 Thread Tim Williams
etter place to ask a pandas question is StackOverflow. Here's a link that may answer your question. Convert timestamp to day, month, year and hour <https://stackoverflow.com/questions/57515291/convert-timestamp-to-day-month-year-and-hour> Tim Williams -- https://mail.python.org/mailman/listinfo/python-list

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-19 Thread Tim Daneliuk
On 8/19/20 3:29 PM, Ethan Furman wrote: > On 8/19/20 12:40 PM, Tim Daneliuk wrote: >> On 8/19/20 2:00 PM, Karen Shaeffer wrote: > >>> Considering all your posts on this thread, it is reasonable to infer you >>> have some ideological motivations. >> >>

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-19 Thread Tim Daneliuk
On 8/19/20 1:10 PM, J. Pic wrote: > Tim, don't you also think that statements should be backed by > evidence, even more if they are particularly accusatory ? > > We'll be lucky if S&W's editor doesn't sue the PSF for slandering for > publishing that S&W

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-19 Thread Tim Daneliuk
On 8/19/20 2:00 PM, Karen Shaeffer wrote: > Where you conclude with: "Methinks there is an ideological skunk in the > parlor …” > > Considering all your posts on this thread, it is reasonable to infer you have > some ideological motivations. My motivation was to demonstrate that if people of yo

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-19 Thread Tim Daneliuk
On 8/18/20 12:18 PM, gia wrote: > That's why I picked Math, it is also universally accepted, it's very > strict, and it leaves the reader to decide its color based on themselves > (it's not white btw :) Sorry, but when it comes to the demands of the woke, you are not immune. Reported widely ear

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-19 Thread Tim Daneliuk
On 8/19/20 8:35 AM, Alexandre Brault wrote: > I've not seen anyone objecting to the idea of removing the reference to > Strunk and White in favour of the underlying message of "be understandable by > others who may read your comments" (there were at most a few philosophical > "what is understand

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-18 Thread Tim Daneliuk
On 8/18/20 6:34 PM, rmli...@riseup.net wrote: > I would kindly recommend that folks just educate themselves on what Speaking of being educated ... Could you please do an exposition for all us ignorant types on the books that really animate your worldview: The_Origin of the Family, Private P

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-18 Thread Tim Daneliuk
On 8/18/20 6:34 PM, rmli...@riseup.net wrote: > I would kindly recommend that folks just educate themselves on what I would also like to help you become educated. Be sure to check out these literary treasures - they are the foundation of the worldview you are espousing: The_Origin of the Famil

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-18 Thread Tim Daneliuk
On 8/18/20 12:28 PM, justin walters wrote: > I apologize for being ageist earlier as well. That was out of line. I am likely older than you and there is no reason to apologise. Only the profoundly undeveloped psyche takes every opportunity to find offense when none is intended. It is the sign of

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-18 Thread Tim Daneliuk
On 8/17/20 1:26 PM, Chris Angelico wrote: > For context, see this commit: > > https://github.com/python/peps/commit/0c6427dcec1e98ca0bd46a876a7219ee4a9347f4 > > The commit message is highly politically charged and is now a > permanent part of the Python commit history. The Python Steering > Counc

3.8.5 Failing To Install With pythonz

2020-08-09 Thread Tim Daneliuk
I have a weird problem I could use a bit of help with ... I have successfully installed 3.8.5 using pew/pythonz on a BSD FreeBSD system. But when I attempt to install it on a Linux system I get the traceback below. In this case, pew/pythonz were installed locally in my own account using system nat

Re: True is True / False is False?

2020-07-22 Thread Tim Chase
On 2020-07-22 11:54, Oscar Benjamin wrote: >> On Wed, Jul 22, 2020 at 11:04 AM Tim Chase wrote: >>> reading through the language specs and didn't encounter >>> anything about booleans returned from comparisons-operators, >>> guaranteeing that they always ret

True is True / False is False?

2020-07-21 Thread Tim Chase
I know for ints, cpython caches something like -127 to 255 where `is` works by happenstance based on the implementation but not the spec (so I don't use `is` for comparison there because it's not guaranteed by the language spec). On the other hand, I know that None is a single object that can (and

Re: New to python - Just a question

2020-07-03 Thread Tim Chase
On 2020-07-03 10:09, Daley Okuwa via Python-list wrote: > Write an algorithm (choose the language you prefer) that given a > character string, for instance {‘c’,’a’,’i’,’o’,’p’,’a’}, will > print out the list of characters appearing at least 2 times. In > this specific example, it would return {‘a’

Re: Friday Finking: Imports, Namespaces, Poisoning, Readability

2020-06-04 Thread Tim Chase
On 2020-06-05 12:15, DL Neil via Python-list wrote: > Finking/discussion: > > - how do you like to balance these three (and any other criteria)? For most of what I do, I only ever have one such module so I'm not trying keep multiple short-names in my head concurrently. For me, it's usually tkint

Re: Strings: double versus single quotes

2020-05-23 Thread Tim Chase
On 2020-05-23 14:46, Dennis Lee Bieber wrote: > On Sat, 23 May 2020 11:03:09 -0500, Tim Chase > >But when a string contains both, it biases towards single quotes: > > > > >>> "You said \"No it doesn't\"" > > 'You said &q

Re: Strings: double versus single quotes

2020-05-23 Thread Tim Chase
On 2020-05-24 01:40, Chris Angelico wrote: > On Sat, May 23, 2020 at 10:52 PM Abdur-Rahmaan Janhangeer > wrote: > > > > The interpreter prefers single-quotes > > > > >>> "single or double" > > 'single or double' > > > >>> 'not all that strongly, it doesn\'t' > "not all that strongly, it do

Re: Strings: double versus single quotes

2020-05-19 Thread Tim Chase
On 2020-05-19 20:10, Manfred Lotz wrote: > Hi there, > I am asking myself if I should preferably use single or double > quotes for strings? I'd say your consistency matters more than which one you choose. According to a recent observation by Raymond H. """ Over time, the #python world has show

Creating a curses app that interacts with the terminal, yet reads from stdin?

2020-04-18 Thread Tim Chase
I know that vim lets me do things like $ ls | vim - where it will read the data from stdin, but then take over the screen TUI curses-style, and interact directly with the keyboard input without being limited to input from stdin. I've played around with something like import sys import

Re: Python3 module with financial accounts?

2020-04-01 Thread Tim Chase
On 2020-04-01 19:27, Peter Wiehe wrote: > Is there a Python3 module with financial accounts? You'd have to be more specific. For interacting with online accounts with financial institutions? For tracking financial data locally? There's beancount (http://furius.ca/beancount/ and written in Pytho

Re: [Python-ideas] Re: Magnitude and ProtoMagnitude ABCs — primarily for argument validation

2020-03-10 Thread Tim Peters via Python-list
[Marco Sulla ] > Excuse me, Tim Peters, what do you think about my (probably heretical) > proposal of simply raising an exception instead of return a NaN, like > Python already do for division by zero? Sorry, I'm missing context. I don't see any other message(s) from you in th

Error while installing a python code

2020-03-09 Thread Tim Ko
Hello, I am trying to install a custom Python code but ran into an error. The error presumably associated with cython. I tried a different compiler since Intel compiler often crashes when using cython, but couldn't get it working. Attached is the installation error log. I have installed and upd

Installation of python

2020-03-09 Thread Tim Ko
Hello, I am trying to install a custom Python package but ran into an error. The error presumably associated with cython. I tried a different compiler since Intel compiler often crashes when using cython, but couldn't get it working. Attached is the installation error log. I have installed and

Re: Idiom for partial failures

2020-02-20 Thread Tim Chase
On 2020-02-20 13:30, David Wihl wrote: > I believe that it would be more idiomatic in Python (and other > languages like Ruby) to throw an exception when one of these > partial errors occur. That way there would be the same control flow > if a major or minor error occurred. There are a variety of

Re: Help on dictionaries...

2020-01-29 Thread Tim Chase
On 2020-01-30 06:44, Souvik Dutta wrote: > Hey I was thinking how I can save a dictionary in python(obviously) > so that the script is rerun it automatically loads the dictionary. This is almost exactly what the "dbm" (nee "anydbm") module does, but persisting the dictionary out to the disk: im

Re: Friday Finking: Source code organisation

2019-12-28 Thread Tim Chase
On 2019-12-29 12:52, Greg Ewing wrote: > On 29/12/19 11:49 am, Chris Angelico wrote: > > "Define before use" is a broad principle that I try to follow, > > even when the code itself doesn't mandate this. > > I tend to do this too, although it's probably just a habit > carried over from languages

Re: Lists And Missing Commas

2019-12-24 Thread Tim Daneliuk
On 12/24/19 6:37 AM, Stefan Ram wrote: > And you all are aware that this kind of string concatenation > happens in C and C++, too, aren't you? > > main.c > > #include > int main( void ){ puts( "a" "b" ); } > > transcript > > ab Noting that it has been a long time since I looked at the

Re: Lists And Missing Commas

2019-12-23 Thread Tim Daneliuk
On 12/23/19 8:35 PM, Chris Angelico wrote: > On Tue, Dec 24, 2019 at 12:56 PM DL Neil via Python-list > wrote: >> However, your point involves the fact that whereas: >> >> 1 + 2 # 3 is *clearly* addition, and >> "a" + "b" # "ab" is *clearly* concatenation >> >> "a" "b" # al

Re: Lists And Missing Commas

2019-12-23 Thread Tim Daneliuk
On 12/23/19 7:52 PM, DL Neil wrote: > > WebRef: https://docs.python.org/3/reference/lexical_analysis.html Yep, that explains it, but it still feels non-regular to me. From a pointy headed academic POV, I'd like to see behavior consistent across types. Again ... what do I know? -- https://mai

Lists And Missing Commas

2019-12-23 Thread Tim Daneliuk
If I do this: foo = [ "bar", "baz" "slop", "crud" ] Python silently accepts that and makes the middle term "bazslop". BUT, if I do this: foo = [ "bar", "baz" 1, "crud" ] or this: foo = [ "bar", 2 1, "crud" ] The interpreter throws a syntax error. This is more of an intellectual

Re: Most elegant way to do something N times

2019-12-22 Thread Tim Chase
On 2019-12-22 23:34, Batuhan Taskaya wrote: > I encounter with cases like doing a function 6 time with no > argument, or same arguments over and over or doing some structral > thing N times and I dont know how elegant I can express that to the > code. I dont know why but I dont like this > > for _

Re: Randomizing Strings In A Microservices World

2019-12-15 Thread Tim Daneliuk
On 12/10/19 12:37 PM, Chris Angelico wrote: > On Wed, Dec 11, 2019 at 5:01 AM Tim Daneliuk wrote: >> >> On 12/10/19 10:36 AM, Peter Pearson wrote: >>> Just to be sure: you *are* aware that the "Birthday Paradox" says >>> that if you pick your 10-di

Re: Randomizing Strings In A Microservices World

2019-12-10 Thread Tim Daneliuk
On 12/10/19 10:36 AM, Peter Pearson wrote: > Just to be sure: you *are* aware that the "Birthday Paradox" says > that if you pick your 10-digit strings truly randomly, you'll probably > get a collision by the time of your 10**5th string . . . right? I did not consider this, but the point is taken.

Re: Randomizing Strings In A Microservices World

2019-12-09 Thread Tim Daneliuk
On 12/9/19 8:54 PM, Dennis Lee Bieber wrote: > On Mon, 9 Dec 2019 18:52:11 -0600, Tim Daneliuk > declaimed the following: > >> >> - Each of these services needs to produce a string of ten digits guaranteed >> to be unique >> on a per service instance basis A

Re: Randomizing Strings In A Microservices World

2019-12-09 Thread Tim Daneliuk
On 12/9/19 8:50 PM, Paul Rubin wrote: > Tim Daneliuk writes: >> - Imagine an environment in which there may be multiple instances of a given >> microservice written in Python. > > Decide the maximum number of microservice instances, say 1000. Chop up > the 10 digit ra

Re: Randomizing Strings In A Microservices World

2019-12-09 Thread Tim Delaney
On Tue, 10 Dec 2019 at 12:12, Tim Daneliuk wrote: > - Each of these services needs to produce a string of ten digits > guaranteed to be unique > on a per service instance basis AND to not collide for - oh, let's say - > forever :)s > > Can anyone suggest a randomiz

Randomizing Strings In A Microservices World

2019-12-09 Thread Tim Daneliuk
I ran across a kind of fun problem today that I wanted to run past you Gentle Geniuses (tm): - Imagine an environment in which there may be multiple instances of a given microservice written in Python. - Each of these services needs to produce a string of ten digits guaranteed to be unique

Re: More efficient/elegant branching

2019-12-09 Thread Tim Chase
On 2019-12-09 12:27, Musbur wrote: > def branch1(a, b, z): > """Inelegant, unwieldy, and pylint complains > about too many branches""" > if a > 4 and b == 0: > result = "first" > elif len(z) < 2: > result = "second" > elif b + a == 10: > result =

Re: increasing the page size of a dbm store?

2019-12-03 Thread Tim Chase
On 2019-12-02 16:49, Michael Torrie wrote: > On 12/1/19 7:50 PM, Tim Chase wrote: > > After sparring with it a while, I tweaked the existing job so > > that it chunked things into dbm-appropriate sizes to limp > > through; for the subsequent job (where I would have used dbm &g

Re: ModuleNotFoundError with click module

2019-12-02 Thread Tim Johnson
On 12/1/19 11:46 PM, Peter Otten wrote: Tim Johnson wrote: OK. Now I have /usr/local/lib/python3.7/site-packages/Click-7.0.dist-info/ which holds the following files: INSTALLER LICENSE.txt METADATA RECORD top_level.txt WHEEL I haven't a clue as to how to proceed! Never seen

Re: increasing the page size of a dbm store?

2019-12-01 Thread Tim Chase
> Maybe port to SQLite? I would not choose dbm these days. After sparring with it a while, I tweaked the existing job so that it chunked things into dbm-appropriate sizes to limp through; for the subsequent job (where I would have used dbm again) I went ahead and switched to sqlite and had no furt

Re: ModuleNotFoundError with click module

2019-12-01 Thread Tim Johnson
On 12/1/19 3:41 PM, Tim Johnson wrote: On 12/1/19 12:26 AM, Peter Otten wrote: Tim Johnson wrote: Using linux ubuntu 16.04 with bash shell. Am retired python programmer, but not terribly current. I have moderate bash experience. When trying to install pgadmin4 via apt I get the following

Re: ModuleNotFoundError with click module

2019-12-01 Thread Tim Johnson
On 12/1/19 12:26 AM, Peter Otten wrote: Tim Johnson wrote: Using linux ubuntu 16.04 with bash shell. Am retired python programmer, but not terribly current. I have moderate bash experience. When trying to install pgadmin4 via apt I get the following error traceback when pgadmin4 is invoked

Re: ModuleNotFoundError with click module

2019-12-01 Thread Tim Johnson
On 12/1/19 12:26 AM, Peter Otten wrote: Tim Johnson wrote: Using linux ubuntu 16.04 with bash shell. Am retired python programmer, but not terribly current. I have moderate bash experience. When trying to install pgadmin4 via apt I get the following error traceback when pgadmin4 is invoked

ModuleNotFoundError with click module

2019-11-30 Thread Tim Johnson
amed 'click' If I invoke python3 (/usr/local/bin/python3), version 3.7.2 and invoke >>> import click click is imported successfully. In this invocation, sys.path is: ['', '/usr/local/lib/python37.zip', '/usr/local/lib/python3.7', '/usr/local/li

increasing the page size of a dbm store?

2019-11-26 Thread Tim Chase
Working with the dbm module (using it as a cache), I've gotten the following error at least twice now: HASH: Out of overflow pages. Increase page size Traceback (most recent call last): [snip] File ".py", line 83, in get_data db[key] = data _dbm.error: cannot add item to database I

Re: Python Resources related with web security

2019-11-25 Thread Tim Chase
On 2019-11-25 21:25, Pycode wrote: > On Sun, 24 Nov 2019 10:41:29 +1300, DL Neil wrote: >> Are such email addresses 'open' and honest? > > you are not being helpful or answer the question.. What DL Neil seems to be getting at is that there's been an uptick in questions 1) where we don't know who

Re: itertools cycle() docs question

2019-08-21 Thread Tim Chase
On 2019-08-21 11:27, Tobiah wrote: > In the docs for itertools.cycle() there is > a bit of equivalent code given: > > def cycle(iterable): > # cycle('ABCD') --> A B C D A B C D A B C D ... > saved = [] > for element in iterable: > yield element >

Re: Proper shebang for python3

2019-07-22 Thread Tim Daneliuk
On 7/20/19 4:28 PM, Brian Oney wrote: > Why not make a compromise? What would be a potential pitfall of the > following spitbang? > > #!python Not sure this really changes the discussion. -- https://mail.python.org/mailman/listinfo/python-list

Re: Proper shebang for python3

2019-07-21 Thread Tim Daneliuk
On 7/21/19 8:47 AM, Peter J. Holzer wrote: > That's fine. Unlike Tim I don't claim that anybody who disagrees with me > must be a newbie. Peter, that's ad hominem and unfair. I never said anything close to that. What I said is that if someone were to spend an extended per

Re: Proper shebang for python3

2019-07-20 Thread Tim Daneliuk
On 7/20/19 6:04 PM, Cameron Simpson wrote: > If you require a specific outcoming, set a specific environment. It is under  > your control. Control it. Exactly right. I have just had the REALLY irritating experience of trying to bootstrap a location insensitive version of linuxbrew that mostly wo

  1   2   3   4   5   6   7   8   9   10   >