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
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
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
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
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.
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
<= 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
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
,
> 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
.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
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
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
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
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
he copy.
Of course, you will then profile also the "PrintStats" in the running
profiler.
Dieter
--
http://mail.python.org/mailman/listinfo/python-list
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
his would mean that locally defined functions with free
variables are very risky in generators.
--
Dieter
--
http://mail.python.org/mailman/listinfo/python-list
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
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
change -- only
that applications with lots of objects may want to consider a
reconfiguration.
--
Dieter
--
http://mail.python.org/mailman/listinfo/python-list
lots of tedious error prone delegations
to work around this limitation.
Dieter
--
http://mail.python.org/mailman/listinfo/python-list
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
r(n):
> print "[d]", n
> elif os.path.isfile(n):
> print "[f]", n
> else:
> print "[?]", n
>
> # this works
> if __name__ == "__main__":
> collectinfo(".")
>
>
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
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
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
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
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
stName,
> 'lastname': LastName}
> server.login(request)
Try: "server.login({'request':request})".
Dieter
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
es examples
to efficiently use iterators (and by inclusion generators) without
sacrificing clarity.
--
Dieter
--
http://mail.python.org/mailman/listinfo/python-list
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
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
, 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
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
"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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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)
>
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
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
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
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/
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
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
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
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
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
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
>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
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
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
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
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
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
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
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
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
> 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
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
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
> ...
>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
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:
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
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
901 - 985 of 985 matches
Mail list logo