Re: Is Python suitable for a huge, enterprise size app?

2005-05-27 Thread Dieter Maurer
st memory) did not speed up things but restarting did. I do not understand this observed behaviour. > every > time I've seen serious fragmentation, it's been related to leaks, > not peak memory usage. An analysis did not reveal serious leaks, in the cases mentioned above. D

Re: python24.zip

2005-05-27 Thread Dieter Maurer
before the Python start. To our great surprise, this did not significantly reduced Python's (cold) startup time. We concluded that there must be other IO not directed to the zip archives, started investigating and found the 10.000 opens to non-existing files as the only other significant IO

Re: python24.zip

2005-05-27 Thread Dieter Maurer
s an existing file object and then checks that it is indeed a zip archive. Adding a cache for this check could save an additional few hundreds of opens. Dieter -- http://mail.python.org/mailman/listinfo/python-list

Re: some profiler questions

2005-06-09 Thread Dieter Maurer
ance's method at runtime? class_.f = some_wrapper(class_.f) > What my profiler is doing is overriding > the key fns/methods of an instance with a stat-gatherer-instrumented > version, which ends up calling the original method. I tried reading > profile.py and pstats.py for ideas, but

Re: subprocess module and blocking

2005-06-13 Thread Dieter Maurer
ot;s docstring might have you averted: "Note: the data read is buffered in memory... do not use for large size". If subprocess would do what you expect, it would need to buffer the output (to make room in the pipes again). But, for large data, this could have dramatic consequences.

pil_usm for python 2.5?

2007-08-14 Thread Dieter Vanderelst
Hi list, Does anybody have a version of pil_usm (module for gaussian blurring) that is compiled for Python 2.5? Regards, Dieter -- Dieter Vanderelst [EMAIL PROTECTED] Department of Industrial Design Designed Intelligence -- Dieter Vanderelst [EMAIL PROTECTED] -- http

Re: [Zope] how do I test for the current item in an iteration

2007-09-28 Thread Dieter Maurer
<= 5: >print "%s: %s: %s" % (i.id, i.author, i.summary) You are aware that you use "i" both as an integer ("i <= 5") as well as a structure ("i.id", "i.author", ...). Python is quite polymorph -- but there are some limits. An

Re: pdf to text

2007-01-25 Thread Dieter Deyke
th cygwin on a regular basis without any problem. Your program above should read: sout = os.popen('pdftotext "%s" - ' % (f,)) -- Dieter Deyke A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? -- http://mail.python.org/mailman/listinfo/python-list

Re: Module for SVG?

2007-01-26 Thread Dieter Verfaillie
, > SB. Cairo ( http://cairographics.org/pycairo ), using cairo.SVGSurface(). As a bonus, if you'd ever need it, you can switch to a different Surface (for example ps or pdf) and use the same drawing code with it. There's a good tutorial on http://www.tortall.net/mu/wiki/Ca

Re: Newbie in the deep - some PyGTK questions

2007-02-24 Thread Dieter Verfaillie
.org/pygtk2tutorial/sec-CellRenderers.html (scroll all the way down that page to "Figure 14.6. Editable and Activatable Cells") > Thank you for your patience. I can already see how all this is going to > keep me busy for weeks and it will be fun ;) You'll probably get fast

Re: Newbie in the deep - some PyGTK questions

2007-02-26 Thread Dieter Verfaillie
ve, even for a python programmer. There's also a lot of information in section 13 of the pygtk faq: http://www.async.com.br/faq/pygtk/index.py?req=index hth, Dieter -- http://mail.python.org/mailman/listinfo/python-list

Re: Volume id

2007-11-16 Thread Dieter Verfaillie
You'll maybe have to expand the filter on line 37, but I'm not sure... hth, Dieter #!/usr/bin/env python import dbus def discover(): disks = [] volumes = [] # get a connection to the system bus bus = dbus.SystemBus () # get a HAL object and an interface to HAL

Re: pythonic backtrace with gdb

2008-01-24 Thread Dieter Maurer
ordering comparison. > > I'm using GDB version 6.6.90. I expect that your GDB version is too new and has introduced some safety checks (which now break). It will probably help when you add explicite type casts to "long" around the comparisons in the definition of "pb

Re: ZSI and attachments

2008-03-14 Thread Dieter Maurer
at > can handle attachments? The ZSI 2.0 documentation says: "...It can also be used to build applications using SOAP Messages with Attachments" I never did it and do not know how ZSI supports this. You probably will get a more informed answer on mailto:[EMAIL PROTECTED], t

Re: Profiling Python

2008-12-06 Thread Dieter Maurer
he copy. Of course, you will then profile also the "PrintStats" in the running profiler. Dieter -- http://mail.python.org/mailman/listinfo/python-list

Re: The Importance of Terminology's Quality

2008-05-13 Thread Dieter Maurer
with two operands, a variable name and an expression resulting in another expression which behaves like a function (the abstraction of the variable name in the expression). Dieter -- http://mail.python.org/mailman/listinfo/python-list

Nested generator caveat

2008-07-03 Thread Dieter Maurer
his would mean that locally defined functions with free variables are very risky in generators. -- Dieter -- http://mail.python.org/mailman/listinfo/python-list

Re: PyGTK localisation on Win32

2008-03-30 Thread Dieter Verfaillie
nctions. Put the attached locale module in a libi18n package and use like this: #!/usr/bin/env python from libi18n import locale locale.fix_locale() del locale hth, Dieter # -*- coding: utf-8 -*- # # locale.py - libi18n # Copyright (C) 2007-2008 Dieter Verfaillie <[EMAIL PROTECTED]> # # This l

Re: Tremendous slowdown due to garbage collection

2008-04-27 Thread Dieter Maurer
not be true. We observed similar very bad behaviour -- in a Web application server. Apparently, the standard behaviour is far from optimal when the system contains a large number of objects and occationally, large numbers of objects are created in a short time. We have seen such behaviour during par

Re: Tremendous slowdown due to garbage collection

2008-04-28 Thread Dieter Maurer
change -- only that applications with lots of objects may want to consider a reconfiguration. -- Dieter -- http://mail.python.org/mailman/listinfo/python-list

Re: Remove multiple inheritance in Python 3000

2008-04-28 Thread Dieter Maurer
lots of tedious error prone delegations to work around this limitation. Dieter -- http://mail.python.org/mailman/listinfo/python-list

Re: Tremendous slowdown due to garbage collection

2008-05-01 Thread Dieter Maurer
John Nagle <[EMAIL PROTECTED]> writes on Mon, 28 Apr 2008 11:41:41 -0700: > Dieter Maurer wrote: > > Christian Heimes <[EMAIL PROTECTED]> writes on Sat, 12 Apr 2008 18:47:32 > > +0200: > >> [EMAIL PROTECTED] schrieb: > >>> which made me sugg

Re: Code works in current dir only?

2008-08-15 Thread Dieter Deyke
r(n): > print "[d]", n > elif os.path.isfile(n): > print "[f]", n > else: > print "[?]", n > > # this works > if __name__ == "__main__": > collectinfo(".") > >

Re: Large production environments using ZODB/ZOE?

2008-08-17 Thread Dieter Maurer
in use for a large > system? By large, I'm thinking in terms of both horizontally-scaled > systems and in terms of data storage size. We are using it to host about a hundred domains of the "Haufe Mediengruppe", among others "www.haufe.de", "www.lexware.de&quo

Re: Interrupt python thread

2008-08-30 Thread Dieter Maurer
t executes Python code (i.e. not when it is waiting or running in external (e.g. "C") code). You may use (e.g.) "PyRex" to make a Python wrapper available to your Python code. Dieter -- http://mail.python.org/mailman/listinfo/python-list

Re: Process "Killed"

2008-09-01 Thread dieter h
On Sat, Aug 30, 2008 at 11:07 AM, Eric Wertman <[EMAIL PROTECTED]> wrote: >> I'm doing some simple file manipulation work and the process gets >> "Killed" everytime I run it. No traceback, no segfault... just the >> word "Killed" in the bash shell and the process ends. The first few >> batch runs w

Re: Zsi interoperability

2008-09-18 Thread Dieter Maurer
l way to let ZSI work over "https" rather than "http". I do not know whether Python supports a client certificate authentication transport out of the box -- but at least the problem is split into two easier parts. Dieter -- http://mail.python.org/mailman/listinfo/python-list

Re: Zsi interoperability

2008-09-18 Thread Dieter Maurer
t for SOAP with > Attachments; I can see ZSI does not support it The ZSI documentation (2.0) says that SOAP attachments are supported -- but I never tried it. Dieter -- http://mail.python.org/mailman/listinfo/python-list

Re: SOAPpy, WSDL and objects

2006-03-08 Thread Dieter Maurer
stName, > 'lastname': LastName} > server.login(request) Try: "server.login({'request':request})". Dieter -- http://mail.python.org/mailman/listinfo/python-list

Re: setattr() oddness

2010-01-17 Thread Dieter Maurer
query objects as cache keys. Then, query objects must not get changed in an uncontrolled way. I use "__setattr__" to control access to the objects. Dieter -- http://mail.python.org/mailman/listinfo/python-list

Re: setattr() oddness

2010-01-19 Thread Dieter Maurer
Steven D'Aprano writes on 18 Jan 2010 06:47:59 GMT: > On Mon, 18 Jan 2010 07:25:58 +0100, Dieter Maurer wrote: > > > Lie Ryan writes on Sat, 16 Jan 2010 19:37:29 +1100: > >> On 01/16/10 10:10, Sean DiZazzo wrote: > >> > Interesting. I can understand

Re: Memory usage problem of twisted server

2010-01-21 Thread Dieter Maurer
gmentation rate is especially high when the memory request sizes have a high variance. > > Is that my guessing correct? How can I monitor the memory allocation > of Python? Look at "http://guppy-pe.sourceforge.net/"; -- Dieter -- http://mail.python.org/mailman/listinfo/python-list

Re: Things to know about super (was: super() and multiple inheritance failure)

2009-09-27 Thread Dieter Maurer
Michele Simionato writes on Fri, 25 Sep 2009 22:58:32 -0700 (PDT): > ... >You know that in an ideal world I would just > throw > away multiple inheritance, it is just not worth the complication. I am a fan of multiple inheritance: it lets the compliler/language runtime do stupid tasks (implement

Re: python performance on Solaris

2009-10-16 Thread Dieter Maurer
not be use by Python, the additional overhead (switching between CPUs) may reduce overall performance. I agree with you that it is difficult to understand when this overhead were really significant. Dieter -- http://mail.python.org/mailman/listinfo/python-list

Re: restriction on sum: intentional bug?

2009-10-17 Thread Dieter Maurer
ately. ''.join() > *is* the right and good way to concatenate strings. Apparently, "sum" special cases 'str' in order to teach people to use "join". It would have been as much work and much more friendly, to just use "join" internally to implement "sum" when this is possible. Dieter -- http://mail.python.org/mailman/listinfo/python-list

[OT] Supporting "homework" (was: Re: Checking a Number for Palindromic Behavior)

2009-10-22 Thread Dieter Maurer
d will face in the near future (defeating hunger, preventing drastic climate changes, natural resources exhaustion, ); intensive cooperation seems to be necessary. Dieter -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6 Deprecation Warnings with __new__ Can someone explain why?

2009-10-24 Thread Dieter Maurer
Terry Reedy writes on Fri, 23 Oct 2009 03:04:41 -0400: > Consider this: > > def blackhole(*args, **kwds): pass > > The fact that it accept args that it ignores could be considered > misleading or even a bug. Maybe, it could. But, it is by no means necessary. In mathematics, there is a set of i

Re: advice needed for lazy evaluation mechanism

2009-11-11 Thread Dieter Maurer
es examples to efficiently use iterators (and by inclusion generators) without sacrificing clarity. -- Dieter -- http://mail.python.org/mailman/listinfo/python-list

Re: Use eval() safely?

2010-02-24 Thread Dieter Maurer
at least you make the Black Hats work harder before they own > your server :) Using functionality introduced with the class/type homogenization, it is quite easy to get access to the "file" type (even when "__builtins__" is disabled). Having "file", arbitrary files can be read, written, destroyed... Dieter -- http://mail.python.org/mailman/listinfo/python-list

cycling through options

2010-03-16 Thread Dieter Faulbaum
Hello, is there a better way for cycling through all options than this: (options, args) = parser.parse_args() for opt in options.__dict__.keys(): print opt, ":", options.__dict__[opt] Thanks for any nicer solution -- Dieter Faulbaum -- http://mail.python.org/mailman/listi

Re: pythoncom.CoInitialize() not recognised in Eclipse

2010-03-28 Thread Dieter Verfaillie
, you could try adding pythoncom to the "Forced Builtins" tab of your Python interpreter configuration to see if it helps (restart eclipse after you've done that, sometimes changes to the symbols database don't get picked up without restarting ecli

Re: httplib incredibly slow :-(

2009-08-14 Thread Dieter Maurer
d what the time is used for. As almost all operations are not done in Python itself ("httplib" is really a very tiny wrapper above a socket), a C level profile may be necessary to understand the behaviour. Dieter -- http://mail.python.org/mailman/listinfo/python-list

Re: break unichr instead of fix ord?

2009-08-29 Thread Dieter Maurer
"Martin v. Löwis" writes on Fri, 28 Aug 2009 10:12:34 +0200: > > The PEP says: > > * unichr(i) for 0 <= i < 2**16 (0x1) always returns a > >length-one string. > > > > * unichr(i) for 2**16 <= i <= TOPCHAR will return a > >length-one string on wide Python builds. On

Re: Canonical list of Python security vulnerabilities

2023-07-15 Thread Dieter Maurer via Python-list
Bob Kline wrote at 2023-7-14 13:35 -0400: >Can someone point me to the official catalog of security vulnerabilities in >Python (by which I mean cpython and the standard libraries)? I found >https://www.cvedetails.com/vulnerability-list/vendor_id-10210/product_id-18230/Python-Python.html >but that i

Re: Meta Class Maybe?

2023-07-23 Thread Dieter Maurer via Python-list
Chris Nyland wrote at 2023-7-22 19:12 -0400: >So I am stuck on a problem. I have a class which I want to use to create >another class without having to go through the boiler plate of subclassing. Do you know about `__init_subclass__`? It is called whenever a class is subclassed and can be used to

Re: Fallback for operator and other dunder methods

2023-07-26 Thread Dieter Maurer via Python-list
Dom Grigonis wrote at 2023-7-26 05:22 +0300: > ... >Is there a way to achieve it without actually implementing operators? >I have looked at Proxy objects, but they do not seem suited to achieve this. Proxying is a good approach: you might have a look at `dm.reuse.proxy.OverridingProxy` (--> `dm.re

Re: How to find the full class name for a frame

2023-08-04 Thread Dieter Maurer via Python-list
Jason Friedman wrote at 2023-8-3 21:34 -0600: > ... >my_frame = inspect.currentframe() > ... >My question is: let's say I wanted to add a type hint for my_frame. `my_frame` will be an instance of `Types.FrameType`. -- https://mail.python.org/mailman/listinfo/python-list

Re: GNU gettext: Print string translated and untranslated at the same time

2023-08-17 Thread Dieter Maurer via Python-list
c.bu...@posteo.jp wrote at 2023-8-17 07:10 +: >I want to display one string in its original source (untranslated) >version and in its translated version site by site without duplicating >the string in the python source code? Is it an option for you to replace the `gettext` binding by `zope.i18

Re: GNU gettext: Print string translated and untranslated at the same time

2023-08-17 Thread Dieter Maurer via Python-list
c.bu...@posteo.jp wrote at 2023-8-17 07:10 +: >I want to display one string in its original source (untranslated) >version and in its translated version site by site without duplicating >the string in the python source code? You could try to translate into an unknown language: this should give

Re: Passing info to function used in re.sub

2023-09-04 Thread Dieter Maurer via Python-list
Jan Erik Moström wrote at 2023-9-3 18:10 +0200: >I'm looking for some advice for how to write this in a clean way > ... >The "problem" is that I've currently written some code that works but it uses >global variables ... and I don't like global variables. I assume there is a >better way to write

Re: How to write list of integers to file with struct.pack_into?

2023-10-02 Thread Dieter Maurer via Python-list
Jen Kris wrote at 2023-10-2 00:04 +0200: >Iwant to write a list of 64-bit integers to a binary file. Everyexample I >have seen in my research convertsit to .txt, but I want it in binary. I wrote >this code,based on some earlier work I have done: > >buf= bytes((len(qs_array)) * 8) > >for offset

Re: Simple webserver

2023-10-22 Thread Dieter Maurer via Python-list
Janis Papanagnou wrote at 2023-10-21 04:03 +0200: > ... >I'd like to ask; where do you see the specific risks with Python >(as language per se) and it's (web-socket-)libraries here? The web server in Python's runtime library is fairly simple, focusing only on the HTTP requirements. You might want

Re: Question(s)

2023-10-25 Thread Dieter Maurer via Python-list
o1bigtenor wrote at 2023-10-24 07:22 -0500: > ... >Is there a way to verify that a program is going to do what it is >supposed to do even >before all the hardware has been assembled and installed and tested? Others have already noted that "verify" is a very strong aim. There are different kinds o

Re: Simple webserver

2023-10-25 Thread Dieter Maurer via Python-list
p as a >reverse-proxy using Nginx. I tested this a few years ago using Apache, >and it 'just worked', so I am fairly sure that it will work with Nginx >as well. Nginx can then provide the additional functionality that Dieter >has mentioned. Good ideas. -- https://mail.python.org/mailman/listinfo/python-list

Re: Question(s)

2023-10-25 Thread Dieter Maurer via Python-list
o1bigtenor wrote at 2023-10-25 06:44 -0500: >On Wed, Oct 25, 2023 at 6:24?AM Dieter Maurer wrote: > ... >> There are different kinds of errors. >> >> Some can be avoided by using an integrated development environment >> (e.g. misspellings, type mismatches, ...). &g

Re: Question(s)

2023-10-25 Thread Dieter Maurer via Python-list
o1bigtenor wrote at 2023-10-25 07:50 -0500: >> There are several others, >> e.g. "ECLIPSE" can be used for Python development. > >Is 'Eclipse' a Windows oriented IDE? No. ==> "https://en.wikipedia.org/wiki/Eclipse_(software)" -- https://mail.python.org/mailman/listinfo/python-list

Re: Question(s)

2023-10-25 Thread Dieter Maurer via Python-list
o1bigtenor wrote at 2023-10-25 08:29 -0500: > ... >It would appear that something has changed. > >Went to the Eclipse download page, downloaded and verified (using sha-512). >Expanded software to # opt . >There is absolutely NO mention of anything python - - - java, c and >its permutations, >'scien

Re: NameError: name '__version__' is not defined

2023-10-27 Thread Dieter Maurer via Python-list
Loris Bennett wrote at 2023-10-27 09:29 +0200: > ... >For the application with the system Python this mechanism works, but for >the non-system Python I get the error: > > NameError: name '__version__' is not defined If you get exceptions (they usually end in `Error` (such as `NameError`)), look a

Re: How to find any documentation for smbus?

2023-10-30 Thread Dieter Maurer via Python-list
Chris Green wrote at 2023-10-28 17:08 +0100: >I am using the python3 smbus module, but it's hard work because of the >lack of documentation. Web searches confirm that the documentation is >somewhat thin! > >If you do the obvious this is what you get:- > >>>> import smbus >>>> dir (smbus) >

Re: pip/pip3 confusion and keeping up to date

2023-11-02 Thread Dieter Maurer via Python-list
Chris Green wrote at 2023-11-2 10:58 +: > ... >So, going on from this, how do I do the equivalent of "apt update; apt >upgrade" for my globally installed pip packages? `pip list -o` will tell you for which packages there are upgrades available. `pip install -U ...` will upgrade packages. Be c

Re: pip/pip3 confusion and keeping up to date

2023-11-03 Thread Dieter Maurer via Python-list
Karsten Hilbert wrote at 2023-11-3 14:47 +0100: > ... >> Are they not available in your system's package manager? > >... this clearly often answers to "no" for applications of >any complexity. > >Is there a suggested proper path to deal with that (Debian is >of interest to me here) ? Complex appli

Re: pip/pip3 confusion and keeping up to date

2023-11-06 Thread Dieter Maurer via Python-list
Karsten Hilbert wrote at 2023-11-5 23:19 +0100: > ... >do you happen to know where to read up on how to fit a pip >constraint file into a Debian package creation workflow ? I have only rudimentary `apt` knowledge. I know it is quite flexible, e.g. it used to handle `flash` in a special way. I exp

Re: Detect naming typos (AttributeError) in function names

2023-11-06 Thread Dieter Maurer via Python-list
c.bu...@posteo.jp wrote at 2023-11-6 12:47 +: >I would like to know how to detect (e.g. via a linter) typos in function >names imported from another module. One option is a test suite (--> Python's "unittest" package) with a sufficiently high coverage (near 100 %). -- https://mail.python.org/

Re: __set_name__ equivalent for instance

2023-11-16 Thread Dieter Maurer via Python-list
Dom Grigonis wrote at 2023-11-15 18:44 +0200: >So there is a method __set_name__ which is called on class creation. > >The functionality that I am interested in is not retrieving name, but the fact >that it also receives `owner` argument. > >Thus, allowing simulation of bound class method. > >I wa

Re: __set_name__ equivalent for instance

2023-11-16 Thread Dieter Maurer via Python-list
Dom Grigonis wrote at 2023-11-16 20:12 +0200: >What I am interested in is a callback. >Preferably just after methods get bound. So in `object.__new__`. >I have done it via metaclass, but it is not ideal as there would be too much >overhead. > >I think what I am looking for is custom method bindin

Re: __set_name__ equivalent for instance

2023-11-16 Thread Dieter Maurer via Python-list
Dom Grigonis wrote at 2023-11-16 21:11 +0200: > ... >> On 16 Nov 2023, at 21:00, Dieter Maurer wrote: >> ... >> Methods are not bound during instance creation, they are bound during >> access. > >Good to know. What is the criteria for binding then? Does i

Re: Context without manager

2023-11-26 Thread Dieter Maurer via Python-list
Piergiorgio Sartor wrote at 2023-11-25 22:15 +0100: > ... >Apparently, the "with" context manager is not usable >in classes, at least not with __init__() & co. You can use `with` in classes -- with any context manager. However, you would usually not use `with` with a file you have opened in `__ini

Re: extend behaviour of assignment operator

2024-01-10 Thread Dieter Maurer via Python-list
Guenther Sohler wrote at 2024-1-9 08:14 +0100: >when i run this code > >a = cube([10,1,1]) >b = a > >i'd like to extend the behaviour of the assignment operator >a shall not only contain the cube, but the cube shall also know which >variable name it >was assigned to, lately. I'd like to use that

Re: Question about garbage collection

2024-01-15 Thread Dieter Maurer via Python-list
Frank Millman wrote at 2024-1-15 15:51 +0200: >I have read that one should not have to worry about garbage collection >in modern versions of Python - it 'just works'. There are still some isolated cases when not all objects in an unreachable cycle are destroyed (see e.g. step 2 of "https://devgui

Re: Await expressions (Posting On Python-List Prohibited)

2024-01-27 Thread Dieter Maurer via Python-list
>On 27/01/24 10:46 am, Stefan Ram wrote: >>But your explanation seems to have no mention of the "something" / >>"the awaitable object" part following the preposition "on". Shouldn't >>this awaitable object play a rôle in the explanation of what happens? You can explain a function call

RE: Extract lines from file, add to new files

2024-01-29 Thread Dieter Maurer via Python-list
Rich Shepard wrote at 2024-1-29 08:15 -0800: > ... >If this explanation is not sufficiently clear I'll re-write it. :-) Have you read "https://docs.python.org/3/library/io.html#module-io";? -- https://mail.python.org/mailman/listinfo/python-list

Re: Error in Module

2024-03-11 Thread Dieter Maurer via Python-list
Sanskar Mukeshbhai Joshi wrote at 2024-3-10 18:08 +: >I had made my project in BCA in Python. When I had complete my project and run >the program, at that time I got the error in runnig my project. The error was >ModuleNotFoundError: No module named 'flask'. `flask` is not part of the Python

Re: Popping key causes dict derived from object to revert to object

2024-03-21 Thread Dieter Maurer via Python-list
Loris Bennett wrote at 2024-3-21 10:56 +0100: > ... >So as I understand it, I need to convert the InstanceState-objects to, >say, dicts, in order to print them. However I also want to remove one >of the keys from the output and assumed I could just pop it off each >event dict, thus: > >event_d

Re: Using a background thread with asyncio/futures with flask

2024-03-22 Thread Dieter Maurer via Python-list
Thomas Nyberg wrote at 2024-3-22 11:08 +0100: > ... `future` use across thread boundaries ... > Here's an example using just the standard library that > exhibits the same issue: I think all `asyncio` objects (futures, tasks, ...) are meant to be used in a single thread. If you use them across diff

Re: Using a background thread with asyncio/futures with flask

2024-03-22 Thread Dieter Maurer via Python-list
dieter.mau...@online.de wrote at 2024-3-22 18:28 +0100: >Thomas Nyberg wrote at 2024-3-22 11:08 +0100: >> ... `future` use across thread boundaries ... >> Here's an example using just the standard library that >> exhibits the same issue: > ... >For use across thread boundaries, you likely will use

Re: how to discover what values produced an exception?

2024-05-04 Thread Dieter Maurer via Python-list
Johanne Fairchild wrote at 2024-5-3 10:56 -0300: >How to discover what values produced an exception? Or perhaps---why >doesn't the Python traceback show the values involved in the TypeError? >For instance: > >--8<>8--- (0,0) < 4 >Traceba

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-05-31 Thread Dieter Maurer via Python-list
HenHanna wrote at 2024-5-30 13:03 -0700: > >Given a text file of a novel (JoyceUlysses.txt) ... > >could someone give me a pretty fast (and simple) Python program that'd >give me a list of all words occurring exactly once? Your task can be split into several subtasks: * parse the text into words

Re: From JoyceUlysses.txt -- words occurring exactly once

2024-06-04 Thread Dieter Maurer via Python-list
Edward Teach wrote at 2024-6-3 10:47 +0100: > ... >The Gutenburg Project publishes "plain text". That's another problem, >because "plain text" means UTF-8and that means unicode...and that >means running some sort of unicode-to-ascii conversion in order to get >something like "words". A couple

Suggested python feature: allowing except in context maneger

2024-06-13 Thread Dieter Maurer via Python-list
> logging.error("File not") Are you aware that in the case of a `FileNotFoundError` no context manager is created (the context manager is the `f` in your code). Why not use: try: with open()... ... except FileNotFoundError: ... I do not think that your use case requ

Re: Difference method vs attribut = function

2024-06-30 Thread Dieter Maurer via Python-list
Ulrich Goebel wrote at 2024-6-28 18:08 +0200: >Hi, > >a class can have methods, and it can have attributes, which can hold a >function. Both is well known, of course. > >My question: Is there any difference? I think you should make the distinction "class versus instance attribute" rather than "me

Re: Printing UTF-8 mail to terminal

2024-11-01 Thread Dieter Maurer via Python-list
Loris Bennett wrote at 2024-11-1 10:10 +0100: > ... > mail.set_content(body, cte="quoted-printable") In the line above, you request the content to use the "cte" (= "Content-Transfer-Encoding") "quoted-printable" and consequently, the content is encoded with `quoted-printable`. Maybe, you do not n

Re: Correct module for site customization of path

2024-11-01 Thread Dieter Maurer via Python-list
> ... >After the recent upgrades I had to install youtube_dl with pipx for the >new python version. >When I ran the script which imported youtube_dl, I got an import error >as it appears the path to the module >was not in sys.path I see at several options: * install `youtoube_dl` where Pytho

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-11 Thread Dieter Maurer via Python-list
Loris Bennett wrote at 2024-11-11 15:05 +0100: >I have the following in my program: >try: >logging.config.fileConfig(args.config_file) >config = configparser.ConfigParser() >config.read(args.config_file) >if args.verbose: >print(f"Configuration file:

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-13 Thread Dieter Maurer via Python-list
Loris Bennett wrote at 2024-11-12 10:00 +0100: > ... >However, it strikes me as not immediately obvious that the logging file >must exist at this point. I can imagine a situation in which I want to >configure a default log file and create it if it missing. This is what happens usually: if you ope

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-12 Thread Dieter Maurer via Python-list
Cameron Simpson wrote at 2024-11-12 08:17 +1100: >On 11Nov2024 18:24, dieter.mau...@online.de wrote: >>Loris Bennett wrote at 2024-11-11 15:05 +0100: >>>I have the following in my program: >>>try: >>>logging.config.fileConfig(args.config_file) >>>config = configparser.ConfigPar

<    5   6   7   8   9   10