Roy Smith wrote:
In article <4b0a01a...@dnews.tpgi.com.au>, Lie Ryan
wrote:
The semantic of the in-place operator is something like:
x += y
becomes
x = x.__iadd__(y)
thus
foo.bar += baz
becomes
foo.bar = foo.bar.__iadd__(baz)
So the call sequence is,
foo.__getattr__('bar') ==> x
x.__iadd__(
that's right. I cannot make CPython calls from my original C-based threads.
On Sun, Nov 22, 2009 at 3:15 PM, Diez B. Roggisch wrote:
> Daniel Fetchinson schrieb:
>>>
>>> Has anyone every tried wrapping the CPython lib into a daemon with an
>>> RPC mechanism in order to move the GIL out of the pro
On Nov 22, 9:11 pm, n00m wrote:
> > The first statement is creating a whole new list;
>
> Yes but *imo* not quite exactly so.
> We can't think of 2 lists as of absolutely independent
> things.
> [...]
You are correct that two lists can both have the same mutable object
as items, and if you mutate
As I know, Python has been started for Amoeba OS.
Did anybody try Python with it? What about speed?
Python is so slow for big projects and I try to find a way to accelerate it.
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 22, 6:06 pm, "~km" wrote:
> Hi together,
>
> I'm a python-proficient newbie and want to tackle a program with
> Python 2.x, which basically organizes all my digital books (*.pdf,
> *.chm, etc..) and to give them specific "labels", such as:
>
> "Author" -> string
> "Read" -> boolean
> "Last
On Nov 22, 7:28 pm, Lie Ryan wrote:
> Roy Smith wrote:
> > If I've got an object foo, and I execute:
>
> > foo.bar += baz
>
> > exactly what happens if foo does not have a 'bar' attribute? It's
> > pretty clear that foo.__getattr__('bar') gets called first, but it's a
> > little murky after that.
Marc Leconte wrote:
class Toto(object):
def __init__(self, number, mylist=[]):
self.number=number
self.mylist=mylist
pass
pass
Why are you using pass to end your blocks?
--
http://mail.python.org/mailman/listinfo/python-list
~km wrote:
Hi together,
I'm a python-proficient newbie and want to tackle a program with
Python 2.x, which basically organizes all my digital books (*.pdf,
*.chm, etc..) and to give them specific "labels", such as:
"Author" -> string
"Read" -> boolean
"Last Opened:" -> string
and so on..
Now m
Roy Smith wrote:
If I've got an object foo, and I execute:
foo.bar += baz
exactly what happens if foo does not have a 'bar' attribute? It's
pretty clear that foo.__getattr__('bar') gets called first, but it's a
little murky after that. Assume for the moment that foo.__getattr__
('bar') return
per wrote:
hi all,
i am looking for a python package to make it easier to create a
"pipeline" of scripts (all in python). what i do right now is have a
set of scripts that produce certain files as output, and i simply have
a "master" script that checks at each stage whether the output of the
pre
Hi together,
I'm a python-proficient newbie and want to tackle a program with
Python 2.x, which basically organizes all my digital books (*.pdf,
*.chm, etc..) and to give them specific "labels", such as:
"Author" -> string
"Read" -> boolean
"Last Opened:" -> string
and so on..
Now my question is
On Nov 22, 3:14 pm, Steve Howell wrote:
> Explanations of why you need to write it that will follow...
I knew this had to be written up somewhere...
http://www.ferg.org/projects/python_gotchas.html#contents_item_6
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 22, 2:50 pm, Marc Leconte wrote:
> Dear all,
>
> I have a problem with the following code (ubuntu 8.04, Python 2.5.2):
>
> class Toto(object):
> def __init__(self, number, mylist=[])
> self.number=number
> self.mylist=mylist
> pass
>
Marc Leconte schrieb:
Dear all,
I have a problem with the following code (ubuntu 8.04, Python 2.5.2):
class Toto(object):
def __init__(self, number, mylist=[]):
self.number=number
self.mylist=mylist
pass
pass
listA=Toto(number=1)
-- Forwarded message --
From: Jebagnana Das
To: python-list@python.org
Date: Sat, 21 Nov 2009 19:17:56 +0530
Subject: problem with pyqt.. help please...
Hi friends,
I've recently changed to ubuntu 9.04.. I've not had any problem
with the installation of pyqt as it is a
Dear all,
I have a problem with the following code (ubuntu 8.04, Python 2.5.2):
class Toto(object):
def __init__(self, number, mylist=[]):
self.number=number
self.mylist=mylist
pass
pass
listA=Toto(number=1)
listB=Toto(number=2)
li
hi all,
i am looking for a python package to make it easier to create a
"pipeline" of scripts (all in python). what i do right now is have a
set of scripts that produce certain files as output, and i simply have
a "master" script that checks at each stage whether the output of the
previous script
Daniel Fetchinson schrieb:
Has anyone every tried wrapping the CPython lib into a daemon with an
RPC mechanism in order to move the GIL out of the process? I have
multiple audio threads, each of which use the python interpreter but
don't have to interact with each other and can might as well use
On Sun, 22 Nov 2009 15:08:28 +, Duncan Booth wrote:
> n00m wrote:
>
>> And now it's elephants instead of vectors. Def: an elephant is smarter
>> than another one IIF its size is strictly less but its IQ is strictly
>> greater
>>
>> I.e. you can't compare (2, 8) to (20, 50) or let count them
> Has anyone every tried wrapping the CPython lib into a daemon with an
> RPC mechanism in order to move the GIL out of the process? I have
> multiple audio threads, each of which use the python interpreter but
> don't have to interact with each other and can might as well use a
> separate interpre
Lutfi Oduncuoglu wrote:
Hello,
I am a newbie on oython and I am taking the error at subject my code is
below, I am trying to develop a qgis plugin and lines begin with # is the
thing that I tried. Thus sys.stdout gives the type error. When I comment
that line it turns an error like below. What
Has anyone every tried wrapping the CPython lib into a daemon with an
RPC mechanism in order to move the GIL out of the process? I have
multiple audio threads, each of which use the python interpreter but
don't have to interact with each other and can might as well use a
separate interpreter handle
On Sun, 22 Nov 2009 03:43:31 +0100, Ivan Voras wrote:
> The problem is: poll() always returns that the fd is ready (without
> waiting), but read() always returns an empty string. Actually, it
> doesn't matter if I turn O_NDELAY on or off. select() does the same.
Regular files are always "ready" f
On Nov 22, 11:32 am, News123 wrote:
> Hi,
>
> I'm trying to scan a document from a python 2.6 script without user
> interaction.
>
> I found a code snippet, that allows me to scan under Vista, but that
> doesn't allow me to select the dpi / color mode / etc.
>
> The snippet uses win32com.client
MRAB wrote:
> n00m wrote:
>> :-) Of course, by "too" I meant "too", as in "to much"
>
> Although it's OK in English to say "too much x" or "too many x", it's
> somewhat unnatural to say "too different xs"; it would have to be "the
> xs are too different". Nobody said English was logical! :-)
Peng Yu wrote:
On Wed, Nov 18, 2009 at 8:47 PM, Chris Rebert wrote:
On Wed, Nov 18, 2009 at 6:27 PM, Peng Yu wrote:
http://www.python.org/dev/peps/pep-0008/
The above webpage states the following naming convention. Such a
variable can be an internal variable in a class. I'm wondering what is
On Sun, Nov 22, 2009 at 1:30 PM, Martijn Arts wrote:
> If it's a UNIX server you can use Chown in the command line. Try "man
> chown" first to see how it works.
>
This is strange. I'd tried chown'ing before and was always getting 403
errors. Just to make sure that's what the problem was, I did it
In article <7ms7ctf3k2a7...@mid.individual.net>,
Gregory Ewing wrote:
>
>However, Go's designers seem to favour using the absolute minimum
>number of characters they can get away with.
>
>Although if they *really* wanted that, they would have dropped most of
>the semicolons and used indentation-b
eric.frederich wrote:
I have a class which holds a connection to a server and a bunch of
services.
In this class I have methods that need to work with that connection
and services.
Right now there are about 50 methods some of which can be quite long.
From an organizational standpoint, I'd like t
On Sun, Nov 22, 2009 at 12:39 PM, Victor Subervi
wrote:
> Hi;
> I can only run my python scripts on my server if they are owned by root. How
> do I change that?
> TIA,
> Victor
Almost certainly going to need more information. On that note, you are
probably going to get better help with less expla
Lutfi Oduncuoglu wrote:
Hello,
I am a newbie on oython and I am taking the error at subject my code is
below, I am trying to develop a qgis plugin and lines begin with # is
the thing that I tried. Thus sys.stdout gives the type error. When I
comment that line it turns an error like below. Wha
n00m wrote:
The second part of the compound if is backwards. So if this is headed
for production code, it better get fixed.
DaveA
Not sure I'm understanding your remark.
Well, others in the thread have observed the same thing, so maybe it
doesn't matter. But the quoted code had onl
Hello,
I am a newbie on oython and I am taking the error at subject my code is
below, I am trying to develop a qgis plugin and lines begin with # is the
thing that I tried. Thus sys.stdout gives the type error. When I comment
that line it turns an error like below. What may be the problem? thanks
n00m wrote:
The second part of the compound if is backwards. So if this is headed
for production code, it better get fixed.
DaveA
Not sure I'm understanding your remark.
Maybe he meant, that this:
if v1.x < v2.x and v1.y > v2.y
should be:
if v1.x < v2.x and v1.y < v2.y
?
--
http://mail.pyth
Hi;
I can only run my python scripts on my server if they are owned by root. How
do I change that?
TIA,
Victor
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I'm trying to scan a document from a python 2.6 script without user
interaction.
I found a code snippet, that allows me to scan under Vista, but that
doesn't allow me to select the dpi / color mode / etc.
The snippet uses win32com.client
# # script start
import win32com
On Nov 22, 7:55 am, Simon Forman wrote:
> On Sun, Nov 22, 2009 at 4:50 AM, Diez B. Roggisch wrote:
>
>
>
> > Steve Howell schrieb:
>
> >> On Nov 21, 4:07 pm, MRAB wrote:
>
> >>> I don't see the point of EvalNode and PrettyPrintNode. Why don't you
> >>> just give Integer, Sum and Product 'eval' a
> it's somewhat unnatural to say "too different xs"
Aha. Thanks.
PS
For years I thought that song's title "No Woman No Cry" by Bob Marley
means "No Woman -- No Cry". As if a man got rid of his woman and
stopped
crying, out of her bad behaviour etc.
It turned out to mean "No, woman,.. no cry..."
O
n00m wrote:
:-) Of course, by "too" I meant "too", as in "to much"
Although it's OK in English to say "too much x" or "too many x", it's
somewhat unnatural to say "too different xs"; it would have to be "the
xs are too different". Nobody said English was logical! :-)
--
http://mail.python.o
Tim Chase wrote:
import re
line='2009-11-22 12:15:441 lmqkjsfmlqshvquhsudfhqf qlsfh
qsduidfhqlsiufh qlsiuf qldsfhqlsifhqlius dfh warning qlsfj lqshf
lqsuhf lqksjfhqisudfh qiusdfhq iusfh'
re.match('.*(?!warning)',line)
<_sre.SRE_Match object at 0xb75b1598>
I would expect that this would NOT
:-) Of course, by "too" I meant "too", as in "to much"
--
http://mail.python.org/mailman/listinfo/python-list
Here "meaningful order" is:
if
elephant "a[i]" is smarter than elephant "a[j]"
then "i" must be strictly less than "j"
Of course, to the same effect we could sort them simply
by sizes, but then time of sorting would increase by ~
2 times -- due to decreasing of number of equally smart
things.
But
一首诗 wrote:
I used python to write an assignment last week, here is a code snippet
#
def departTime():
'''
Calculate the time to depart a packet.
'''
if(random.random < 0.8):
t = random.expovariate(1.0 / 2.5)
else:
t = random.ex
Steven D'Aprano wrote:
In the subject line, you write "too different times". You actually want
"two", the number, not "too" as in "too many", "too much". Lots of native
English speakers get this wrong too :)
[snip]
It could mean that the times are not just different, they're _too_
different,
On Sun, Nov 22, 2009 at 4:50 AM, Diez B. Roggisch wrote:
> Steve Howell schrieb:
>>
>> On Nov 21, 4:07 pm, MRAB wrote:
>>>
>>> I don't see the point of EvalNode and PrettyPrintNode. Why don't you
>>> just give Integer, Sum and Product 'eval' and 'pprint' methods?
>>
>> That's a good question, and
n00m wrote:
> And now it's elephants instead of vectors.
> Def: an elephant is smarter than another one IIF
> its size is strictly less but its IQ is strictly
> greater
>
> I.e. you can't compare (2, 8) to (20, 50)
> or let count them as equally smart elephants.
and that still isn't a relations
On 11/22/09 14:58, Jelle Smet wrote:
Hi List,
I'm trying to match lines in python using the re module.
The end goal is to have a regex which enables me to skip lines which have ok
and warning in it.
But for some reason I can't get negative lookaheads working, the way it's explained in
"http://
On 22 Nov, 16:00, Gerald Walker wrote:
> Kill Joy wrote:
> > Hi all.
>
> > I have a mod_python script with two query:
>
> > cursor = db.cursor()
>
> > sql = 'SELECT * FROM users where username=\'' + username +'\''
> > cursor.execute(sql)
> > result = cursor.fetchall()
> > num = int
Kill Joy wrote:
> Hi all.
>
> I have a mod_python script with two query:
>
> cursor = db.cursor()
>
> sql = 'SELECT * FROM users where username=\'' + username +'\''
> cursor.execute(sql)
> result = cursor.fetchall()
> num = int(cursor.rowcount)
>
> if num ==
import re
line='2009-11-22 12:15:441 lmqkjsfmlqshvquhsudfhqf qlsfh qsduidfhqlsiufh
qlsiuf qldsfhqlsifhqlius dfh warning qlsfj lqshf lqsuhf lqksjfhqisudfh qiusdfhq
iusfh'
re.match('.*(?!warning)',line)
<_sre.SRE_Match object at 0xb75b1598>
I would expect that this would NOT match as it's a neg
Pyspread is getting close to the first Beta. This new release should
work with Windows as well as with Linux.
About
-
Pyspread is a cross-platform Python spreadsheet application. It is
based on and written in the programming language Python.
Instead of spreadsheet formulas, Python expressio
Hi all.
I have a mod_python script with two query:
cursor = db.cursor()
sql = 'SELECT * FROM users where username=\'' + username +'\''
cursor.execute(sql)
result = cursor.fetchall()
num = int(cursor.rowcount)
if num == 0 :
sql2 =
Hi List,
I'm trying to match lines in python using the re module.
The end goal is to have a regex which enables me to skip lines which have ok
and warning in it.
But for some reason I can't get negative lookaheads working, the way it's
explained in "http://docs.python.org/library/re.html";.
Con
> The second part of the compound if is backwards. So if this is headed
> for production code, it better get fixed.
>
> DaveA
Not sure I'm understanding your remark.
--
http://mail.python.org/mailman/listinfo/python-list
> Do you get the same magnitude difference
> if you make Vector a new-style class?
Yes (I mean "No"): new-style's much faster
And now it's elephants instead of vectors.
Def: an elephant is smarter than another one IIF
its size is strictly less but its IQ is strictly
greater
I.e. you can't compar
On Nov 22, 6:58 am, Gregory Ewing wrote:
> > rudra wrote:
>
> >> 0.0 0.0 0.1
> >> 0.0 0.1 0.1
> >> 0.1 0.0 0.5
>
> >> like that! the first two column are coordinate and 3rd one is
> >> magnitude of moment (say: x y,m)!! so what i want to do is draw an
> >> arrow of magnitude(m) in the position (x,
n00m wrote:
Any comment:
def v_cmp(v1, v2):
if v1.x < v2.x and v1.y > v2.y:
return -1
return 0
The second part of the compound if is backwards. So if this is headed
for production code, it better get fixed.
DaveA
--
http://mail.python.org/mailman/listinfo/python-list
Matt Nordhoff writes:
> Jason Sewall wrote:
>> FWIW, GNU tail on Linux uses inotify for tail -f:
>>
>> http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/tail.c
>>
>> The wikipedia page for inotify lists several python bindings:
>>
>> http://en.wikipedia.org/wiki/Inotify
>>
>> Not much h
> >>> My proposed no-syntax
> >>> IDE *also* gets rid of the need to bother with any programming-language
> >>> syntax. I've been proposing it for years, but nobody has shown any
> >>> interest
> From: Terry Reedy
> What you describe below is similar to various systems that have
> been proposed an
On Sun, Nov 22, 2009 at 4:03 AM, 一首诗 wrote:
> I used python to write an assignment last week, here is a code snippet
>
> #
>
> def departTime():
> '''
> Calculate the time to depart a packet.
> '''
> if(random.random < 0.8):
> t = random.expovaria
I used python to write an assignment last week, here is a code snippet
#
def departTime():
'''
Calculate the time to depart a packet.
'''
if(random.random < 0.8):
t = random.expovariate(1.0 / 2.5)
else:
t = random.expovariate(1.0
On Nov 22, 9:21 am, n00m wrote:
> Any comment:
>
> class Vector:
> def __init__(self, x, y):
> self.x = x
> self.y = y
> def __cmp__(self, v):
> if self.x < v.x and self.y > v.y:
> return -1
> return 0
>
> def v_cmp(v1, v2):
> if v1.x < v2.x
n00m wrote:
> Any comment:
>
> class Vector:
> def __init__(self, x, y):
> self.x = x
> self.y = y
> def __cmp__(self, v):
> if self.x < v.x and self.y > v.y:
> return -1
> return 0
>
> def v_cmp(v1, v2):
> if v1.x < v2.x and v1.y > v2.y:
n00m schrieb:
Any comment:
class Vector:
def __init__(self, x, y):
self.x = x
self.y = y
def __cmp__(self, v):
if self.x < v.x and self.y > v.y:
return -1
return 0
def v_cmp(v1, v2):
if v1.x < v2.x and v1.y > v2.y:
return -1
re
On Sun, Nov 22, 2009 at 2:56 AM, n00m wrote:
> I was expecting the 1st method would be *slower* than the 2nd one :-)
> Or at least equal... Just random ("intuitive") expectations
The second method repeatedly looks up left_item.__class__.__cmp__
(i.e. Vector.__cmp__) when doing the necessary compa
In the subject line, you write "too different times". You actually want
"two", the number, not "too" as in "too many", "too much". Lots of native
English speakers get this wrong too :)
On Sun, 22 Nov 2009 01:21:42 -0800, n00m wrote:
> Any comment:
>
> class Vector:
> def __init__(self, x,
I was expecting the 1st method would be *slower* than the 2nd one :-)
Or at least equal... Just random ("intuitive") expectations
--
http://mail.python.org/mailman/listinfo/python-list
n00m writes:
> Any comment:
I get similar output. What were you expecting to happen? Did you have
any questions?
--
\“The right to search for truth implies also a duty; one must |
`\ not conceal any part of what one has recognized to be true.” |
_o__)
Hi,
yappi(yet another python profiler) is a Python Profiler with
multithreading support. This is the last beta version with some major
changes and bugfixes:
v0.3 Changes
-
[+] yappi did not compile out of box on VS2008. Fix the compile
issues. (Thanks to Kevin Watters)
[+] tidy up stat for
On Nov 21, 11:33 pm, Gregory Ewing
wrote:
> Steve Howell wrote:
> > If you are
> > going to couple character sets to their legacy physical
> > implementations, you should also have a special extra character to dot
> > your i's and cross your t's.
>
> No, no, no. For that device you need to output
On 22 Nov, 04:05, Carl Banks wrote:
> name = PyString_FromString("vanilla");
> bases = PyTuple_New(0);
> dict = PyDict_New();
> vanilla_type = PyObject_CallObject(
> &PyType_Type,name,bases,dict,0);
>
> Then call the vanilla type (however you create it) to get a vanilla
> object:
>
> vani
Steve Howell schrieb:
On Nov 21, 4:07 pm, MRAB wrote:
I don't see the point of EvalNode and PrettyPrintNode. Why don't you
just give Integer, Sum and Product 'eval' and 'pprint' methods?
That's a good question, and it's the crux of my design dilemma. If
ALL I ever wanted to to with Integer/S
Any comment:
class Vector:
def __init__(self, x, y):
self.x = x
self.y = y
def __cmp__(self, v):
if self.x < v.x and self.y > v.y:
return -1
return 0
def v_cmp(v1, v2):
if v1.x < v2.x and v1.y > v2.y:
return -1
return 0
from ran
On Sun, Nov 22, 2009 at 03:43 +0100, Ivan Voras wrote:
> I'm trying to simply imitate what "tail -f" does, i.e. read a file, wait
> until it's appended to and process the new data, but apparently I'm
> missing something.
[..]
> Any advice?
Have a look at [1], which mimics "tail -f" perfectly. It c
Terry Reedy wrote:
Having it mirrored to news.gmane,org, if you have not yet, like other
python.org lists, would make it easier to follow or join. Perhaps it
will happen automatically, I do not know.
I don't think it's automatic. I've submitted a request to
gmane to have it added and I'm waiti
75 matches
Mail list logo