"grep" database

2005-09-09 Thread Hilbert
Hello, I've heard of a software on linux that creates a recursive database of text files and then provides an interface for grep-like queries. I'd like to use it to find procedures/variables in a large code base. Any suggestions appreciated. Thanks, Hilbert -- http://mail.python.o

Re: "grep" database

2005-09-09 Thread Hilbert
thanks! -- http://mail.python.org/mailman/listinfo/python-list

right list for SIGABRT python binary question ?

2017-10-16 Thread Karsten Hilbert
Hi all, is this the right list to ask for help in debugging a SIGABORT (?) happening on shutdown of a Python 2.7 script ? If not, which one is ? Karsten -- GPG key ID E4071346 @ eu.pool.sks-keyservers.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346 -- https://mail.python.org/mailman/lis

Re: right list for SIGABRT python binary question ?

2017-10-17 Thread Karsten Hilbert
On Tue, Oct 17, 2017 at 12:04:09PM +1100, Steve D'Aprano wrote: > > is this the right list to ask for help in debugging a > > SIGABORT (?) happening on shutdown of a Python 2.7 script ? > > > > If not, which one is ? > > You should try here first. > > Please ensure you read and follow this firs

Aw: Re: PEP 249 Compliant error handling

2017-10-17 Thread Karsten Hilbert
> That's certainly a possibility, if that behavior conforms to the DB API > "standards". My concern in this front is that in my experience working with > other PEP 249 modules (specifically psycopg2), I'm pretty sure that columns > designated as type VARCHAR or TEXT are returned as strings (unic

Re: right list for SIGABRT python binary question ?

2017-10-18 Thread Karsten Hilbert
OK, here's the first bit which might be part of the puzzle of why my Python script SIGABRT's. When run under "normal" py2.7 it runs all the way through but upon shutdown (*after* sys.exit(0)) faulthandler shows a problem (and returns 134 which made me think of SIGABRT): *** Error in `pyth

Re: PEP 249 Compliant error handling

2017-10-18 Thread Karsten Hilbert
On Wed, Oct 18, 2017 at 08:32:48AM -0800, Israel Brewster wrote: > actual question, which is "how does the STANDARD (PEP 249 in > this case) say to handle this, or, baring that (since the > standard probably doesn't explicitly say), how do the > MAJORITY of PEP 249 compliant modules handle this?"

Re: right list for SIGABRT python binary question ?

2017-10-19 Thread Karsten Hilbert
On Wed, Oct 18, 2017 at 02:07:46PM +0200, Thomas Jollans wrote: > > When run under a debug build it sayeth right away (simulated > > as a minimal working example): > > > > root@hermes:~/bin# python2.7-dbg > > Python 2.7.14 (default, Sep 17 2017, 18:50:44) > > [GCC 7.2.0] o

Re: right list for SIGABRT python binary question ?

2017-10-19 Thread Karsten Hilbert
On Thu, Oct 19, 2017 at 07:27:45PM +0200, Karsten Hilbert wrote: > I am currently running the bootstrapper with mxdatetime as a > dbg build to see what gives. The only other C extension I am > aware of that is in use is psycopg2. So here's the final console

Re: right list for SIGABRT python binary question ?

2017-10-22 Thread Karsten Hilbert
On Sat, Oct 21, 2017 at 07:10:31PM +0200, M.-A. Lemburg wrote: > > Running a debug build of py27 gave me a first lead: this > > Debian system (Testing, upgraded all the way from various > > releases ago) carries an incompatible mxDateTime which I'll > > take care of. > > > > *** You don't hav

Re: right list for SIGABRT python binary question ?

2017-10-22 Thread Karsten Hilbert
On Sun, Oct 22, 2017 at 10:15:51PM +0200, Karsten Hilbert wrote: > The python2.7-dbg build is 32 bits: ... > The python2.7 build (no -dbg) does not have symbols. More to the point: /usr/bin/python2.7: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically

Re: right list for SIGABRT python binary question ?

2017-10-22 Thread Karsten Hilbert
On Sat, Oct 21, 2017 at 09:31:54AM +0200, dieter wrote: > > Debug memory block at address p=0x717b7c: API '' > > 0 bytes originally requested > > The 3 pad bytes at p-3 are not all FORBIDDENBYTE (0xfb): > > at p-3: 0x03 *** OUCH > > at p-2: 0x4e *** OUCH

Re: right list for SIGABRT python binary question ?

2017-10-23 Thread Karsten Hilbert
On Sun, Oct 22, 2017 at 11:10:33PM +0200, Karsten Hilbert wrote: >> It points to a memory corruption. > > thanks for your guidance. I fear this approach is out of my class. For what it's worth I have run a successful overnight memory stress test (memtest86+) so it shouldn&

Re: right list for SIGABRT python binary question ?

2017-10-23 Thread Karsten Hilbert
On Sat, Oct 21, 2017 at 09:31:54AM +0200, dieter wrote: > It points to a memory corruption. While running valgrind and friends is beyond my capabilitis I have run the problem through gdb to at least obtain a stack trace to see what gives: ... ==> verifying target database schema

Re: right list for SIGABRT python binary question ?

2017-10-23 Thread Karsten Hilbert
On Mon, Oct 23, 2017 at 03:26:18PM +0200, Thomas Jollans wrote: > >> It points to a memory corruption. > > > > While running valgrind and friends is beyond my capabilitis I > > have run the problem through gdb to at least obtain a stack > > trace to see what gives: > > I wouldn't read too much i

Re: right list for SIGABRT python binary question ?

2017-10-25 Thread Karsten Hilbert
On Tue, Oct 24, 2017 at 08:47:58PM +0200, M.-A. Lemburg wrote: > >> This error suggests that you have 32- and 64-bit versions of > >> Python and mxDateTime mixed in your installation. > >> > >> Py_InitModule4 is only available in the 32-bit build of > >> Python. With the 64-bit build, it's called

Re: psycopg2.ProgrammingError: syntax error at or near "\"

2017-10-27 Thread Karsten Hilbert
On Fri, Oct 27, 2017 at 08:35:20AM -0700, maheshyadav1...@gmail.com wrote: > I am using 'psycopg2' library to access my PostgreSQL database from a python. > I want to pass a variable input in psql query something like this :- > > psql>>\set my_user table1 > psql>>select * from :my_user limit 10

Re: Repairing Python installation?

2017-10-28 Thread Karsten Hilbert
On Sat, Oct 28, 2017 at 08:41:34PM +, Martin Schöön wrote: > It seems something is amiss with my Python 2.7 installation. Revisiting > Nikola (static web site generator written in Python) for the first time > in several years the other day I experience some unexpected problems. I > got some he

Aw: Re: Invoking return through a function?

2017-10-29 Thread Karsten Hilbert
> In this specific case, I wanted to invoke a return if the key doesn't > exist (as I wrote in my post). But this is not strictly relevant, my > question was more general. To phrase it in yet another way: is there > *any other way* to invoke return on a function, except by explicitly > writing

Re: right list for SIGABRT python binary question ?

2017-10-30 Thread Karsten Hilbert
On Mon, Oct 30, 2017 at 02:02:25PM +0100, M.-A. Lemburg wrote: > PS: Please CC me on replies as I don't regularly read c.l.p anymore. Sure. > >> Could you check whether you have similar import errors with > >> other modules that have C extensions ? E.g. lxml. > >> > >> What you're seeing appears

Re: right list for SIGABRT python binary question ?

2017-11-01 Thread Karsten Hilbert
On Wed, Nov 01, 2017 at 09:21:46AM +0100, dieter wrote: > >> It points to a memory corruption. > > The i386/x64 architecture supports memory access breakpoints > and GDB, too, has support for this. You know the address which > gets corrupted. Thus, the following apporach could have a chance > to

Re: right list for SIGABRT python binary question ?

2017-11-01 Thread Karsten Hilbert
On Wed, Nov 01, 2017 at 10:27:54AM +0100, Karsten Hilbert wrote: > > >> It points to a memory corruption. > > > > The i386/x64 architecture supports memory access breakpoints > > and GDB, too, has support for this. You know the address which > > gets corrupted

Re: right list for SIGABRT python binary question ?

2017-11-01 Thread Karsten Hilbert
On Wed, Nov 01, 2017 at 11:14:08AM +0100, Karsten Hilbert wrote: > Or rather: I need to find out which "place" a given address > refers to, check whether the changing addresses always belong > to the same "place" between runs and _then_ map a "place" to &g

Re: right list for SIGABRT python binary question ?

2017-11-01 Thread Karsten Hilbert
> my assumption would be that something clobbers 0x6aab7c, > which seems to be in (?) _Py_ZeroStruct in this run. I'll > re-run a few times to make sure the corruption "reliably" > hits _Py_ZeroStruct. > > If so, I'll set a memory write breakpoint on _Py_ZeroStruct. Interestingly, on subsequent r

Re: right list for SIGABRT python binary question ?

2017-11-01 Thread Karsten Hilbert
On Wed, Nov 01, 2017 at 12:40:56PM +0100, Karsten Hilbert wrote: > Interestingly, on subsequent runs, it seems to hit the same > address, 0x6aab7c, belonging to the same symbol, _Py_ZeroStruct. > > This is what happens: > > (gdb) watch *0x6aab7c > Hardware wa

Re: right list for SIGABRT python binary question ?

2017-11-01 Thread Karsten Hilbert
On Wed, Nov 01, 2017 at 11:58:53AM -0400, Dennis Lee Bieber wrote: > >I understand. Thank you for the explanation. This may seem > >like a dumb question: the actual address that gets corrupted > >varies from run to run (it may be the same "place" in the > > Since the process virtual memory

Re: right list for SIGABRT python binary question ?

2017-11-02 Thread Karsten Hilbert
On Wed, Nov 01, 2017 at 04:28:02PM +, Grant Edwards wrote: > >>I understand. Thank you for the explanation. This may seem > >>like a dumb question: the actual address that gets corrupted > >>varies from run to run (it may be the same "place" in the > > > > Since the process virtual memory

Aw: Try: Except: evaluates to True every time

2017-11-04 Thread Karsten Hilbert
Try in an interactive interpreter: python> "a string" is True Karsten > Gesendet: Samstag, 04. November 2017 um 16:31 Uhr > Von: "brandon wallace" > An: python-list@python.org > Betreff: Try: Except: evaluates to True every time > > > I have this code that tests a server to see if it is lis

Re: Try: Except: evaluates to True every time

2017-11-04 Thread Karsten Hilbert
On Sat, Nov 04, 2017 at 05:07:26PM +0100, Karsten Hilbert wrote: > Try in an interactive interpreter: > >python> "a string" is True Or, rather, python> if 'a string': print 'success' Sorry, Karsten -- GPG key ID E4071346 @ eu.pool.sks-

Re: right list for SIGABRT python binary question ?

2017-11-04 Thread Karsten Hilbert
On Fri, Nov 03, 2017 at 07:31:56AM +0100, dieter wrote: > > I have posted backtraces taken from the address being > > watched. Does that help any at all ? > > Only in the case that the error is "local", i.e. detected > (quite) immediately. > > You might be in this case as you have observed that

Re: Aw: Try: Except: evaluates to True every time

2017-11-05 Thread Karsten Hilbert
On Sun, Nov 05, 2017 at 11:28:44AM +1100, Steve D'Aprano wrote: > > Try in an interactive interpreter: > > > >python> "a string" is True > > Did you try that yourself? Yes, eventually, which is why I corrected myself publicly. However, while it doesn't return True (as I mistakenly suggeste

Re: Any good explanations on pd.merge(df,df2, on=['Code', 'Region'])

2017-11-08 Thread Karsten Hilbert
On Wed, Nov 08, 2017 at 09:26:04AM +, David Shi via Python-list wrote: > I am trying to gain a clear understanding on pd.merge(df,df2, on=['Code', > 'Region']). > Can anyone assist? ncq@hermes:~$ python Python 2.7.14 (default, Sep 17 2017, 18:50:44) [GCC 7.2.0] on li

Re: Shoulid constants be introduced to Python?

2017-11-17 Thread Karsten Hilbert
On Thu, Nov 16, 2017 at 05:35:59PM -0500, ROGER GRAYDON CHRISTMAN wrote: > Well, pi already does have a value: > import math math.pi > > 3.141592653589793 > > but it's not a constant in the sense you are looking for: And, it's not really a constant at all, it's only got a constant de

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-23 Thread Karsten Hilbert
On Thu, Nov 23, 2017 at 08:46:01PM +0100, Thomas Jollans wrote: > > I mean for a real practical situation - for example for an average > > Python programmer or someone who seeks a programmer job. > > And who does not have a 500-key keyboard, > > I don't think it's too much to ask for a programme

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-24 Thread Karsten Hilbert
On Thu, Nov 23, 2017 at 05:47:04PM -0700, Ian Kelly wrote: > > Understanding, let alone being able to read, code written in Arabic ? > > People are going to write code in Arabic whether you like it or not, > because not everybody speaks English, and not everybody who does > *wants* to use it. Now

Re: Please tell me how to execute python file in Ubuntu by double clicking on file. (Posting On Python-List Prohibited)

2017-12-06 Thread Karsten Hilbert
On Thu, Dec 07, 2017 at 01:29:11PM +1100, Steve D'Aprano wrote: > Actually, no, the answer to my question is very simple: Lawrence is mistaken > about Linux not doing file associations. It does -- it is merely handled by > the desktop environment (if there is one). We _can_ go one level below tha

Re: we want python software

2017-12-07 Thread Karsten Hilbert
> > A junior programmer sees the unlimited possibilities of programming. No > > montain is too high to climb. > > > > A seasoned programmer is elated if they can get anything to work at all. Good judgement comes from experience. And a lot of that comes from bad judgement. Karsten -- https://mail

Re: Anything similar to __END__ in perl

2017-12-08 Thread Karsten Hilbert
On Thu, Dec 07, 2017 at 11:55:48PM -0600, Peng Yu wrote: > Hi, perl has __END__ which ignore all the lines below it. > > Is there anything similar to __END__ in python? Thanks. Something similar is: import sys sys.exit() Karsten -- GPG key ID E4071346 @ eu.pool.sks-keyservers.

Re: Anything similar to __END__ in perl

2017-12-08 Thread Karsten Hilbert
On Fri, Dec 08, 2017 at 02:19:13AM -0800, Rustom Mody wrote: > > > Hi, perl has __END__ which ignore all the lines below it. > > > > > > Is there anything similar to __END__ in python? Thanks. > > > > Something similar is: > > > > import sys > > sys.exit() > > That will give syntax (or

Re: Where has the practice of sending screen shots as source code come from?

2018-01-28 Thread Karsten Hilbert
On Sun, Jan 28, 2018 at 03:04:26PM +, Steven D'Aprano wrote: > (The day a programmer posts a WAV file of themselves reading their code > out aloud, is the day I turn my modem off and leave the internet forever.) And the clever hack will be to send a WAV that tricks your modem into surprising

Re: read Unicode characters one by one in python2

2018-02-24 Thread Karsten Hilbert
On Sat, Feb 24, 2018 at 10:17:35AM -0600, Peng Yu wrote: > Here shows some code for reading Unicode characters one by one in > python2. Is it the best code for reading Unicode characters one by one > in python2? > > https://rosettacode.org/wiki/Read_a_file_character_by_character/UTF8#Python This

Re: Pre-Pre-PEP: The datetime.timedeltacal class

2022-04-17 Thread Karsten Hilbert
Am Sun, Apr 17, 2022 at 11:10:01AM +1200 schrieb Greg Ewing: > On 17/04/22 9:17 am, Karsten Hilbert wrote: > > Take this medication for 1 month ! > > > >is quite likely to mean "take it for 28 days". > > Except when your doctor prescribes 90 days worth of

Re: Automatic Gain Control in Python?

2022-06-06 Thread Karsten Hilbert
Am Mon, Jun 06, 2022 at 02:08:41PM -0400 schrieb Steve GS: > Yes, it is real-time play back of a pre-recorded presentation. ... What all of us around here don't understand is why you insist on not being able to modify the data to your heart's content inbetween this ... > [...] pulling in the pro

Re: How to replace characters in a string?

2022-06-08 Thread Karsten Hilbert
Am Wed, Jun 08, 2022 at 11:09:05AM +0200 schrieb Dave: > myString = 'Hello' > myNewstring = myString.replace(myString,'e','a’) That won't work (last quote) but apart from that: myNewstring = myString.replace('e', 'a') Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B -- https:

Aw: Re: Subtract n months from datetime [Why?]

2022-06-22 Thread Karsten Hilbert
> What makes sense depends on where you're looking from. > > It's 28 February, you need to keep it for 5 years, therefore you could > reason that you can dispose of it on 28 February, 5 years hence. > > However, that happens to be a leap year. > > Should you still have it on 29 February? Nope beca

Re: for -- else: what was the motivation?

2022-10-09 Thread Karsten Hilbert
Am Sun, Oct 09, 2022 at 05:37:59AM +0100 schrieb Axy via Python-list: > Python is awesome because it's semantic is clear for the majority, but there > are places > that look odd. In case of "for", "else" looks logically tied with "for" > clause, but > actually it is not. It's tied with "break" s

Re: What to use for finding as many syntax errors as possible.

2022-10-09 Thread Karsten Hilbert
Am Sun, Oct 09, 2022 at 06:59:36PM +0200 schrieb Antoon Pardon: > Op 9/10/2022 om 17:49 schreef Avi Gross: > >My guess is that finding 100 errors might turn out to be misleading. If you > >fix just the first, many others would go away. > > At this moment I would prefer a tool that reported 100 err

Re: What to use for finding as many syntax errors as possible.

2022-10-09 Thread Karsten Hilbert
Am Sun, Oct 09, 2022 at 07:51:12PM +0200 schrieb Antoon Pardon: > >But the point is: you can't (there is no way to) be sure the > >9+ errors really are errors. > > > >Unless you further constrict what sorts of errors you are > >looking for and what margin of error or leeway for false > >positives

Re: for -- else: what was the motivation?

2022-10-10 Thread Karsten Hilbert
Am Sun, Oct 09, 2022 at 09:58:14AM + schrieb Stefan Ram: > I often follow this rule. For me, it's about readability. Compare: > > if not open( disk ): > error( "Can't open disk" ) > else: > printf( "now imagine there's some larger block here" ) ... ad infinitum

Aw: Re: for -- else: what was the motivation?

2022-10-17 Thread Karsten Hilbert
> which had special combinations for all the BASIC keywords). And if you > go this way, why not go a step further and dissociate the program from > its linear text representation? Add footnotes, different views, > hyperlinks, format mathematical expressions like formulas, etc. http://literateprogr

Re: A trivial question that I don't know - document a function/method

2022-10-23 Thread Karsten Hilbert
Am Sat, Oct 22, 2022 at 09:49:55PM -0400 schrieb Thomas Passin: > def make_title_from_headline(self, p, h): > """From node title, return title with over- and underline- strings. ... >RETURNS >a string > """ > def plot(self, stackposition=MAIN, clearFirst=True): > "

Re: A trivial question that I don't know - document a function/method

2022-10-23 Thread Karsten Hilbert
Am Sun, Oct 23, 2022 at 05:16:48PM -0400 schrieb Thomas Passin: > > def make_title_from_headline(self, p, h) -> str: > > > > def plot(self, stackposition=MAIN, clearFirst=True) -> None: > 1. Knowing the type of a parameter isn't all you usually want to know; Sure, as I said: > >and use

"mailcap" to be removed (3.13) -- suggested replacement ?

2022-10-26 Thread Karsten Hilbert
Dear list, Python 3.11 marks "mailcap" for removal in 3.13. The documentation speaks about "mimetypes" being a replacement, of sorts. I agree with removing dead batteries. However, I can't really see how "mimetypes" helps in replacing the functionality of "mailcap" ? Put another way: what is the

Re: In code, list.clear doesn't throw error - it's just ignored

2022-11-14 Thread Karsten Hilbert
Am Mon, Nov 14, 2022 at 02:13:34AM + schrieb MRAB: > But if it's an expression where it's expecting a statement and it's not a > call, then > it's probably a bug. That "probably" makes it suitable for a linter, as was pointed out. Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4

Re: Are these good ideas?

2022-11-14 Thread Karsten Hilbert
Am Mon, Nov 14, 2022 at 05:14:05PM + schrieb Stephen Tucker: > Issue 2 - Passed Parameters > > I am now facing another situation where I am wanting to pass 6 or 7 > parameters down through several layers of logic (function A calling > function B calling ... ) and for results to be passed back.

pylint scoping question

2023-02-08 Thread Karsten Hilbert
Dear readers, I have a pylint scoping (or how-to) question. pylint 2.7.2 astroid 2.5.1 Python 3.9.2 (default, Feb 28 2021, 17:03:44) Objective: to disable all pylint errors/warnings starting from a particular source line until EOF (that part contains to-be-run-manually s

Re: pylint scoping question

2023-02-08 Thread Karsten Hilbert
Am Wed, Feb 08, 2023 at 12:20:48PM +0100 schrieb Karsten Hilbert: > I have a pylint scoping (or how-to) question. ... > Objective: > > to disable all pylint errors/warnings starting from a > particular source line until EOF (that part contains > to-be-run-manually scratch/test

Re: TypeError: can only concatenate str (not "int") to str

2023-02-27 Thread Karsten Hilbert
Am Sun, Feb 26, 2023 at 08:56:28AM -0800 schrieb Hen Hanna: > so far, i think Paul Rubin's post (in another thread) was > esp. concise, informative, --- but he's also made a comment > about 'shunting' beginners (questions) to a > concentration camp, and sounded a bit like a cold-he

Aw: Re: Python 3.10 Fizzbuzz

2023-02-28 Thread Karsten Hilbert
> > I've never tried Black or any other code formatter, but I'm sure we > > wouldn't get on. > > Does this suggest, that because Black doesn't respect other people's > opinions and feelings, that it wouldn't meet the PSF's Code of Conduct? That much depends on The Measure Of A Man. Karsten -- ht

Aw: Re: Standard class for time *period*?

2023-03-28 Thread Karsten Hilbert
> No, it doesn't. I already know about timedelta. I must have explained > the issue badly, because everyone seems to be fixating on the > formatting, which is not a problem and is incidental to what I am really > interested in, namely: > > 1. Is there a standard class for a 'period', i.e. length

Aw: Re: Windows Gui Frontend

2023-04-02 Thread Karsten Hilbert
> The real time consuming stuff in building GUIs is getting > the basic design right and keeping all the controls, > keyboard bindings and menus in sync. State management > in other words. And cominmg up with sensible design choices _at all_. > I did a deep dive examination of GUI builders back a

Re: open sentinel-2image python

2021-01-17 Thread Karsten Hilbert
Am Sun, Jan 17, 2021 at 02:20:24AM -0800 schrieb omid mohammadi: > When I open the sentinel-2 image in Python, I get the following error: > > MemoryError: Unable to allocate 115. MiB for an array with shape (5490, 5490) > and data type float32 > > How can I fix it? You can install more RAM. Kar

Re: Python cannot count apparently

2021-02-07 Thread Karsten Hilbert
Am Sun, Feb 07, 2021 at 08:34:34PM +0100 schrieb Philipp Daher via Python-list: > I recently coded this snippet of code: > myString=„hello“ I doubt you have (coded *this* snippet of code) -- because those quotes wouldn't work. Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B --

Re: Python cannot count apparently

2021-02-07 Thread Karsten Hilbert
Am Sun, Feb 07, 2021 at 07:47:03PM + schrieb Paul Bryan: > That's not the only problem with the code. There's a missing close- > paren and a reference to "string" which I presume was meant to be > "myString". I know. I wasn't going to spoil everything right away. The sort of response we would

Re: .title() - annoying mistake

2021-03-22 Thread Karsten Hilbert
Am Mon, Mar 22, 2021 at 09:22:51AM + schrieb Robert Latest via Python-list: > >> I agree with everything you say. Especially the open source part. But > >> wouldn't you agree that .title() with all its arbitrary specificity to > >> appear in the very core of a general purpose language is quite

Aw: not able to download PyAudio

2021-04-02 Thread Karsten Hilbert
The same as with speech recognition. Research. Karsten > Gesendet: Freitag, 02. April 2021 um 10:40 Uhr > Von: "ᗷᑌᑎᑎY" > An: "Igor Korot" > Cc: "python-list@python.org" > Betreff: not able to download PyAudio > >Hello everyone >I am not able to download PyAudio. I tried by typing pip

Re: googletrans in python

2021-04-12 Thread Karsten Hilbert
Am Mon, Apr 12, 2021 at 12:48:23PM -0400 schrieb Quentin Bock: > Can someone explain the basics of googletrans in python? > I want to make a program that translates stories into English, but I'm not > sure how to get a translation printed. Also, is this needed to be done in > an HTML file inside p

Re: XML Considered Harmful

2021-09-25 Thread Karsten Hilbert
Am Fri, Sep 24, 2021 at 08:59:23PM +0200 schrieb Peter J. Holzer: > JSON: Has a few primitive data types (bool, number, string) and a two > compound types (list, dict(string -> any)). Still missing many > frequently used data types (e.g. dates) But that (dates) at least has a well-known mapping t

Re: XML Considered Harmful

2021-09-28 Thread Karsten Hilbert
Am Tue, Sep 28, 2021 at 12:53:49PM -0500 schrieb Michael F. Stemper: > This sounds like a suggestion that I hard-code the data into a > module. I suppose that I could have half-a-dozen modules with > different data sets and ln them as required: > > $ rm GenData.py* FuelData.py* > $ ln gendata1.py

Re: Definitive guide for Regex

2021-10-05 Thread Karsten Hilbert
Am Thu, Sep 30, 2021 at 12:29:16PM +0100 schrieb Shaozhong SHI: > I am trying to look for a definitive guide for Regex in Python. > Can anyone help? If you tell us what you tried in order to look we can perhaps guide you on how to take a better look. Spoonfeeding doesn't seem to be a well-liked

Re: The task is to invent names for things

2021-10-27 Thread Karsten Hilbert
Am Wed, Oct 27, 2021 at 10:20:19AM +1100 schrieb Chris Angelico: > Many operations in computing are fully reversible. After you do > something, you can undo it. After you assign, you can unassign. And > after you ite, you can unite! I wonder whether Japanese programmers would agree. Karsten -- G

Re: The task is to invent names for things

2021-10-27 Thread Karsten Hilbert
Am Tue, Oct 26, 2021 at 11:36:33PM + schrieb Stefan Ram: > xyzzy = lambda x: 2 * x > > . Sometimes, this can even lead to "naming paralysis", where > one thinks excessively long about a good name. To avoid this > naming paralysis, one can start out with a mediocre name. In > the course

Re: The task is to invent names for things

2021-10-27 Thread Karsten Hilbert
Am Wed, Oct 27, 2021 at 10:00:16PM +1100 schrieb Chris Angelico: > > Am Wed, Oct 27, 2021 at 10:20:19AM +1100 schrieb Chris Angelico: > > > > > Many operations in computing are fully reversible. After you do > > > something, you can undo it. After you assign, you can unassign. And > > > after you

Re: The task is to invent names for things

2021-10-27 Thread Karsten Hilbert
Am Wed, Oct 27, 2021 at 12:41:56PM +0200 schrieb Karsten Hilbert: > Am Tue, Oct 26, 2021 at 11:36:33PM + schrieb Stefan Ram: > > > xyzzy = lambda x: 2 * x > > > > . Sometimes, this can even lead to "naming paralysis", where > > one thinks excessive

Aw: Re: The task is to invent names for things

2021-10-27 Thread Karsten Hilbert
> > I don't know. A mediocre name conveys at least some information, and > > that seems to be better than none. On the other hand it might be just > > enough to lead the reader astray which wouldn't happen with a > > non-sensical name. I was thinking that a nonsensical name might lead readers to g

Aw: Re: The task is to invent names for things

2021-10-28 Thread Karsten Hilbert
> Karsten Hilbert writes: > >ite is the -te form (in some uses like a gerundium) of aru > >(to go, to walk) > > This form, "行って", is written with two "t", as "itte", > in many transcriptions to convey the gemination (っ) of > the &qu

Re: How to apply a self defined function in Pandas

2021-10-31 Thread Karsten Hilbert
Am Sun, Oct 31, 2021 at 07:52:18PM + schrieb Shaozhong SHI: > Well, can you expand the the simplicity? Not sure how expanding is going to help but here's one way to do it: Python 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] on linux Type "help", "copyr

Re: builtins.TypeError: catching classes that do not inherit from BaseException is not allowed

2021-12-31 Thread Karsten Hilbert
Am Thu, Dec 30, 2021 at 03:57:25PM -0800 schrieb hongy...@gmail.com: > > > Then what cases/scenarios can demonstrate the beauty of recursion? > > > > > Walking a tree. > > There are many type of trees. Do you mean all of them? Palm trees don't lend themselves to recursion all that much. Karsten

Aw: Re: Best way to check if there is internet?

2022-02-07 Thread Karsten Hilbert
> Or the internet acquires a new protocol that's designed > for very-long-latency connections. That's being worked on already https://en.wikipedia.org/wiki/NASA_Deep_Space_Network Karsten -- https://mail.python.org/mailman/listinfo/python-list

Aw: Re: Long running process - how to speed up?

2022-02-19 Thread Karsten Hilbert
> > I have a cvs file of 932956 row and have to have time.sleep in a Python > > script. It takes a long time to process. > > > > How can I speed up the processing? Can I do multi-processing? > > > Remove the time.sleep()? He's attesting to only having "time.sleep" in there... I doubt removing t

Aw: PYT - How can I subscribe to a topic in the mailing list?

2022-02-19 Thread Karsten Hilbert
> Betreff: PYT - How can I subscribe to a topic in the mailing list? Mailing lists don't subdivide by topic. Your mailer may allow you to filter by Subject:. > And h*ow do I set the topic in my messages?* not applicable The equivalent would be the Subject: header. Karsten -- https://mail.pyt

Aw: Re: Best way to check if there is internet?

2022-02-22 Thread Karsten Hilbert
> Is there any value whatsoever in a lie? Do we _know_ it's a lie ? Does a lie become a Falsed Truth once it becomes known ? Karsten -- https://mail.python.org/mailman/listinfo/python-list

Re: Pre-Pre-PEP: The datetime.timedeltacal class

2022-04-16 Thread Karsten Hilbert
Am Sat, Apr 16, 2022 at 07:35:51PM +0200 schrieb Peter J. Holzer: > So I'll start by gathering some feedback > here with a rough sketch. > [TODO: Research how other systems handle overflow > (e.g. 2022-01-31 + 1 month: 2022-02-31 doesn't exist)], That is context dependant: Take this med

Re: ANN: PyDDF Python Spring Sprint 2018

2018-04-11 Thread Karsten Hilbert
> * mxDateTime Portierung auf Python 3.6 +1 !! Karsten Hilbert -- -- https://mail.python.org/mailman/listinfo/python-list

Re: beacons and geofences

2018-04-12 Thread Karsten Hilbert
On Thu, Apr 12, 2018 at 12:33:39AM +0200, ElChino wrote: > Rafal Sikora wrote: > > > Hi! I want users’ devices to be able to monitor the maximum amount of POIs > > at > > once (geo-fences/beacons) and I need to prepare an algorithm solution for > > monitoring the POIs. How should it be implemen

Aw: Re: why does list's .remove() does not return an object?

2018-05-17 Thread Karsten Hilbert
> On 5/17/18 11:57 AM, Abdur-Rahmaan Janhangeer wrote: > > x = [0,1] > > x.remove(0) > > new_list = x > > > > instead i want in one go > > > > x = [0,1] > > new_list = x.remove(0) # here a way for it to return the modified list by > > adding a .return() maybe ? > > There isn't a way to do that in

Aw: Re: why does list's .remove() does not return an object?

2018-05-17 Thread Karsten Hilbert
>new_list = list(x.remove(0)) >new_list = x.remove(0)[:] Please disregard :) kh -- https://mail.python.org/mailman/listinfo/python-list

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-20 Thread Karsten Hilbert
On Sun, May 20, 2018 at 04:59:12AM -0700, bellcanada...@gmail.com wrote: > On Saturday, 19 May 2018 19:48:20 UTC-4, Skip Montanaro wrote: > > As Chris indicated, you'll have to figure out the correct encoding. You > > might want to check out the chardet module (available on PyPI, I believe) > > a

Re: '_' and '__'

2018-05-27 Thread Karsten Hilbert
On Sun, May 27, 2018 at 10:36:30AM +1000, Ben Finney wrote: > Nick also explains that, because the name ‘_’ has too many conventional > meanings already, the name ‘__’ is better for “don't need this value but > I am required to specify a name”. _() is often bound to gettext.gettext() in the globa

Re: Re: The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

2018-05-30 Thread Karsten Hilbert
On Wed, May 30, 2018 at 11:01:17PM +0200, Peter J. Holzer wrote: > On 2018-05-30 22:08:45 +0200, Paul St George wrote: > > Ha! No, my question was clumsy. > > > > If I know the name of the viewer that I want to use (say for example: > > ‘ImageMagick’), where do I find the argument that should be

Re: your mail

2018-06-10 Thread Karsten Hilbert
On Sun, Jun 10, 2018 at 06:58:17PM +0530, sagar daya wrote: > Couldn't install any module from pip > Plz help??? https://duckduckgo.com kh -- -- https://mail.python.org/mailman/listinfo/python-list

Re: Question : Input after all prompts in python

2018-06-11 Thread Karsten Hilbert
On Mon, Jun 11, 2018 at 01:44:19AM -0700, moha...@gmail.com wrote: > I am very new to python. I am trying to achieve the below in it, but i am > unable to find suitable documentation to guide me on the same. > > I want to prompt 3 questions together and then get input for the first > question n

Re: Question : Input after all prompts in python

2018-06-11 Thread Karsten Hilbert
On Mon, Jun 11, 2018 at 11:16:39AM +, Steven D'Aprano wrote: > > I want to prompt 3 questions together and then get input for the first > > question next to question as below. > > > > 1. Enter your name : _ > > 2. Enter your age : > > 3. Enter your gender : > > > > After showing the below pr

Re: Question : Input after all prompts in python

2018-06-11 Thread Karsten Hilbert
On Mon, Jun 11, 2018 at 02:14:26PM +0200, Peter Otten wrote: > >> print("1. Enter your name :") > >> print("2. Enter your age :") > >> print("3. Enter your gender :") > >> name = input("") > >> age = input("") > >> gender = input("") > > > > That doesn't solve the "next to" part in > > > > get i

Re: Question : Input after all prompts in python

2018-06-11 Thread Karsten Hilbert
On Mon, Jun 11, 2018 at 02:52:53PM +0200, Peter Otten wrote: > If the above hack works in the OP's environment it's certainly as easy as it > can get; he just has to copy the up() and right() functions, and maybe adapt > the arguments. > > The learning curve for tkinter or curses is steep by co

Re: error in os.chdir

2018-06-30 Thread Karsten Hilbert
On Sat, Jun 30, 2018 at 04:05:22AM -0700, Sharan Basappa wrote: > I need to change directory to my local working directory in windows and then > open a file for processing. > Its just a 3 lines code, as below: > import csv > import os > os.chdir('D:\Projects\Initiatives\machine learning\programs\

Re: error in os.chdir

2018-06-30 Thread Karsten Hilbert
On Sat, Jun 30, 2018 at 05:46:59AM -0700, Sharan Basappa wrote: > > >> The quick fix: > > >> > > >> put an r in front of the directory string: r'...' > > > > Please don't do that. It's the wrong solution -- all you are doing is > > postponing failure. It will *seem* to work, until one day you w

Re: error in os.chdir

2018-06-30 Thread Karsten Hilbert
On Sat, Jun 30, 2018 at 07:34:46AM -0700, Sharan Basappa wrote: > sorry. I mean why my code worked in one case but did not in the other one. > > This worked - os.chdir('D:\Projects\Initiatives\machine learning\programs') > > This did not work - os.chdir('D:\Projects\Initiatives\machine > learn

Re: Logger option

2018-06-30 Thread Karsten Hilbert
On Sat, Jun 30, 2018 at 10:02:13AM -0700, Sharan Basappa wrote: > I have tried both logging and trace in Canopy and both are not working. You will have to be more specific. Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B -- https://mail.python.org/mailman/listinfo/python-lis

Re: File names with slashes [was Re: error in os.chdir]

2018-07-02 Thread Karsten Hilbert
Eryk, thanks for your to-the-point in-depth posts. Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B -- https://mail.python.org/mailman/listinfo/python-list

  1   2   3   >