eing an
external task anyway?
I'm sure there are lots of um... issues. ;-)
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Alex Martelli) wrote:
> > One other question I did not get answered: is there any
> > simple example of a Pythonic use of __slots__ that does NOT
> > involve the creation of **many** instances.
>
> Since the only benefit of __slots__ is saving
is" which would be
short for "This object".
This may also relate to suggestions to reduce the need for having self
in the argument list of methods. So if a keyword "This" could mean this
method or function, then "Self" could mean this class. Hmmm, methods
that use "Self" in this way might run into problems, but I havn't had
enough coffee to think it though. ;-)
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
m so straight Python would be
great if I can get it working.
Thanks for any advice you can give.
--
Ron Davis
--
Ron Davis
--
http://mail.python.org/mailman/listinfo/python-list
Alex Martelli wrote:
> Ron Adam <[EMAIL PROTECTED]> wrote:
>
>> A "Current" key word would fix this. Or possibly "This" which would be
>> short for "This object".
>
> I think "This" would cause huge confusion, since in oth
'all([])' is undefined? Here, none() and all() return contradicting
values. So maybe the correct version may be...
def all(S):
if S == []: return False
for x in S:
if x return True
return False
I think a few valid actual use case examples could clear it up. What
Paul Rubin wrote:
> Ron Adam <[EMAIL PROTECTED]> writes:
>> In this view and empty set can be True for all(). Is it posible
>> 'all([])' is undefined? Here, none() and all() return contradicting
>> values. So maybe the correct version may be...
>
>
Paul Rubin wrote:
> Ron Adam <[EMAIL PROTECTED]> writes:
>> Just thinking about things. I really just want what is best for
>> Python in the long term and am not trying to be difficult.
>
> I'm sorry, maybe it's the math geek in me, but I just see all tho
()'.
if not any(bug.status == 'open' for bug in bugs_filed):
do_release()
So to give a counter example...
Where we are assembling widgets in a manufacturing plant. Where we don't
want to go to the next step until *all* the sub parts are present.
if all(part.status ==
Duncan Booth wrote:
> Ron Adam wrote:
>
>> Where we are assembling widgets in a manufacturing plant. Where we don't
>> want to go to the next step until *all* the sub parts are present.
>>
>> if all(part.status == 'present' for part in unit):
>
hasall(S, value, test=None)
hasall(S, True) # Test for actual "True" values or 1.
hasall(S, True, bool) # test for true values, not zero or False.
hasall(S, 'ok')
hasall(S, True, lambda n: n=42)
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
Ron Adam wrote:
>
> hasall(S, True, lambda n: n=42)
>
That was suppose to be:
hasall(S, True, lambda n: n==42)
--
http://mail.python.org/mailman/listinfo/python-list
invalid value when passing arguments.
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
Carl Banks wrote:
> Ron Adam wrote:
>> Carl Banks wrote:
>>
>>> In Python, yes and no are the only possible answers. Probably the only
>>> analogous thing you could do in Python would be for all() to raise
>>> ValueError when passed an empty sequen
etween dicts
> and sets.
You could just do the following...
>>> class vset(set):
... values = set.copy
...
>>> s = vset([1,2,3])
>>> s.values()
vset([1, 2, 3])
>>> for x in s.values():
... x
...
1
2
3
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
ions for a better name.
How about:
countall(S, value=True)
Considering len() is used to get a length, and countall() is related to
all(), but it's explicit about what it's counting and would not return
True on an empty set. I think it would be useful.
true_count, count = countall(S), len(S)
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
d=None):
> if d == None:
> d = {}
>
> for x in seq:
> if x in d:
> d[x] += 1
> else:
> d[x] = 1
> return d
>
>
> This neatly replaces truecount(), and you can use it for other things as
> well.
if True
comments.
>
> Ideally there should be an official tally() function in some module in
> Python, and then we can just use it and not worry about how to write it. :-)
And it's a good candidate to be written in C as well.
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
Ron Adam wrote:
> Steve R. Hastings wrote:
>> This neatly replaces truecount(), and you can use it for other things as
>> well.
>
> if True in talley(S): do_somthing()
>
> Works for me... ;-)
>
>
> Cheers,
> Ron
Actulley talley isn
t html tag. 'object' is always mapped to , 'name' is always mapped to . etc...
So I will probably have a dictionary to look them up. The problem I
have is finding a relatively painless way to do the actual translation.
Thanks in advance for any advise.
Cheers,
R
uot;size": ("li", "size"),
> }
>
> for elem in tree.getiterator():
> elem.tag, klass = MAP[elem.tag]
> if klass:
> elem.set("class", klass)
>
> print ET.tostring(tree)
Thanks a *LOT!* :-)
This is w
t
For looking at memory on windows you might be able to make improvements
to this class I wrote. I was going to add memget() methods for getting
individual items, but it wasn't as useful as I was hoping it would be
in checking my python memory use. For that I need info on individual
ta
..
name = object():
This is a bigger change than adding the create keyword, (definitely not
a pre-P3k item), and I'm not sure if it fits your use case, but it does
allow for a larger variety of types without adding additional keywords.
Cheers,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
reader)?
>
> any suggestions from this list ?
>
>
Well there's:
PEP 8 -- Style Guide for Python Code
http://www.python.org/dev/peps/pep-0008/
But I presume you already know that one. It covers doc strings some,
but not general documentation. A how-to on documenting would b
ould wrap the append and do it this way...
def eappend(e1, e2):
if e2 is None: return e1
e1.append(e2)
return e1
Then do...
e = eappend(e, get_element(obj)) # Append if not None.
But maybe there's a better way?
Ron
--
http://mail.python.org/mailman/listinfo/python-list
When you are working on your programming project on Friday night instead
of going out.
When you do go out, you look forward to getting home so you can work on
your programming project some more.
--
http://mail.python.org/mailman/listinfo/python-list
John Salerno wrote:
> Ron Adam wrote:
>> When you are working on your programming project on Friday night
>> instead of going out.
>
> Ok, you win. :)
>
> Oh wait, it's Friday night and I'm typing this message...dang it!
Yep, Hah Hah... No
Ron Adam wrote:
>
> In my program I have a lot of statements that append elements, but
> sometimes I don't want to append the element so it requres an if
> statement to check it, and that requires assigning the returned element
> from a function to a name or calli
Steven D'Aprano wrote:
> On Fri, 07 Apr 2006 16:39:40 -0700, jUrner wrote:
>
>> Maybe it was not too clear what I was trying to point out.
>>
>> I have to calculate the time time.time() requires to return the next
>> tick of the clock.
>> Should be about 0.01ms but this may differ from os to os.
>
gument (3 given)'
does someone have any pointers or tips?, thanks;
Ron
here is the code I have the problem with:
import rb
import pygtk
import gtk, gobject
pygtk.require('2.0')
class tb_button (rb.Plugin):
#
# the init thing
#
def __init__(self):
rb.Plugin.__init__
Dave Angel wrote:
Ron Croonenberg wrote:
Hello,
I am trying to write a plugin for Rhythmbox in python and run into a
'strange' problem. For a method (an action for clicking a button) I
started a method and however many arguments I use, it keeps giving me
the same error:
Dave Angel wrote:
Ron Croonenberg wrote:
Hello,
I am trying to write a plugin for Rhythmbox in python and run into a
'strange' problem. For a method (an action for clicking a button) I
started a method and however many arguments I use, it keeps giving me
the same error:
'Typ
hello,
is there a way, in python, to create a splash window and when the
program has completed disappears by sending a msg to it? (I tried
creating two gtk windows but gtk_main doesn't seem to return unless it
gets closed.)
tia
Ron
--
http://mail.python.org/mailman/listinfo/python-list
sorry about posting with the wrong subject...
*
hello,
is there a way, in python, to create a splash window and when the
program has completed disappears by sending a msg to it? (I tried
creating two gtk windows but gtk_main doesn't seem to return unless it
gets closed.)
tia
Barak, Ron would like to recall the message, "How to log messages _only once_
from all modules ?".
--
http://mail.python.org/mailman/listinfo/python-list
le
Googling and reading http://docs.python.org/library/logging.html didn't
enlighten me.
Could you suggest what should I change in the above scripts so that the log
messages would appear only once ?
Thanks,
Ron.
<><>
client.log
Description: client.log
client.py
Description: client.py
server.py
Description: server.py
--
http://mail.python.org/mailman/listinfo/python-list
le
Googling and reading http://docs.python.org/library/logging.html didn't
enlighten me.
Could you suggest what should I change in the above scripts so that the log
messages would appear only once ?
Thanks,
Ron.
server.py
Description: server.py
client.py
Description: client.py
client.log
Description: client.log
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 24, 3:45 pm, Soltys wrote:
> Barak, Ron pisze:
>
>
>
>
>
> > Hi,
>
> > I'm trying to add the logging module to my application, but I seem to be
> > missing something.
> > My application (a wxPython one) has a main script that calls variou
On Nov 24, 5:08 pm, Soltys wrote:
> Ron Barak pisze:
>
>
>
>
>
> > On Nov 24, 3:45 pm, Soltys wrote:
> >> Barak, Ron pisze:
>
> >>> Hi,
> >>> I'm trying to add the logging module to my application, but I seem to be
> >>&g
at person
is able to grasp it.
Regards,
Ron
--
http://mail.python.org/mailman/listinfo/python-list
m_ts_tool\\SVMInspector\\lib',
'C:\\WINDOWS\\system32\\python26.zip', 'c:\\Python26\\DLLs',
'c:\\Python26\\lib', 'c:\\Python26\\lib\\plat-win',
'c:\\Python26\\lib\\lib-tk', 'c:\\Python26',
'c:\\Python26\\lib\\site-packages',
'c:\\Python26\\lib\\site-packages\\wx-2.8-msw-unicode']
$
What am I doing wrong ?
Thanks,
Ron.
--
http://mail.python.org/mailman/listinfo/python-list
HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\version\PythonPath\ as
C:\Python26\Lib;C:\Python26\DLLs;C:\views\cc_view\TS_svm_ts_tool\SVMInspector\lib\;C:\Python26\Lib\lib-tk;
However, even with all the above, the SVMInspecor modules are not found.
Bye,
Ron.
From: Pablo Recio
> -Original Message-
> From: Dave Angel [mailto:da...@ieee.org]
> Sent: Tuesday, March 16, 2010 5:04 PM
> To: Barak, Ron
> Cc: Pablo Recio Quijano; python-list@python.org
> Subject: RE: How to add a library path to pythonpath ?
>
>
>
> Barak, Ron wrote:
> -Original Message-
> From: Dave Angel [mailto:da...@ieee.org]
> Sent: Tuesday, March 16, 2010 6:24 PM
> To: Barak, Ron
> Cc: Pablo Recio Quijano; python-list@python.org
> Subject: Re: How to add a library path to pythonpath ?
>
> Barak, Ron wrote:
> &
> -Original Message-
> From: Mark Hammond [mailto:skippy.hamm...@gmail.com]
> Sent: Wednesday, March 17, 2010 2:08 AM
> To: Barak, Ron
> Cc: Pablo Recio Quijano; python-list@python.org
> Subject: Re: How to add a library path to pythonpath ?
>
> On 17/03/2010 1
Barak, Ron would like to recall the message, "How to add a library path to
pythonpath ?".
--
http://mail.python.org/mailman/listinfo/python-list
e I'm doing wrong ?
Thanks,
Ron.
$ python -u xml_parse.py
node:
dom2.nodeType: 9
dom2.nodeName: #document
node is DOCUMENT_NODE:
node:
dom2.nodeType: 9
dom2.nodeName: #document
node is DOCUMENT_NODE:
('dom2._get_childNodes():', [, ])
Traceback (m
> -Original Message-
> From: Stefan Behnel [mailto:stefan...@behnel.de]
> Sent: Sunday, April 25, 2010 6:42 PM
> To: python-list@python.org
> Subject: Re: Need help with basic DOM XML tree traversing
>
> Barak, Ron, 25.04.2010 17:06:
> > This is my first
getting following error message when trying to run my setup file
...\py2exe\build_exe.py:16: DeprecationWarning: the sets module is deprecated
import sets
>Removing files in directory :./dist,keeping protedted files...
python 2.65 new install.
Any work arounds(Hacks)??
--
http://mail.pyth
Error: not well-formed (invalid token): line 6, column 34
I read the documentation for xml.etree.ElementTree and see that it may take an
optional parser parameter, but I don't know what this parser should be - to
ignore the invalid characters.
Could you suggest a way to call ElementT
> -Original Message-
> From: Stefan Behnel [mailto:stefan...@behnel.de]
> Sent: Tuesday, May 04, 2010 10:24 AM
> To: python-list@python.org
> Subject: Re: How to get xml.etree.ElementTree not bomb on
> invalid characters in XML file ?
>
> Barak, Ron, 04.05.2010
.. :)
Hm weird now I get something like:
Traceback (most recent call last):
File "./TestService.py", line 14, in
sock.connect((host,port))
File "", line 1, in connect
TypeError: an integer is required
with this code:
#!/usr/bin/python
import sys
import string
from
--
Ron Eggler
Suite# 1804
1122 Gilford St
Vancouver, BC V6G 2P5
Canada
(778) 230-9442
> On Thu, May 6, 2010 at 11:11 PM, Ron Eggler wrote:
> > On May 6, 2010 10:37:14 pm Chris Rebert wrote:
> >> On Thu, May 6, 2010 at 10:27 PM, cerr wrote:
> >> > Hi There,
> &g
non-fatal error and the application continues to run.
I googled, but did not find a way to eliminate this Debug message.
Could you suggest how to eliminate this message ?
Thanks,
Ron.
Notes:
$ python -V
Python 2.6.4
$ cat setup.py
#!/usr/bin/env python
from
am.input_file.read()
MemoryError
1. Anyone knows whet's the limitation on cStringIO.StringIO() objects ?
2. Could you suggest a better way to create a string that contains the
concatenation of several big files ?
Thanks,
Ron.
--
http://mail.python.org/mailman/listinfo/python-list
In article ,
Neil Hodgson wrote:
> milanj:
>
> > and all of them use native threads (python still use green threads ?)
>
>Python uses native threads.
But then it adds the global interpreter lock, which completely
undermines the utility of native threads. So yes, it uses native
threads,
e a way to run a pyc file without specifying the python path ?
Bye,
Ron.
--
http://mail.python.org/mailman/listinfo/python-list
> -Original Message-
> From: Dave Angel [mailto:da...@ieee.org]
> Sent: Wednesday, July 29, 2009 21:05
> To: Barak, Ron
> Cc: 'python-list@python.org'
> Subject: Re: Run pyc file without specifying python path ?
>
> Barak, Ron wrote:
> > Hi,
>
From: PythonAB [mailto:pyt...@rgbaz.eu]
Sent: Thursday, July 30, 2009 12:18
To: Barak, Ron
Cc: 'Dave Angel'; 'python-list@python.org'
Subject: Re: Run pyc file without specifying python path ?
Hi Dave,
Your solution sort of defeats my int
ious answer, I just cannot figure it out).
Bye,
Ron.
> -Original Message-
> From: Dave Angel [mailto:da...@dejaviewphoto.com]
> Sent: Thursday, July 30, 2009 16:03
> To: Barak, Ron
> Cc: 'Dave Angel'; 'python-list@python.org'
> Subject: RE: Run pyc f
> -Original Message-
> From: Dave Angel [mailto:da...@dejaviewphoto.com]
> Sent: Thursday, July 30, 2009 16:03
> To: Barak, Ron
> Cc: 'Dave Angel'; 'python-list@python.org'
> Subject: RE: Run pyc file without specifying python path ?
>
>
> -Original Message-
> From: Dave Angel [mailto:da...@dejaviewphoto.com]
> Sent: Thursday, July 30, 2009 20:08
> To: Barak, Ron
> Cc: 'python-list@python.org'
> Subject: Re: Run pyc file without specifying python path ?
>
> Barak, Ron wrote:
> > Hi
probably a way to do that from within vim or emacs)
As some suggested, as a beginner you don't need much of a super
powered IDE. If I wasn't using IDLE, I'd be using vim or gvim.
CronoCloud (Ron Rogers Jr.)
--
http://mail.python.org/mailman/listinfo/python-list
e Python tutorials:
I've got the Python version of How to Think Like a Computer
Scientist:
http://www.ibiblio.org/obp/thinkCSpy/
And Dive into Python (available online as well as paper):
http://diveintopython.org/
Hope this helps.
CronoCloud (Ron Rogers Jr.)
--
http://mail.python.org/mailman/listinfo/python-list
for a listing of books
That sort of thing.
The python.org site's been useful to me, pointing me to interesting
software, documentation and whatnot. Though I didn't know about IDLE
until I saw it mentioned in a post on Slashdot in a story asking for
recommendations for Python IDE's. I am "very" new to Python.
CronoCloud (Ron Rogers Jr.)
--
http://mail.python.org/mailman/listinfo/python-list
e os module.
>
> rpd
>
The TOPICS seem to be case sensitve so
help> assertion
would not work, but
help> ASSERTION
will.
Just figured this out myself, yesterday.
CronoCloud (Ron Rogers Jr.)
--
http://mail.python.org/mailman/listinfo/python-list
I have this line of code that's written with Linux in mind:
path_to_nethack_logfile = os.popen("locate logfile | grep
nethackdir").read()
and I'm wanting a Windows equivalent, any suestions?
Thanks.
CronoCloud (Ron Rogers Jr.)
--
http://mail.python.org/mailman/listinfo/python-list
Tim Golden wrote:
> [Ron Rogers Jr.]
>
> | I have this line of code that's written with Linux in mind:
> |
> | path_to_nethack_logfile = os.popen("locate logfile | grep
> | nethackdir").read()
> |
> | and I'm wanting a Windows equivalent, any suggg
gt; path_to_nethack_logfile = os.path.join(root, logs[0])
> exit
>
Thank you. I guess I should do more reading, since I hadn't read about
os.walk yet. I shouldn't even be trying to do what I'm doing so early in
my learning. It will eventually be
might not be in your menus though, on my box it's at:
python2.4 /usr/local/lib/python2.4/idlelib/idle.py
CronoCloud (Ron Rogers Jr.)
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
We have just published a small article on how one can initialize GHC
from Python, with only optional use of C. You can read it at
http://gamr7.com/blog/?p=65 .
Best regards,
Ron de Bruijn
--
http://mail.python.org/mailman/listinfo/python-list
Tried to open Python 3.8. I have Windows 10. Icon won’t open.
--
https://mail.python.org/mailman/listinfo/python-list
701 - 772 of 772 matches
Mail list logo