back?
>
> I know I can do something very ugly -- call a C method that calls a new
> python interpreter but that seems VERY ugly.
>
> Help?
>
> Thanks.
You might try ipython at http://ipython.scipy.org/moin/; or 'python -
i'; or the exec and eval statements.
There is
On Apr 15, 6:35 am, Evan <[EMAIL PROTECTED]> wrote:
> that's great, a custom shell is what I need.
>
> Thanks all
> Evan
And for the quick-n-dirty there is:
python -i yourscript.py
Which runs your script then drops you into the interpreter.
- Paddy.
--
http://mail.pyth
y rejected by users on those grounds
> alone.
> """
>
THe above is applied slavishly by those who value machine time over
peoples time. Do you want to work with them?
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
27;t see the problem, but who has written about
it).
Thanks, Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On May 9, 6:30 pm, Paddy <[EMAIL PROTECTED]> wrote:
> Hi,
> The wikipedia article on Duck Typing has this criticism section that
> needs a citation:
> (Fron:http://en.wikipedia.org/wiki/Duck_typing#Criticism)
>
> An often cited criticism is this:
> One issue with du
p
>>> for x,y,z in izip(obj1, obj2, obj3):
...print x,y,z
...
C a t
S u m
M e n
>>> for i,x in enumerate(obj1):
...print x, obj2[i], obj3[i]
...
C a t
S u m
M e n
>>> for i in range(len(obj1)):
...print obj1[i], obj2[i], obj3[i]
...
C a t
S u m
ood, as they don't seem to preserve line
> breaks
> properly or append the .py extension, etc. I've Googled for this and
> so far
> it seems it doesn't exist. Anyone know?
Take a look at the crunchy project: http://crunchy.sourceforge.net/
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
our titles a little more descriptive to help
people filter/search on them.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
Just wondered if this:
http://arstechnica.com/news.ars/post/20080822-firefox-to-get-massive-javascript-performance-boost.html,
is a new name for what is done by Psyco?
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
fying parameter (a) with a default value may have unexpected
> consequences
>
> Though it might be interesting to ask a newbie what he expects when warned
> of "unexpected consequences" ;)
>
> Peter
+1 on this.
It seems an obvious think to add to a lint-like tool rather than
burdening core Python.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
ve been known to construct multi-line -c arguments using
the bash shell on Unix (as bash supports multi-line quotes),
but creating and then deleting a temporary file saves me from
'quoting hell'.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
-soft/linux/ActivePython-2.5.1.1-linux-x86_64/
lib/pyth=
on2.5/ctypes/__init__.py", line 340, in __init__
self._handle =3D _dlopen(self._name, mode)
OSError: /opt/questasim_6.4/questasim/linux/libucdb.so: cannot open
shared o=
bject file: No such file or directory
>>> ^[[A
File "", line 1
^
SyntaxError: invalid syntax
>>>
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
e trees are widely used? Got any references for that?
>
>
I too feel that if Perl had such optimizations as Psyco gives Python
then they would shout about it.
I wonder about the new term and if it fits in the same 'box' as what
Psyco does, for example, who was aware of whose work?
-
the concept.
> #
>
> Regards
Try and pre-filter your file on a line basis to cut it down , then
apply a further filter on the result.
For example, if you were looking for consecutive SPAM records with the
same Name field then you might first extract only the SPAM records
from the gi
On Aug 23, 2:33 pm, Paddy <[EMAIL PROTECTED]> wrote:
> Hi,
> I am am falling at the first hurdle when trying to access a library
> using ctypes.
>
> I have a file libucdb.so which the file command says is shared object,
> but I cannot get it to load:
>
>
I wonder where the problem lies?
(For the Table, please see the blog entry).
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
already given by others,
readabiity!
Cheers, Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
Spread the love - tell your Java freinds :-)
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Anyone know of something that can turn an interactive bash or tcsh
session into a test the
way doctest does?
- Cheers, Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
BWill wrote:
> and ixnay on the ubyray or else I'll tell you where to stick your
> endblock delimiter :P
Umm,
Did you mean to write the above?
What has it to do with Ruby?
--
http://mail.python.org/mailman/listinfo/python-list
that there before me was
most of my tests! If only their was doctest for tcsh, I could tell the
tool what my prompt strings were, cut-n-paste my shell session, and
Bobs yer uncle!
I guess doctest-alikes could be created for a lot of shell type
interfaces with distinct prompts.
- Paddy.
--
http
What was the speed-up ?
--
http://mail.python.org/mailman/listinfo/python-list
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
t hand for
the odd keystroke.
I would however prefer the numeric pad on the left.
- Paddy.
--
http://paddy3118.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
Hmm,
Do you know about JSON and YAML?
http://en.wikipedia.org/wiki/JSON
http://en.wikipedia.org/wiki/YAML
They have the advantage of being maintained by a group of people and
being available for a number of languages. (as well as NOT being XML
:-)
- Cheers, Paddy.
--
http://paddy3118
n the day of this
posting.
- Paddy
--
http://paddy3118.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
I just Googled and found the Python-Dev thread 'About "Coverity Study
Ranks LAMP Code Quality" '. I was heartened by the type of issues
raised in the discussion - it leaves me content with whats
'under-the-hood' in Python.
You maintainers don't seem to bang your own drum, which is a good
thing, bu
erl, which helped me remember.
I used the Well House manual and the Camel book for reference.
(http://www.wellho.net/ - Tell Graham Paddy sent you).
P.S. I don't have any connection to Well House, apart from learning
Perl through them.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
In the style of the Pepsi 'Lip smakin' add of the 70's...
In-dentin
easy-readin
object-orientin
motivatin
good buzzin
literate programmin'
abstractin
fast runnin
ever givin
dynamic
PYTHON!
- I know, too much free time can be harmful ;-)
- Pad.
--
http://mail.python.org/ma
Don't know if there is a way to call perl from Python but the perl
inline python module allows you to call perl from python from within an
outer perl interpreter.
Thts what I make of the following anyway:
http://aspn.activestate.com/ASPN/CodeDoc/Inline-Python/Python.html
- Paddy.
--
There is also:PyPerl at:
http://search.cpan.org/dist/pyperl/perlmodule.pod
But you need to check if it is current.
- Pad.
--
http://mail.python.org/mailman/listinfo/python-list
What do you want to search for in the file?
how big is the file?
What format is the data in the file?
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
LoL :-)
--
http://mail.python.org/mailman/listinfo/python-list
ion gave
the following.
>>> import re
>>> s ="aMNHiRFLoDLFb"
>>> re.findall(r'[A-Z]{3}([a-z])(?=[A-Z]{3})', s)
['i', 'o']
>>>
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
to parameters:
class C2(object):
def __init__(self, x=None, y=None, s=""):
pass
C2 can be initialised with any one, two, three, or zero arguments;
those not given would take the default values shown to the right of the
equals sign above.
- Cheers, Paddy.
--
Signs of spring here i
I wonder if the resulting code would look like Python.
It seems a great way to unify how things are defined, but I would not
want to mix the syntax with the current style.
- Pad.
--
http://mail.python.org/mailman/listinfo/python-list
I wondered at the tone of some of the replies, re-read the repliess and
your original message. On first readings ithought that your original
message was OK and that the replies were a bit 'strong' . On second
reading I thought that the original could be interpreted a little less
nicely, but I had t
Hi,
I saw you mentioned gnuplot and did a search on Google of 'gnuplot
python-wrapper' which
lead me eventually to:
http://gnuplot-py.sourceforge.net/
I have not tried it, but if you would try it and report back if it
works that might help someone
else too.
- Cheerio, Paddy.
t(shutil.copy, 'src2.txt', 'dest2.txt')
e.submit(shutil.copy, 'src3.txt', 'dest3.txt')
e.submit(shutil.copy, 'src3.txt', 'dest4.txt')
Should the last line show a copy of src4.txt rather than src3.txt
going to dest4.txt?
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
My thanks.
--
http://mail.python.org/mailman/listinfo/python-list
>>> (b - c)
Counter({'b': 1})
>>> (c - b)
Counter({'a': 2})
>>> diff
Counter({'a': 2, 'b': 1})
But thought why doesn't this operation appear already as a method of
the class?
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 13, 6:36 am, Steven D'Aprano wrote:
> On Thu, 12 Aug 2010 13:20:19 -0700, Paddy wrote:
> > I find myself needing to calculate the difference between two Counters
> > or multisets or bags.
>
> Is this collections.Counter from Python 3.1? If so, you should say so
On 14 Aug, 18:14, Raymond Hettinger wrote:
> On Aug 12, 1:20 pm, Paddy wrote:
>
> > I find myself needing to calculate the difference between two Counters
> > or multisets or bags.
>
> > I want those items that are unique to each bag.
>
> Tell us about your use
On 17 Aug, 02:29, Raymond Hettinger wrote:
> [Paddy]
>
> > Lets say you have two *sets* of integers representing two near-copies
> > of some system, then a measure of their difference could be calculated
> > as:
>
> > len(X.symmetric_difference(Y)) / (len(X) +
On Aug 17, 10:47 pm, Paddy wrote:
> On 17 Aug, 02:29, Raymond Hettinger wrote:
>
>
>
> > [Paddy]
>
> > > Lets say you have two *sets* of integers representing two near-copies
> > > of some system, then a measure of their difference could be calculated
>
On Aug 17, 2:29 am, Raymond Hettinger wrote:
> I would like to see someone post a subclass to the ASPN Cookbook that
> adds a number of interesting, though not common operations. Your
> symmetric_difference() method could be one. A dot_product() operation
> could be another. Elementwise arithm
ht forward; or could do with an example translated to Python 3.x
if it would change a lot from 2.x etc.
Please take a look, I know I know I enjoy being involved.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
be a more intelligent way, maybe type
inferencing? But no, please, nothing like the above, it would just get
in the way.
-- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
t you want.
I often find that some simpler tools do 95% of the work and it is easier
to treat the other five percent as broken-input.
try http://ctags.sourceforge.net/
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
Jeff Epler wrote:
No.
Unlike Perl, Python implements only a *finite turning machine* model of
computation. An easy way to see this limitation is in the following
code:
>>> 1.0 / 10.0
0.10001
<>
Jeff
Nice,
Made my evening :-)
- Pad.
--
http://mail.python.org/mailman/listinfo/pyt
ithout referencing
# globals x and y as they are artificial in that I will start of with
# probably a list of lambda equations.
Your help would be appreciated.
Thanks, Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
nd sets and all) in python.
Paddy
2009/2/17 Linuxguy123 :
> How do I do this in Python ?
>
> #
> declare A,B
>
> function getA
>return A
>
> function getB
>return B
>
> function setA(value)
> A = value
>
> functio
ialised in the module.
Of course, if you try to call that function before the global has been
initialised, python will complain [and rightly so :)]
Paddy
--
"Ray, when someone asks you if you're a god, you say YES!"
--
http://mail.python.org/mailman/listinfo/python-list
g python's own casting rules (given that you are
trying to emulate the way python behaves? Or, alternatively, using a
regular expression (as Nick Craig-Wood did).
Given these solutions, type-conversion and catching the ValueError
appears, to me, to be correct, the most concise, and the most r
2009/2/20 Bruno Desthuilliers :
> Note that while you *can* do direct access to the implementation attribute
> (here, '_A' for property 'A'), you don't *need* to so (and usually shouldn't
> - unless you have a very compelling reason).
Interesting. Why shouldn't you?
I haven't used the property() f
eal, for it to
described as anything like a "GoldenRule" or to advise against its
overuse.
You use it when its appropriate and don't use it when you it's not,
like any other feature.
Paddy
--
"Ray, when someone asks you if you're a god, you say YES!"
--
http://mail.python.org/mailman/listinfo/python-list
To do so would be over-generalising and not useful to discussion
I guess it's your pedantry that I'm questioning.
Something like "don't use goto's" works as a GoldenRule because it's
been observed that without it, people start using goto statements in
places where it's not really appropriate.
When you said that "[you] usually shouldn't [use properties] - unless
you have a very compelling reason", your tone implied that properties
are easy to misuse and tend to be.
Not being familiar with properties and seeing them as being pretty
harmless, I was intrigued by this, which is why I asked for an
explanation.
Your explanation seems to show that your tone was likely to be more
personal bias than any real issue with properties.
Paddy
--
"Ray, when someone asks you if you're a god, you say YES!"
--
http://mail.python.org/mailman/listinfo/python-list
y relevant if ALL the people
contributing are being paid by Google to do the work, which I'm pretty
sure is not the case.
There are people are spending lots of personal, unpaid and voluntary
time developing Python.
Paddy
--
"Ray, when someone asks you if you're a god, you say YES!"
--
http://mail.python.org/mailman/listinfo/python-list
Try this as an outline:
script1.py
from subprocess import Popen
if __name__ == '__main__':
scriptname = "script2.py"
Popen("python %s" % scriptname, shell=True)
print "I'm done"
script2.py
from time import sleep
if __name__ == '__main__':
while (True):
2009/2/27 [email protected] :
> Thanks for the reply,,
> I am trying to use the above application using psexec()in
> command line.But it failed returning the error message
>
> exited with error code 255.
>
> But when I ran the application normally it worked
> fine.Do
ango (seems to be the "biggest"/most used), or something else?
Any other suggestions for a possible "wow" reaction from an audience like that?
Thanks,
Paddy
--
"Ray, when someone asks you if you're a god, you say YES!"
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for all your replies.
A lot of very strong answers :)
2009/3/26 Mensanator :
> What would you have to do to make this work?
>
x+x+x # expecting [3,6]
> [2, 4, 1, 2]
What's happening is that the call to map() is returning a list object.
So after it calculates the first "x+x", you
it keeps accepting input
(and doesn't return) until I press Enter.
My initial thoughts are that a function like C's fgetc would be the
easiest way to do it, but I haven't been able to find an equivalent in
my google search, so I was wondering if anyone here might have some
ideas.
Wha
iting the old one.
Not when, as pointed out by uuid, container is not list-like (at least as
far as the sort() method goes).
:)
Paddy
--
"Ray, when someone asks you if you're a god, you say YES!"
--
http://mail.python.org/mailman/listinfo/python-list
e and create it only if it doesn't exist.
However, typing out .. everytime is
pretty long and susceptible to refactoring issues, so I was wondering if
there was a way in Python that I am missing which allows you to reference
the method that the code is in (like __module__ gives a reference
>
> I suspect that the "inspection" module has your answer, but that it'll be
> bulkier, and much slower than just doing what you're doing already.
>
Hmm.
Yeah, it does appear to be bulky. I don't think it's really any more use
than what I'm doing already.
Why not use the default arguments gimmic
g
>
> The moment I close the application that launched the macro, my
> ressources get freed.
>
> So is there a way to free my memory inside my nested loops?
>
> thanks in advance,
> tim
>
Could you split the program into one handling the outer loop and
calling another prog
[EMAIL PROTECTED] wrote:
> I posted to this newsgroup earlier about my annoyances with python and
> now I can't find the post. What did you do with it?
>
I notice a gmail address. Google groups was not updated for over a day and is
still 'behind'. Try
another news r
EuGeNe Van den Bulke wrote:
> I do realize that the UK is not really part of Europe (no polemic :P)
> but I am nevertheless curious about the logic behind creating another
> major Python event in Europe. Wasn't EuroPython enough?
>
> Like many I am sure, I probably won't be able to attend both (
nside.
I'm with Doug on this. Python *is* a scripting language which is a *good*
thing. It's their perceptions of what scripting languages are capable of
that are out-of-date.
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
cesco wrote:
I created some more test strings and ran posters solutions against them.
results attached.
- Paddy.
# alternating_replacements.py
tests = " 1 2_ 3_4 5_6_ 7_8_9 10_11_12_ 13_14_15_16 17_18_19_20_" \
" _ _21 _22_ _23_24 _25_26_ _27_28_29 _30_31_3
Chris Rebert wrote:
On Tue, Mar 17, 2009 at 2:24 PM, Robert Kern wrote:
On 2009-03-17 16:13, Paddy wrote:
We the def statement and the lambda expression. We have the class
statement, but is their an expression to create a class?
Or:
def F(): pass
type(F)
# Is to:
F2 = lambda : none
type
7;s printf, and
data sequence may be tuple or list. Dictionary may also be used for
data, but it has its own way to specify string formatting since
dictionary is unordered but "indexed" by the dict key.
I have attached a prog I wrote to answer someones elses similar problem.
- Paddy.
pp
>>> pp(list(range(3)), width=4)
[0,
1,
2]
>>> pp(set(range(3)), width=4)
{0, 1, 2}
- Paddy.
--
http://mail.python.org/mailman/listinfo/python-list
Joseph Turian wrote:
> Basically, we're planning on releasing it as open-source, and don't
> want to alienate a large percentage of potential users.
Then develop for 2.5 with an eye on what is to come this year in 2.6 with
regard to already planned
deprecations.
-
601 - 675 of 675 matches
Mail list logo