On Aug 19, 5:22 pm, [EMAIL PROTECTED] (Alex Martelli) wrote:
> Paddy <[EMAIL PROTECTED]> wrote:
>
>...
>
> > Can screen reaaderss be customized?
>
> Open-source ones surely can (e.g., NVDA is an open-source reader for
> Windows written in Python, <http:
()
>
> for k1,k2,k3,v in data:
> table[k1][k2][k3] = v
>
> for kk in sorted(table.keys()):
> print "-",kk
> for jj in sorted(table[kk].keys()):
> print " -",jj
> for ii in sorted(table[kk][jj].keys()):
> print "-",ii,table[kk][jj][ii]
>
> prints:
> - A
> - B
> - Z 1
> - C
> - X 3
> - Y 2
> - B
> - A
> - W 4
> - B
> - U 6
> - V 5
> - D
> - T 7
There is something here:
http://groups.google.com/group/comp.lang.python/msg/92502e0278c2a56e
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
'oll' in troll like the 'ol' in frolic, and pronounce roll
and role similarly.
My accent is probably from the East Midlands of the UK, but is not
pronounced.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 31, 11:19 am, Tim Golden <[EMAIL PROTECTED]> wrote:
> Tim Golden wrote:
> > Erik Max Francis wrote:
> >> Paddy wrote:
>
> >>> I say the 'oll' in troll like the 'ol' in frolic, and pronounce roll
> >>> and role similarly.
On Sep 1, 7:40 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote:
> "Paddy" wrote:
>
> > I say the 'oll' in troll like the 'ol' in frolic, and pronounce roll
> > and role similarly.
>
> Same here - when the Troll lives under
e the excellent frolic example
> He likes to Troll - rhymes with roll?
>
> - Hendrik
No difference. A troll is a troll is a troll.
:-)
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
> Get on the web: Blog, lens and tag the Internet
> Many services currently offer free registration
> --- Thank You for Reading -
Since the language that inspired the programming language is most
definitely English as spoken in the UK, could it
gt; 5 lines and creating new files until processing of all 20.000 lines is
> done.
> Is there an efficient way to do this in Python?
> In advance, thanks for your help.
If its on unix: use split.
If its your homework: show us what you have so far...
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
less enigma
> that is made terrible by our own mad attempt to interpret it as though it had
> an underlying truth."
> -- Umberto Eco
Maybe you and the CorePy guys at http://www.corepy.org/ could swap
notes and give us a similar way to work with these accellerators?
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 7, 3:50 am, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Sep 5, 5:17 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
> If this was a code golf challenge,
I'd choose the Unix split solution and be both maintainable as well as
concise :-)
- Paddy.
Just as an aside, you might find this helpful:
http://wiki.python.org/moin/PerlPhrasebook
It has perl code with python equivalents/notes.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
http://en.wikipedia.org/wiki/Sun_Grid_Engine and use JOB
ARRAYS:
http://docs.sun.com/app/docs/doc/820-0699/6nce0ht7s?l=en&a=view#i999498
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
ividual
> languages.
Hi Shawn, there is a web page that gives examples from Perl's
Datastructures Cookbook re-implemented in Python. It might be of help
for future Python projects:
http://wiki.python.org/moin/PerlPhrasebook
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks,
>
> Florian
You can also look at example 3 here:
http://en.wikipedia.org/wiki/Doctest#Example_3:_unique_words.py
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
spend too much time yourself on the laptop
with
son in lap watching Hi-5 or a Wombles video, on screen-2.
Currently Dominic and I are potty training. After that we'll start on
decorators and maybe weakref.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
that lie around.
>
> --
> Nick Craig-Wood <[EMAIL PROTECTED]> --http://www.craig-wood.com/nick
Vim will highlight the following comments too:
#FIXME
#TODO
#XXX
- Paddy
--
http://mail.python.org/mailman/listinfo/python-list
ng
one of two different vaues for an argument of zero is actually
mathematically not a bad thing to do?
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 11, 10:49 pm, "Paddy" <[EMAIL PROTECTED]> wrote:
> On Mar 11, 9:28 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote:
>
> > Dennis Lee Bieber <[EMAIL PROTECTED]> writes:
>
> > >Pardon? What is "the right thing with signed zeros&
gt; # some random ranges
>>> data = [range(random.randrange(3,7)) for x in range(4)]
>>> # but I want each range jumbled
>>> [ random.shuffle(d) for d in data]
[None, None, None, None]
>>> data
[[2, 0, 3, 1], [0, 2, 1], [3, 4, 1, 0, 2], [2, 1, 0, 3]]
>>>
(I do know how to re-write it).
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
ost a copy
so that it could be linked to?
Tim, would you object?
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 21, 8:20 pm, [EMAIL PROTECTED] (John J. Lee) wrote:
> "Paddy" <[EMAIL PROTECTED]> writes:
> > I just had a link to Tim peters first post on doctest:
> >http://groups.google.com/group/comp.lang.python/msg/1c57cfb7b3772763
> > removed fromhttp://en.wikipe
On Mar 22, 4:56 am, [EMAIL PROTECTED] (Alex Martelli) wrote:
> Paddy <[EMAIL PROTECTED]> wrote:
>
>...
>
> > I have found that I have gone too far when I used listcomps for their
> > sideeffects rather than wanting the list produced, for example the
>
> I a
On Mar 21, 8:39 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> "Paddy" <[EMAIL PROTECTED]> writes:
> > I just had a link to Tim peters first post on doctest:
> >http://groups.google.com/group/comp.lang.python/msg/1c57cfb7b3772763
> > removed fr
On Mar 21, 10:31 pm, [EMAIL PROTECTED] (Cameron Laird) wrote:
> In article <[EMAIL PROTECTED]>,
>
>
>
> Paddy <[EMAIL PROTECTED]> wrote:
> >On Mar 21, 8:20 pm, [EMAIL PROTECTED] (John J. Lee) wrote:
> >> "Paddy" <[EMAIL PROTECTED]> wr
'value2',
'key3': 'value3',
'key4': 'value4',
'key5': 'value5',
'key6': 'value6',
'key7': 'value7',
'key8': 'value8'}
>>> pp(matrices)
{'key4': [['spec11', 'spec12', 'spec13', 'spec14'],
['spec21', 'spec22', 'spec23', 'spec24'],
['spec31', 'spec32', 'spec33', 'spec34']],
'key7': [['more11', 'more12', 'more13'], ['more21', 'more22',
'more23']]}
>>>
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
operator
>>> foo = ["spam", "eggs", "spam", "spam", "spam", "beans", "eggs"]
>>> count = {}
>>> for item in foo: count[item] = count.get(item, 0) +1
...
>>> maxitem = max(count.items(), key= operator.itemgetter(1))
>>> maxitem
('spam', 4)
>>>
I was trying to minimise the iterations through the list.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
llowing:
>>> s1 = '[EMAIL PROTECTED]'
>>> s2 = '<[EMAIL PROTECTED]>'
>>> matchobj = re.search(r'<(?P[EMAIL PROTECTED])>|(?P[EMAIL
>>> PROTECTED])', s1)
>>> matchobj.groupdict()['email1'] or matchobj.groupdi
"spam", "spam", "beans", "eggs"]
> >>> max(foo, key=foo.count)
>
> 'spam'
>
> Alex
This doesn't call foo.count for duplicate entries by keeping a cache
>>> foo = ["spam", "eggs", "spam", "spam", "spam", "beans", "eggs"]
>>> def cachecount(x, cache={}):
... return cache.setdefault(x, foo.count(x))
...
>>> max(foo, key=cachecount)
'spam'
>>> cachecount.func_defaults
({'eggs': 2, 'beans': 1, 'spam': 4},)
>>>
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 30, 2:58 am, [EMAIL PROTECTED] (Alex Martelli) wrote:
> Paddy <[EMAIL PROTECTED]> wrote:
>
>...
>
>
>
> > > A bit more directly:
>
> > > >>> foo = ["spam", "eggs", "spam", "spam", "spam&
;s call
> it - academic experiment, but also something very close to beeing usefull
> at the level of the current CPython.
>
> --
> damjan
It is also European funding for an open source project with sprints.
I'm sure some eurocrat will be dissecting the project to see if it is
aa good way to fund technical projects.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 30, 1:44 pm, "aspineux" <[EMAIL PROTECTED]> wrote:
> On 30 mar, 00:13, "Paddy" <[EMAIL PROTECTED]> wrote:
>
> > On Mar 29, 3:22 pm, "aspineux" <[EMAIL PROTECTED]> wrote:
>
> > > I want to parse
>
> > >
On Mar 30, 10:17 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Thu, 29 Mar 2007 19:44:56 -0300, Paddy <[EMAIL PROTECTED]>
> escribió:
>
> > On Mar 29, 8:49 am, [EMAIL PROTECTED] (Alex Martelli) wrote:
> >> >>> foo = ["spam&quo
OOffice can save sheets in Sylk format which gives you a simple
textual format for cells, including the equations. Can't think
of any easier way with the macros other than hard slog!
P.S. It is well to remember that the UK Tax department have a
very low opinion of the quality of spreadsheets so if you find
oddities remember to query them.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 5, 5:51 pm, John Nagle <[EMAIL PROTECTED]> wrote:
> Nate Finch wrote:
> > I think you're all going about this the wrong way. There's no reason
> > to *always* have one class per file. However, there's also no reason
> > to have 1600 lines of code and 50 classes in one file either.
>
>
tent scope rules for
listexps and genexps. Isn't it coming in 3.0?
If it is, then maybe it will be back-ported to
Python 2.6.
In Python 2.5 we have the following:
>>> [k for k in (j for j in range(5))]
[0, 1, 2, 3, 4]
>>> k
4
>>> j
Traceback (most recent call last):
File "", line 1, in
NameError: name 'j' is not defined
>>>
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 11, 6:18 am, Fernando Perez <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> The IPython team is happy to release version 0.8.0, with a lot of new
> enhancements, as well as many bug fixes.
>
> We hope you all enjoy it, and please report any problems as usual.
>
> WHAT is IPython?
>
re leave out the shebang/not set the
execute bit to emphasise your intended use.
During development however, intended use may differ from use when
deployed.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
sts.append( [ #", i
for tpl in l:
print " ", tpl, ","
print " ]) #", i
You would then have your data saved in a format that could easily
be re-used by other programs at a later date, and that can be
examined in any text editor.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
ipe/502199
You could then write something like:
import string
for thiscomb in comb2( *([string.lowercase]*26) ):
...
Mind you, it generates a lot of combinations.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
do some
> > development work on Linux and the distro I am using is Xubuntu.
>
> Everybody uses vim.
Vim!
(Oh great its been seconds since the last editor war).
- Paddy ;-),
--
http://mail.python.org/mailman/listinfo/python-list
http://www.python.org/doc/faq/programming.html#is-there-a-tool-to-help-find-bugs-or-perform-static-analysis
PyChecker and Pylint might help you.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
lver Surfer.
Edison.
Max Planck
Notepad user:
G.W. Bush.
See, it's clear!
- Paddy ;-)
--
http://mail.python.org/mailman/listinfo/python-list
s in Python.
http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html
The author has done a bit:
http://en.wikipedia.org/wiki/Dijkstra
Having more than one index start point would be a maintenance
nightmare best avoided. (It can be done in Perl).
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 14, 8:55 pm, Sherm Pendley <[EMAIL PROTECTED]> wrote:
> "Paddy" <[EMAIL PROTECTED]> writes:
> > Having more than one index start point would be a maintenance
> > nightmare best avoided.
>
> Quite right.
>
> > (It can be done in Perl).
>
On Apr 15, 2:29 am, [EMAIL PROTECTED] (Alex Martelli) wrote:
> Sherm Pendley <[EMAIL PROTECTED]> wrote:
> > "Paddy" <[EMAIL PROTECTED]> writes:
>
> > > I don't think we should add it to Python
> > > because it would make porting VB code
:
> > if the function modifies the object (e.g. by appending an item to a
> > list), the default value is in effect modified.
>
> This comes up so often that I wonder whether Python should issue a warning
> when it sees [] or {} as a default argument.
>
> What d
e a fair way through the Python
tutorial though before you attempt thhem so you
know the basics of Python first.
On a different tack, from:
http://tickletux.wordpress.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/
It seems you need to learn how to write a Fizz-Buzz
program to get
On Apr 15, 9:33 am, "Daniel Gee" <[EMAIL PROTECTED]> wrote:
> In Linux I just use Gedit. In windows I settle for Notepad2. With
> python having help built into the interpreter, anything more than line
> numbering, simple syntax highlighting, and auto-indent when you hit
> enter just doesn't seem ne
p://www.texytipografia.com
Hi Javier,
You seem to have missed out array *indexing*
in your argument, or is array indexing obsolete?
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
he
position you want to copy the text to.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
= "|".join( r"(?P<__match_%i__>%s)" % (i, r)
for i,r in enumerate(regexps) )
now if one of the regexps matches then the corresponding named
group should have a non-empty string value.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
also use count rather than the explicit loop to
get something like:
def multiremberandco1(el, seq, fun):
l1, l2 = [], []
c = seq.count(e1)
l1 = [el] * c
l2 = [el] * (len(seq) - c)
return fun(l1, l2)
I don't have the book so can't comment on its suitability,
but there you go.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 17, 9:17 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> Paddy schrieb:
>
>
>
> > On Apr 16, 10:50 am, Thomas Dybdahl Ahle <[EMAIL PROTECTED]> wrote:
> >> Hi, I'm writing a program with a large data stream to which modules can
>
.. def __getitem__(self, i):
> ... try:
> ... return [list.__getitem__(self, j) for j in i]
> ... except TypeError:
> ... return list.__getitem__(self, i)
> ...
> py> b = Bob(xrange(15, 30))
> py> b[3, 5, 7, 13]
> [18, 20, 22, 28]
>
> James
And the ellipses ... ?
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
string object needed by
re.search?
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 15, 2:57 am, James Stroud <[EMAIL PROTECTED]> wrote:
> Paddy wrote:
> > Lets say i have a generator running that generates successive
> > characters of a 'string'
> >>From what I know, if I want to do a regexp search for a pattern of
> >
On Sep 15, 12:29 am, James Stroud <[EMAIL PROTECTED]> wrote:
> Paddy wrote:
> > And the ellipses ... ?
>
> ;)
>
> py> class Bob(dict):
> ... def __getitem__(self, k, *args, **kwargs):
> ... if k is Ellipsis:
> ... return sorted(self.keys())
On Sep 14, 9:49 pm, Paddy <[EMAIL PROTECTED]> wrote:
> Lets say i have a generator running that generates successive
> characters of a 'string'>From what I know, if I want to do a regexp search
> for a pattern of
>
> characters then I would have to
On Sep 15, 2:07 pm, John Machin <[EMAIL PROTECTED]> wrote:
> On Sep 15, 10:56 pm, Paddy <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Sep 14, 9:49 pm, Paddy <[EMAIL PROTECTED]> wrote:
>
> > > Lets say i have a generator running that generates successive
> > at the beginning of the body of assigner.
>
> This worked, thanks a lot :)
>
> --
> Stefano Esposito <[EMAIL PROTECTED]>
I got this explained to me awhile back and blogged on it here:
http://paddy3118.blogspot.com/2006/07/python-functions-assignments-and-scope.html
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
I got tired of Bloggers inadequate comment editor so wrote this for
transforming code snippets:
=
'''
blogspace.py
Turns leading spaces into HTML tokens which shows
as correct indentation on Blogger comment fields
(and maybe other blogs).
Donald. '
ke a mathematical set.
>
> This is written as:
>
> a = set([1, 2, 3, frozenset([1, 2])])
>
> > This is not related, but is there i neat way (without pop and list
> > comprehension) to convert a set into a list?
>
> list(a)
>
> Raymond
frozenset over turning the em
is "Alessandro" (which
> no American is ever going to be able to spell right -- ONE L, TWO S's,
> NOT an X or a J instead, "DRO" ending rather than "DER", etc), might
> choose to avoid the hassle and go by "Alex" (just to make up a case...).
>
>
rogrammer a big problem hence the limitation.
I don't think you have a better solution.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
mplementation and you will find it is impractical. Checking
for mutability then doing deep copies of keys and would consume time
in something that greatly affects the speed of Python as a whole.
Pythons designers give *you* the option of doing this and leave the
underlying dict speedy. I can live wi
rgent now.
>
> Thanks,
> prajwala
XML to XHTML via XSLT ?
- loads of X's but I'd slip Python and elementtree in there somewhere.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
Sorry Carl,
I think *you* may not have much need for bitwise operators but others,
including myself do. No matter what the usage found, I would think
replacing bitwise operators by function calls a retrograde step.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 22, 8:29 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
> On Sat, 22 Sep 2007 14:50:12 +0000, Paddy wrote:
> > Sorry Carl,
> > I think *you* may not have much need for bitwise operators but others,
> > including myself do. No matter what the usage found, I would
python 2.5.1.
>
> Thanks!
If it was machine formatted, regular XML, on a unix box then I'd use
sed:
sed -e 's/value="9997"/value="zzz"/g;s/value="9998"/value="ZZZ"/g' \
infile > outfile
It would work for what you said, but
.
>
The magic googling phrase is:
Python bean-editor
Which gave http://home.gna.org/oomadness/en/editobj/index.html
I've never used it. Could you tell me how you get on?
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
know if I can extend a copy of it to do that.
>
> Mike
You could use a professional Job scheduling system such as LSF or Suns
Grid Engine that both support job dependencies (and a whole lot more).
For example, search for 'Job Dependencies' on this page:
http://docs.sun.com/app/docs/doc/820-0699/6nce0ht7s?a=view
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 16, 8:29 pm, Paul Miller <[EMAIL PROTECTED]> wrote:
> I'm looking at doing some currency calculations in some Python code
> integrated with a C++ application. I want to be able to come up with the
> same values I get in an Excel spreadsheet.
Ouch! do really want to come up with the Excel re
>
>story stargaming, I caught it first this time !-)
Shouldn't that be s-o-r-r-y :-)
> <*ot>
--
http://mail.python.org/mailman/listinfo/python-list
gt; be complete in 2-3 months by 2-3 person group.
> May be something useful for open source or python community ...
> Well, just post what you think could be appropriate ...
Is their anything left over from the last Google summer of code Python
suggestions?
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 24, 7:25 pm, Daniel Folkes <[EMAIL PROTECTED]> wrote:
> I am new to using Vim's scripts.
>
> I was wondering if anyone uses Vim-Python and how to use it? This
> includes things like key bindings and such.
>
> Thanks in advance,
> Daniel Folkes
> [EMAIL PROTECTED]
You asked at the right ti
industry was in some ways ahead of
other industries in adopting TCL as its major scripting language but
because of this I think it might now be suffering because, as capable
as TCL is, current EDA tools would benefit from reflecting what is
increasingly an object oriented compiled language core, as Python
objects for user manipulation.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
7, 'y':10}}
> and so forth?
>
> Any link or snippet is appreciated.
>
> TIA
> Christian
from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/502199
import comb2
# (I wish)!
for xa,ya,xb,yb in comb2([1,2,3], [4,5,6], [7,8,9], [10,11,12]):
print {'a': {'x': xa, 'y': ya},
'b': {'x': xb, 'y': yb}}
Should work although untested.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
ows them to write a testbench in e and use AOP to extend it to
create
different testcases.
Just found a version of the LRM online (search for 'extend'):
http://www.ieee1647.org/downloads/prelim_e_lrm.pdf
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
makes
> it fairly inconvenient to use. I guess another idea might be to
> allow user to provide a "no peek" return value in the
> constructor, if they so wish.
>
> --
> Neil Cerutti
You could raise a different Exception, PeekPastEndEception ?
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
comprehensions?
>>> a = (1, 2, 3, 4)
>>> b = (4, 3, 2, 1)
>>> import operator
>>> c = map(operator.add, a, b)
>>> c
[5, 5, 5, 5]
>>> c1 = [a1+b1 for a1,b1 in zip(a,b)]
>>> c1
[5, 5, 5, 5]
>>>
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
s
zero print some message and continue, then you would most likely do
something like:
x = 1
y = 0
try:
z = x / y
except ZeroDivisionError:
print "This leads to a divide by zero error!"
There is more info in the tutorial chapter 8.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
ll somebody please tell me if there are any python like shells
> > for linux?
>
> IPython is actually more than a simple shell. Give it a try:
> http://ipython.scipy.org/.
>
> George
Frank,
IPython is great, but it is not a replacement for a shell like bash. If
you have a Linux
matically keep the use cases
up-to-date.
http://en.wikipedia.org/wiki/Doctest
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
helps
> me focus my efforts.
>
> -carl
Three to four months before `strange errors`? I'd spend some time
correlating logs; not just for your program, but for everything running
on the server. Then I'd expect to cut my losses and arrange to safely
re-start the program every TWO months.
(I'd arrange the re-start after collecting logs but before their
analysis.
Life is too short).
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 25, 9:26 am, [EMAIL PROTECTED] (Nick Maclaren) wrote:
> In article <[EMAIL PROTECTED]>,"Paddy" <[EMAIL PROTECTED]> writes:|>
> |> Three to four months before `strange errors`? I'd spend some time
> |> correlating logs; not just for your pr
On Jan 25, 7:36 pm, [EMAIL PROTECTED] (Nick Maclaren) wrote:
> In article <[EMAIL PROTECTED]>,"Paddy" <[EMAIL PROTECTED]> writes:|>
> |> > |> Three to four months before `strange errors`? I'd spend some time
> |> > |> correlating logs;
On Jan 25, 8:00 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> "Paddy" <[EMAIL PROTECTED]> writes:
> > No, you should think of the service that needs to be up. You seem to be
> > talking about how it can't be fixed rather than looking for ways to
>
On 26 Jan, 09:05, [EMAIL PROTECTED] (Nick Maclaren) wrote:
> In article <[EMAIL PROTECTED]>,[EMAIL PROTECTED] writes:|>
> |> What makes you think Paddy indicated he wouldn't try to solve the problem?
> |> Here's what he wrote:
> |>
> |> What I&
ion both easy, and able
>to spot errors in text data?
>
> Last, but not least: is there a python lib implementing at least part
> of this dream?
Google for YAML and JSON formats too.
http://www.yaml.org/
http://www.json.org/
-Paddy
--
http://mail.python.org/mailman/listinfo/python-list
etion of an object even
> if it is in use. This is a Good Thing.
>
> --
> Steven D'Aprano
The folowing will make the data available for garbage collection no
matter what references it:
>>> l = ["data"] *10
>>> l
['data', 'data', 'data', 'data', 'data', 'data', 'data', 'data',
'data', 'data']
>>> l2 = l
>>> l[:] = []
>>> l2
[]
>>>
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
'res2:', res
>
> if __name__ == '__main__':
>main()
>
> Result:
> [Dbg]>>>
> res1: pqrs
> res2: abcdefjklpqrs
But to give them credit though, in Whats new in Python 2.5: PEP 308,
they do mention that as a matter of style you should parenthesise the
if-expression, and the example given consistes of just a simple
assignment of the if-expr to a name.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 31, 7:34 am, Steven D'Aprano <[EMAIL PROTECTED]>
wrote:
> On Tue, 30 Jan 2007 23:22:52 -0800, Paddy wrote:
> >> As far as I know there is no way to force the deletion of an object
> >> even if it is in use. This is a Good Thing.
>
> >> --
>
, 0, 1
>
> You may want to use sorted(iterable, cmp=None, key=None, reverse=False)
> if you don't want to sort in-place.
>
> Also, using comparison functions is usually not the most efficient way
> to do such a sort. In your case, I'd go for a good old
> Decora
On Feb 1, 1:45 am, Steven D'Aprano <[EMAIL PROTECTED]>
wrote:
> On Wed, 31 Jan 2007 09:26:46 -0800, Paddy wrote:
> > On Jan 31, 7:34 am, Steven D'Aprano <[EMAIL PROTECTED]>
> > wrote:
>
> [snip]
>
> >> --
> >> Steven D'Aprano
&g
a minus or division operator in sight ;-)
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
: python
Python 2.5 (r25:51908, Nov 28 2006, 16:10:01)
[GCC 3.4.3 (TWW)] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> from pprint import pprint as pp
>>> from collections import defaultdict
>>> data = [['a', '13'], ['a', '3'], ['b', '6'], ['c', '12'], ['c', '15'],
>>> ['c', '4'], ['d', '2'], ['e', '11'], ['e', '5'], ['e', '16'], ['e', '7']]
>>> d = defaultdict(list)
>>> _ = [d[x0].append(x1) for x0,x1 in data]
>>> pp(d)
defaultdict(, {'a': ['13', '3'], 'c': ['12', '15', '4'],
'b': ['6'], 'e': ['11', '5', '16', '7'], 'd': ['2']})
>>> pp(sorted(d.items()))
[('a', ['13', '3']),
('b', ['6']),
('c', ['12', '15', '4']),
('d', ['2']),
('e', ['11', '5', '16', '7'])]
>>>
- Paddy
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 2, 2:39 pm, "Paddy" <[EMAIL PROTECTED]> wrote:
> On Feb 2, 1:55 pm, "ardief" <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi everyone
> > Here is my problem:
> > I have a list that looks like this -
> > [['a', '13
On Feb 2, 10:34 pm, [EMAIL PROTECTED] wrote:
> Paddy:
>
> >>> _ = [d[x0].append(x1) for x0,x1 in data]
Yep, definitely a case of overdoing the list comprehensions when you
throw away the list.
I'll watch out for that in the future,
Ta.
- Paddy.
>
> I think that yo
http://www.ferg.org/projects/python_java_side-by-side.html
http://dirtsimple.org/2004/12/python-is-not-java.html
Happy coding - Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
,
when the file is normally imported as a module.
> and what is
> __name__
> __main__
>
> use for in terms of Java?
>
With respect, (hehe), maybe you need to indicate that you've searched
the Python documentation on __name__ and __main__?
(Hah! I did that without saying R
301 - 400 of 675 matches
Mail list logo