the
reason why it does not work in CPP.
Below you can find the the part of the code which is
starting the client process.
I hope you can help me. Thank you!
Michael Lieschnegg
I took following code from a closed forum to create
the child process:
class Process:
def __init__(self, comm
[EMAIL PROTECTED] writes:
> I have a rather large python application (uses around 40MB of memory to
> start) that gradually chews up memory over many hours. I've done a
> little googling around, but it looks like I'm faced with prowling
> through the gc.get_objects() myself. I need a tool to ident
is.
>
> Well, that part's easy at least:
>
> live[::-1]
>
> :-) And so the circle is complete ...
What about reversed(live)? Or if you want a list instead of an iterator,
list(reversed(live))?
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
in more of my modules and scripts than any other third-party
module, and I know it will be very helpful when I no longer have to
worry about deploying it.
Thanks in advance,
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] writes:
> >>> what is the equivalent of C languages' goto statement in python?
>
> >> You really shouldn't use goto.
> >> Fortunately you can't.
>
> Steven> Of course you can :-)
>
> Steven> You can write your own Python interpreter, in Python, and add a
>
what the function signature for enumerate() was
when that is easy to Google, then I would think they were wasting
everyone's time.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> I've Read-TFM, but I only see good info on how to create my own class
> of exception; I don't see anything on how to override an existing
> exception handler.
You need to read the tutorial on handling exceptions:
http://docs.python.org/tut/node
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> Do people often use hash() on built-in types?
Only implicitly.
> What do you find it useful for?
Dictionaries :)
> How about on custom classes?
Same here.
> Can anyone give me some good tips or hints for writing and using
> hash functions in Pyt
just notified Jason about this. I presume a solution like mine
> will be used, and look forward to seeing Jason's module in stdlib.
This sounds like a bug in "freeze" rather than something that should be
worked around in the standard library. Although there have already been
people opposed to naming it path because the duplication with os.path
might confuse humans.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
John Machin wrote:
> [EMAIL PROTECTED] wrote:
>
>> Can someone tell me the difference between single quote and double
>> quote?
>
> >>> ord("'") - ord('"')
> 5
Very zen.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
Reinhold Birkenfeld wrote:
> Michael Hoffman wrote:
>
>>Having path descend from str/unicode is extremely useful since I can
>>then pass a path object to any function someone else wrote without
>>having to worry about whether they were checking for basestring. I think
Java hackers here want to tell us of the wonders of the Java Path
class? I would be interested in seeing how other OO languages deal with
paths.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> Michael Hoffman wrote:
>
>> John Machin wrote:
>>
>>> [EMAIL PROTECTED] wrote:
>>>
>>>> Can someone tell me the difference between single quote and double
>>>> quote?
>>>
>>> >&g
Stefan Rank wrote:
> on 22.07.2005 00:21 Michael Hoffman said the following:
>> Any Java hackers here want to tell us of the wonders of the Java Path
>> class?
>
> no such thing exists.
>
> there is only the `File` class that incorporates a little bit of the
> `p
whether they were checking for basestring. I think
there is a widely used pattern of accepting either a basestring[1] or a
file-like object as a function argument, and using isinstance() to
figure out which it is.
What do you gain from removing these methods? A smaller dir()?
[1] Probabl
that does this, but I cant remember
> where I read about it. Can anyone enlighten me?
You want a Least Recently Used, or LRU, cache. Here's one:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252524
Google for to find others.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
s a histogram):
>
> i.e.:
>
> L2 = [(1,3),(2,2),(3,1)]
>>> import itertools
>>> L1 = [1,1,1,2,2,3]
>>> L2 = [(key, len(list(group))) for key, group in itertools.groupby(L1)]
>>> L2
[(1, 3), (2, 2), (3, 1)]
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
Tzanko Tzanev wrote:
> #but there is an error in
> playlist_txt += mp3id + mp3_title + mp3_artist
It'd be a lot easier to help if you'd say what the error was.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
make people's lives easier.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
hich one it is you want.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
nder intense CPU load.
How negative are we talking about? What platforms are you using?
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
#x27;, 'fp',
> 'geturl', 'headers', 'info', 'read', 'readline', 'url']
> Traceback (most recent call last):
> File "CSVParser.py", line 144, in ?
> print parseQHost(circuits[cktname], cktname)
> File "CSVParser.py", line 126, in parseQHost
> r = csv.DictReader(ifs, fieldlist)
> File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
> python2.3/csv.py", line 100, in __init__
> self.reader = reader(f, dialect, *args)
> TypeError: argument 1 must be an iterator
>
> Whoa! Where did the __iter__, readlines, and next attributes go? Ideas?
Works for me on Python 2.4.1.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
h the current path implementation, this Just Works. If I were using
something that parsed and understood paths, the scp/rcp convention of
host:filename would either cause an error or have to be programmed in
separately. The current implementation is much more flexible.
What are the practical
tring. Mainly, that you can use it anywhere a basestring
would be used today and it Just Works.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
tion()
What do you want to be in a, if not None?
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
ile systems have something to do with the
> encoding? So D: (a FAT drive) might naturally be str, while C:
> (an NTFS drive) might naturally be unicode.
The current path module handles these situations at least as well as the
libraries that come with Python do. ;-)
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
Peter Hansen wrote:
> When files are opened through a "path" object -- e.g.
> path('name').open() -- then file.name returns the path object that was
> used to open it.
Also works if you use file(path('name')) or open(path('name')).
--
M
new users will not try to use a Path instance where a string is
> needed, just as you wouldn't try to pass a list where a string is wanted.
But many functions were written expecting lists as arguments but also
work for strings, and do not require an explicit list(mystring) before
calling the function.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
hen I informed
him of it. I'd love to hear what he had to say about the design.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
that a class implements special method names,
but doesn't make it very clear that an object can't always override them.
If you redirect to a second method you can overwrite on the instance, I
think you will get the results you want.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
line, which is convenient, but strange.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
I've observed something strange about property docstrings and I'm
wondering if anyone here can clarify what's going on: if I create a class
derived from property, the docstrings of the instances end up being that
of the derived class, not the docstring passed into the property
constructor. Examp
se methods to start with.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
nce
slicing has little to do with the newsgroup. A more general Python FAQ
will be more helpful.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
7;s a string method
with that name. Instead it's path.joinpath(). This is a nuisance, but
changing the semantics of base class methods is worse. (I know, I tried
it.) The same goes for split().
"""
It ain't broke. Please stop breaking it.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
Keith P. Boruff wrote:
> Michael Hoffman wrote:
>> Keith P. Boruff wrote:
>>> Is there an FAQ available specific to this NG as I'm sure some of the
>>> list slicing questions I have have been asked before.
>>
>> Try Google for .
>
> I tried and
al message instead of making a new post.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
or design principles and discussion here:
http://wiki.python.org/moin/PathClass
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
Reinhold Birkenfeld wrote:
> * Add base() method for converting to str/unicode.
+1
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
y and always use joinpath().
Personally, I'm -0 on __div__, but I suppose if anyone here claimed to
have used in the past, rather than it just being some novelty that might
be a good idea, that would be good enough for keeping it.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
, a quick overview about the various licenses would be nice.
Maybe biased:
http://www.gnu.org/licenses/license-list.html
Ciao, Michael.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] (Volker Grabsch) writes:
> Hi!
>
> I noticed that many packages in the PyPI are using the PSF License.
> Does this have a special reason?
Lots of people are misguided, maybe.
Anyway, you want to be reading this:
http://wiki.python.org/moin/PythonSoftwareFoundationLicenseFaq
Currently it returns Path('None'). This means I have to do a check on
input before pathifying it to make sure it is not None.
Perhaps it should throw ValueError?
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
Does anyone have any Emacs skeletons they find useful for Python? I
Googled a little but didn't find anything enticing. I already have a
script that sets up script/module templates, so those aren't all that
useful.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Michael> Does anyone have any Emacs skeletons they find useful for
> Michael> Python?
>
> What's an "Emacs skeleton"?
Somewhat of an elaborate mini-language for inserting boilerplate.
http://www.emacswiki.org/cgi-bin/emacs-en
use pdb from the commandline instead
these days, with 'alias pdb="python -m pdb"' in my .bashrc.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
ver, if it's suitable for your purposes you might want
to take a look at libdnet (http://libdnet.sourceforge.net/) which is a
library that provides access to low level networking routines.
Hope this helps,
-Michael
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> can i have my money back
Yes.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
python modules ? i can ofcourse change the name to
> 'a_simple_python_example.py', which then works.
Your question has already been answered, but I think your life (and that
of anyone trying to use your code) would probably be easier if you
switched to underscores.
--
Michael Hof
Tito wrote:
> Hi all:
>
> Is there a metalanguage capability in Python (I know there are many) to
> call a function having its name in a string?
>
> Something like:
> __call__("foo")
>
> instead of:
> foo()
locals()["foo"]() will be a littl
;ll lose
> info from x. How do I do this as a list comprehension? (Or,
> more generally, what is the best way to do this without 'map'?)
It ain't broke so I'd stick with what you're doing. Even if map() is
removed as a builtin, it will surely stick around in a m
Michael Hoffman wrote:
> David Isaac wrote:
>
>> Newbie question:
>>
>> I have been generally open to the proposal that list comprehensions
>> should replace 'map', but I ran into a need for something like
>> map(None,x,y)
>> when len(x)>
Ron Adam wrote:
> In all current cases, (that I know of), of differing types, '+' raises
> an error.
Not quite:
>>> "hello " + u"world"
u'hello world'
>>> 4.5 + 5
9.5
> Question: Is a path object mutable?
No.
This sho
Chris Fonnesbeck <[EMAIL PROTECTED]> writes:
> I thought I knew how to do error handling in python, but apparently I
> dont. I have a bunch of code to calculate statistical likelihoods, and
> use error handling to catch invalid parameters. For example, for the
[...]
> bernoulli distribution, I h
Python, could be replaced with a simple "Use optparse."
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
Robert Kern wrote:
> import this
>
> And you get 9 bonus Essential Development Practices, too! What a bargain!
One of these days I'm going to figure out how to embody "Namespaces are
one honking great idea -- let's do more of those!" Then I shall be
enlightened.
Aren't they somewhat of an obvious idea?
Several other languages have them.
Was the implementation of namespaces easy or hard to explain?
I'd love to do more honking great ideas, but I'm not even sure what the
Dutch ideal of a honking great idea is in the first place.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden <[EMAIL PROTECTED]> writes:
> If I canpoint out the obvious, the output from "import this" *is*
> headed "The Zen of Python", so clearly it isn;t intended to be
> universal in its applicability.
It's also mistitled there, given that it was originally posted as '19
Pythonic Theses' an
Find a new release of python-ldap:
http://python-ldap.sourceforge.net/
python-ldap provides an object-oriented API to access LDAP directory
servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for
that purpose. Additionally it contains modules for other LDAP-related
stuff (e.g. p
lthough you might want to start a new thread. ;)
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
Torsten Bronger wrote:
> Hallöchen!
>
> Michael Hoffman <[EMAIL PROTECTED]> writes:
>
>
>>Dark Cowherd wrote:
>>
>>
>>>GUI, Web development, Application Framework - it is shambles.
>>
>>Yeah, I agree. When I finally make that GUI appl
Jorge Godoy wrote:
> Michael Hoffman wrote:
>
>
>>He spends so much space on "Create Consistent Command-Line Interfaces,"
>>a section that, in Python, could be replaced with a simple "Use optparse."
>
>
> In Perl there's also the equ
y in python aswell ;-)
It's getting there - the recent PEP regarding the ability to cause a
generator to have an exception thrown inside it provides very similar to
Unix signals as provided via "kill", which will be nice when 2.5 is
released.
Hopefully you find the system useful,
Jorge Godoy wrote:
> Michael Hoffman wrote:
>
>
>>True, but a lot of his point *is* parsing input from the command line.
>>Consider the following points paraphrased from his article:
>>
>>* Don't mix multiple ways of specifying options. (Solved by optpars
- larger because it
naturally encourages better strutcure. (And this is after having using perl
day-in, day-out for 5 years, and still liking perl :-)
Hope that's of some use,
Michael.
--
http://mail.python.org/mailman/listinfo/python-list
an idea how can this be? Not that users will test 2
game intances communicating via localhost, but I need to make it work
properly.
--
Best Regards,
Michael Rybak mailto:[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Reinhold Birkenfeld wrote:
> It's much the same as with @ decorators. Those who have used them much
> don't object to the syntax any more.
I do and I still think they are ugly.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
o contribute to some
> projects to achieve this. But I still see that as six to nine months
> away.
I'm sure such contributions would be welcome - especially if you're
scratching an itch to help resolve the things you currently suggest as
deficiencies :-)
Regards,
Michael.
--
htt
LB> > == <
DLB> > [EMAIL PROTECTED] | Wulfraed Dennis Lee Bieber KD6MOG <
DLB> > [EMAIL PROTECTED] | Bestiaria Support Staff <
DLB> > == <
DLB> > Home Page: <http://www.dm.net/~wulfraed/><
DLB> >Overflow Page: <http://wlfraed.home.netcom.com/><
--
Best Regards,
Michael Rybak mailto:[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
le".
Why do you want to do this?
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
ferent fun project.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Actually, it's pretty easy, using the pyHook and Python win32 modules.
Well, I'll be.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
s
it is usually understood to mean globally logging keypresses, no matter
the application being presented to the user.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
he "official"
> documentation that comes with each new release.
>
> Does this idea make some sense? Or are there hidden pitfalls?
I thought the `Annotatable Python Docs`_ were a good idea but they seem
to have fallen into disuse.
.. _Annotatable Python Docs: http://pydoc.amk.ca/frame.ht
Robert Kern <[EMAIL PROTECTED]> writes:
>> The Documentation Wiki could then be used as a basis for the
>> "official" documentation that comes with each new release.
>> Does this idea make some sense? Or are there hidden pitfalls?
>
> Yes! Someone actually has to do it!
I think someone is working
"levander" <[EMAIL PROTECTED]> writes:
> Basically, I've got a bunch of questions to ask a user, the vast
> majority of which, the answer will only vary by the last few
> characters. What I'd like to do is every time the user is asked a
> question, give him the default answer as just whatever he a
"Ira" <[EMAIL PROTECTED]> writes:
> Using an embedded interpreter, how do I change it's default output
> streams (specifically the one used by PyErr_Print() which I'm
> guessing is the default error stream)?
It looks as though it writes to stderr unconditionally. But most of
the reasons for ende
[Michael Hoffman]
>>You think this is a suitable beginner project?
[Francois Pinard]
> One surely learns a lot! :-)
I can agree with that!
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
"Ira" <[EMAIL PROTECTED]> writes:
> OK let me rephrase,
>
> the standard error stream (and if I'm not mistaken also the one that
> PyErr_Print() writes to) is the python object sys.stderr. Now say I'd go
> ahead and write the following in python...
Ah, OK, I think you're mistaken, and PyErr_Print
Delaney, Timothy (Tim) wrote:
> Hey - paths are special enough to warrant additional syntax, aren't they?
I hope this is a joke :)
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
Robert Kern <[EMAIL PROTECTED]> writes:
> Michael Hudson wrote:
>> "Ira" <[EMAIL PROTECTED]> writes:
>>
>>>OK let me rephrase,
>>>
>>>the standard error stream (and if I'm not mistaken also the one that
>>>PyErr_P
ot;game" instance, is a local storage, able to render itself
while 1:
g.set_status(proxy.get_status())
g.render()
process_user_input(proxy, id)
time.sleep(0.03)
[..quit = (ESCAPE is pressed)..]
if quit: break
END###
ery helpful anyway :)
DLB> --
DLB> > == <
DLB> > [EMAIL PROTECTED] | Wulfraed Dennis Lee Bieber KD6MOG <
DLB> > [EMAIL PROTECTED] | Bestiaria Support Staff <
DLB> > == <
DLB> > Home Page: <http://www.dm.net/~wulfraed/><
DLB> >Overflow Page: <http://wlfraed.home.netcom.com/><
--
Best Regards,
Michael Rybak mailto:[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
'm a bit tired of getting
all info from debug output and exceptions
SDA> --
SDA> Steven
--
Best Regards,
Michael Rybak mailto:[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
://kamaelia.sourceforge.net/cgi-bin/blog/blog.cgi
Licensing
=
Kamaelia is released under the Mozilla tri-license scheme
(MPL1.1/GPL2.0/LGPL2.1). See http://kamaelia.sourceforge.net/Licensing.html
Best Regards,
Michael.
--
[EMAIL PROTECTED], http://kamaelia.sourceforge.net/
British
I have a client in Fort Worth, TX that needs a Python programmer for a short
project. This could be a telecommuting position. Please email me at
[EMAIL PROTECTED] if interested.
--
http://mail.python.org/mailman/listinfo/python-list
sorry for emailing privately, pressed the wrong "reply" button
DLB> On Mon, 1 Aug 2005 20:14:51 +0300, Michael Rybak <[EMAIL PROTECTED]>
DLB> declaimed the following in comp.lang.python:
>>
>> Is there a way of profiling other than manual (debug output wi
nd server tries sending this to
all clients. So my slow client simply can't know current true status,
thus has nothing to draw, because it can't handle 10 transfers per
second. And if server doesn't send user motions equal number of times
to all clients, while they compute the world's status, they will
happen to have different pictures :(
--
Best Regards,
Michael Rybak mailto:[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
sorry for emailing privately, pressed the wrong "reply" button
BD> Michael Rybak a écrit :
BD> (snip)
>>
>> Is there a way of profiling other than manual (debug output with
>> measurements and all)? Some tools?
BD> http://docs.python.org/lib/profile.html
[EMAIL PROTECTED] (phil hunt) writes:
> Suppose I'm writing an abstract superclass which will have some
> concrete subclasses. I want to signal in my code that the subclasses
> will implement certan methods. Is this a Pythonic way of doing what
> I have in mind:
>
> class Foo: # abstract superc
http://kassiopeia.juls.savba.sk/~garabik/ |
gn20kjss> | __..--^^^--..__garabik @ kassiopeia.juls.savba.sk |
gn20kjss> ---
gn20kjss> Antivirus alert: file .signature infected by signature virus.
gn20kjss> Hi! I'm a signature virus! Copy me into
[EMAIL PROTECTED] (phil hunt) writes:
>>It would (possibly) be more Pythonic to
>>define an interface instead,
>
> Does Python have the concept of an interface? When was that added?
It doesn't have one included, but there are at least two
implementations, zope.interface and PyProtocols (I'm sure
Orendorff's version is at
<http://www.jorendorff.com/articles/python/path/>.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
nd networked after creating trivial
protocol components).
A piece of eye candy is now a useful tool. It's likely to gain the
ability to send to an outbox a message saying "this blob is clicked"
meaning we can have 'WYSIWYG' GUI based construction of pipelines
easily.
It&
CS> Michael Rybak wrote:
>> That's the problem - "or a player input comes in". As I've explained,
>> this happens a dozen of times per second :(. I've even tried not
>> checking for player's input after every frame, but do it 3 times more
>
Timothy Smith wrote:
> yep the program is executed in the same dir as the pdf file. like i said
> it actually opens it, but throws up an exception as well.
You are far more likely to get informed help if you post the traceback
here, as has been suggested twice already.
--
Michael H
d to
client's send_user_action loop. Things became better, but still balls
are spinning around the mouse pointer instead of running under it.
Every time client tries moving towards the mouse, it's ball is already
at another place at server, and it runs in wrong direction.
Obviously, if I
I prefer to focus
on where we are when announcing things, rather than where we're
going (leaving that to more appropriate forums).
>>Why wouldn't you use it? When Twisted is appropriate (Twisted is a
>>more mature framework).
>
> The problem with Twisted, IME, is I
ng xrange() instead
of range() is usually a good habit. As you know, xrange() generates ints
as it is called rather than all at once, which can be quite helpful with
large ranges.
> I suggest you to feel lucky if you may use python at your work.
Every day.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
t has something to do
with units, which could be a whole number of things.
I'm thankful that logging is called logging as well, rather than log4py.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
1601 - 1700 of 4886 matches
Mail list logo