On Jul 27, 5:14 am, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Sat, 26 Jul 2008 15:58:16 -0700, Carl Banks wrote:
> > On Jul 26, 5:07 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
> >> Whether or not one should write 'if x' or 'if x != 0' [typo corrected]
> >> depends on whethe
On Jul 27, 10:55 pm, Lawrence D'Oliveiro <[EMAIL PROTECTED]
central.gen.new_zealand> wrote:
> In message
> <[EMAIL PROTECTED]>,
>
>
>
> [EMAIL PROTECTED] wrote:
> > On Jul 26, 6:47 pm, Lawrence D'Oliveiro <[EMAIL PROTECTED]
> > central.gen.new_zealand> wrote:
> >> In message
> >> <[EMAIL PROTECTED]
On Jul 27, 10:32 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
> Derek Martin wrote:
> > Furthermore, as you described, defining the function within the scope
> > of a class binds a name to the function and then makes it a method of
> > the class. Once that happens, *the function has become a method*
[EMAIL PROTECTED] wrote:
> thanks a lot!!! re-read it again!!!
>
> from the struct doc!
> Standard size and alignment are as follows: no alignment is required
> for any type (so you have to use pad bytes); short is 2 bytes; int and
> long are 4 bytes; long long (__int64 on Windows) is 8 bytes; flo
Colin J. Williams wrote:
>>
>> def fun( ., cat):
>>
> I don't see the need for the comma in fun.
It (the entire first variable!) is needed because a method object is
constructed from a normal function object:
def method(self,a,b):
pass
class MyClass(object):
pass
MyClass.tes
Derek Martin wrote:
Furthermore, as you described, defining the function within the scope
of a class binds a name to the function and then makes it a method of
the class. Once that happens, *the function has become a method*.
If you mean that a user-defined function object becomes a different
Derek Martin wrote:
> Regardless of how it's implementd, it's such a common idiom to use
> self to refer to object instances within a class in Python that it
> ought to be more automatic. Personally, I kind of like the idea of
> using @ and thinking of it more like an operator... Kind of like
> d
On Jul 27, 9:44 pm, alex23 <[EMAIL PROTECTED]> wrote:
> > > > > On Jul 27, 4:26 pm, "Russ P." <[EMAIL PROTECTED]> wrote:
> > > > > > Terry Reedy <[EMAIL PROTECTED]> wrote:
> > > > > > > The use of '.' has been suggested before and rejected.
> > > > > > Where and why?
> > Dude, I agree with Guido co
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Just test for maxint value:
from sys import maxint
if maxint >> 33:
print "more than 32 bits" # probably 64
else:
print "32 bits"
Best regards,
Manuel.
Trent Mick wrote:
> norseman wrote:
>>
>> > > I need to know if I'm running on
> > > > On Jul 27, 4:26 pm, "Russ P." <[EMAIL PROTECTED]> wrote:
> > > > > Terry Reedy <[EMAIL PROTECTED]> wrote:
> > > > > > The use of '.' has been suggested before and rejected.
> > > > > Where and why?
> Dude, I agree with Guido completely on this one. You
> seem to be clueless about the issue
On Jul 27, 8:58 pm, castironpi <[EMAIL PROTECTED]> wrote:
> On Jul 27, 2:39 pm, Bruno Desthuilliers
>
> <[EMAIL PROTECTED]> wrote:
> > Derek Martin a écrit :
> > > It's bad programming, but the world is full of bad programmers, and we
> > > don't always have the choice not to use their code. Isn't
try optparse :)
http://docs.python.org/lib/module-optparse.html
On Sun, Jul 27, 2008 at 9:13 PM, aditya shukla
<[EMAIL PROTECTED]>wrote:
> Hello folks ,I have a program in which a text file is generated as an
> output
> eg
>
> C:\prog\ prog -x test.txt
> Right now whenever i have to read the tes
On Jul 27, 8:38 pm, alex23 <[EMAIL PROTECTED]> wrote:
> On Jul 28, 4:59 am, "Russ P." <[EMAIL PROTECTED]> wrote:
>
> > On Jul 27, 3:11 am, alex23 <[EMAIL PROTECTED]> wrote:
>
> > > On Jul 27, 4:26 pm, "Russ P." <[EMAIL PROTECTED]> wrote:
>
> > > > On Jul 26, 11:18 pm, Terry Reedy <[EMAIL PROTECTED]
josh logan wrote:
On Jul 27, 8:45 pm, pigmartian <[EMAIL PROTECTED]> wrote:
it could be that 3.0 is using "banker's rounding" --- rounding to the
even digit. the idea behind it behind it being to reduce error
accumulation when working with large sets of values.
Works for me on Python
On Jul 28, 1:44 pm, Sera Jackson <[EMAIL PROTECTED]> wrote:
> Lot of thanks again, that's what I wanted to find, arguments against
> it, I was aware I wan not speaking of sth new.
Guido seems to keep hinting that someone should write a PEP, just so
it can be officially denied and then there'll be
On Jul 27, 6:21 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
> Russ P. wrote:
> > On Jul 27, 12:39 pm, Bruno Desthuilliers
> > All I am suggesting is that the programmer have the option of
> > replacing "self.member" with simply ".member", since the word "self"
> > is arbitrary and unnecessary.
>
> I
Hello folks ,I have a program in which a text file is generated as an output
eg
C:\prog\ prog -x test.txt
Right now whenever i have to read the test file i have to put its name
manually in my code.
eg
f=open("c:\\prog\\test.txt","r")
How ever i want to add the name of the test file dynamically to
In message
<[EMAIL PROTECTED]>, Johny
wrote:
> Is there a way how to find out running processes?E.g. how many
> Appache's processes are running?
Under Linux, every process has a procfs directory /proc/, where
is the process ID. In here you will find all kinds of interesting
information about th
In message
<[EMAIL PROTECTED]>,
sturlamolden wrote:
> Basically it forks twice ...
What's the advantage of forking twice over forking once and calling setsid?
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 27, 2:39 pm, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> Derek Martin a écrit :
> > It's bad programming, but the world is full of bad programmers, and we
> > don't always have the choice not to use their code. Isn't one of
> > Python's goals to minimize opportunities for bad programmi
In message
<[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> On Jul 26, 6:47 pm, Lawrence D'Oliveiro <[EMAIL PROTECTED]
> central.gen.new_zealand> wrote:
>> In message
>> <[EMAIL PROTECTED]>,
>>
>> [EMAIL PROTECTED] wrote:
>> > On Jul 24, 5:01 am, Lawrence D'Oliveiro <[EMAIL PROTECTED]
>> > central.
On Jul 28, 6:25 am, alex23 <[EMAIL PROTECTED]> wrote:
> On Jul 28, 12:46 pm, Sera Jackson <[EMAIL PROTECTED]> wrote:
>
> > ok, I know its an over discussed topic. Althought I understand why it
> > is there I cant constantly see it in my argument list in parenthesis.
>
> > can someone give me an ins
On Jul 28, 4:59 am, "Russ P." <[EMAIL PROTECTED]> wrote:
> On Jul 27, 3:11 am, alex23 <[EMAIL PROTECTED]> wrote:
>
> > On Jul 27, 4:26 pm, "Russ P." <[EMAIL PROTECTED]> wrote:
>
> > > On Jul 26, 11:18 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
> > > > The use of '.' has been suggested before and re
On Sun, Jul 27, 2008 at 09:39:26PM +0200, Bruno Desthuilliers wrote:
> >As for the latter part of #3, self (or some other variable) is
> >required in the parameter list of object methods,
>
> It's actually the parameter list of the *function* that is used as the
> implementation of a method. Not
On Jul 28, 12:46 pm, Sera Jackson <[EMAIL PROTECTED]> wrote:
> ok, I know its an over discussed topic. Althought I understand why it
> is there I cant constantly see it in my argument list in parenthesis.
>
> can someone give me an insight of the cons of a syntax like this:
> class Class:
> def
On Jul 27, 3:54 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Sun, 27 Jul 2008 12:33:16 -0700, Russ P. wrote:
> > On Jul 27, 1:19 am, Steven D'Aprano <[EMAIL PROTECTED]
> > cybersource.com.au> wrote:
> >> On Sat, 26 Jul 2008 17:14:46 -0700, Russ P. wrote:
>
> >> > You take
On Jul 27, 8:55 pm, Larry Bates <[EMAIL PROTECTED]> wrote:
> josh logan wrote:
> > Hello,
>
> > I need a round function that _always_ rounds to the higher integer if
> > the argument is equidistant between two integers. In Python 3.0, this
> > is not the advertised behavior of the built-in function
ok, I know its an over discussed topic. Althought I understand why it
is there I cant constantly see it in my argument list in parenthesis.
can someone give me an insight of the cons of a syntax like this:
class Class:
def self.method(arguments):
etc, etc
In other words def method(se
On Sun, Jul 27, 2008 at 7:17 PM, Larry Bates <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
>> On Sun, Jul 27, 2008 at 7:01 PM, Larry Bates <[EMAIL PROTECTED]>
>> wrote:
>>> [EMAIL PROTECTED] wrote:
i want to send unsigned 32 bit integer to socket, and looking for
something equival
[EMAIL PROTECTED] wrote:
On Sun, Jul 27, 2008 at 7:01 PM, Larry Bates <[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED] wrote:
i want to send unsigned 32 bit integer to socket, and looking for
something equivalent to this method...
http://livedocs.adobe.com/flex/2/langref/flash/net/Socket.html#write
On Sun, Jul 27, 2008 at 7:01 PM, Larry Bates <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
>> i want to send unsigned 32 bit integer to socket, and looking for
>> something equivalent to this method...
>> http://livedocs.adobe.com/flex/2/langref/flash/net/Socket.html#writeUnsignedInt()
>>
>
[EMAIL PROTECTED] wrote:
hi
i want to send unsigned 32 bit integer to socket, and looking for
something equivalent to this method...
http://livedocs.adobe.com/flex/2/langref/flash/net/Socket.html#writeUnsignedInt()
is there such method / library available in python?!
this is as far as i have
On Sun, 13 Jul 2008 00:58:59 +0200, Python.Arno wrote:
> http://undefined.org/python/py2app.html
py2app bundles Python itself into the app, right? I wonder, is there no
way to create an app bundle that relies on the existing installation of
Python, since OS X already comes with Python? I have a
josh logan wrote:
Hello,
I need a round function that _always_ rounds to the higher integer if
the argument is equidistant between two integers. In Python 3.0, this
is not the advertised behavior of the built-in function round() as
seen below:
round(0.5)
0
round(1.5)
2
round(2.5)
2
I wo
Gary Herron wrote:
josh logan wrote:
I need a round function that _always_ rounds to the higher integer if
the argument is equidistant between two integers. In Python 3.0, this
is not the advertised behavior of the built-in function round() as
seen below:
round(2.5)
2
Huh?
>
hi
i want to send unsigned 32 bit integer to socket, and looking for
something equivalent to this method...
http://livedocs.adobe.com/flex/2/langref/flash/net/Socket.html#writeUnsignedInt()
is there such method / library available in python?!
this is as far as i have gotten along
>>> s = socket
Russ P. wrote:
When I write a function in which a data member will be used several
times, I usually do something like this:
data = self.data
so I can avoid the clutter of repeated use of "self.data".
Another reason people do this is for speed, even if self.data is used
just once but i
Russ P. wrote:
On Jul 27, 12:39 pm, Bruno Desthuilliers
All I am suggesting is that the programmer have the option of
replacing "self.member" with simply ".member", since the word "self"
is arbitrary and unnecessary.
I presume you are proposing the opposite also, that ".member" would
intern
(my apologies if this is a repost, but it sure seems like the first
attempt disappeared into the ether...)
I'm writing a program that uses functionality from two different sets of
cdlls which reside in two different directories, call them 'libA.dll'
and 'libB.dll'. Although I don't directly u
On Jul 27, 8:45 pm, pigmartian <[EMAIL PROTECTED]> wrote:
> it could be that 3.0 is using "banker's rounding" --- rounding to the
> even digit. the idea behind it behind it being to reduce error
> accumulation when working with large sets of values.
>
> > Works for me on Python 2.5 on Linux runnin
On Jul 27, 7:58 pm, Gary Herron <[EMAIL PROTECTED]> wrote:
> josh logan wrote:
> > Hello,
>
> > I need a round function that _always_ rounds to the higher integer if
> > the argument is equidistant between two integers. In Python 3.0, this
> > is not the advertised behavior of the built-in function
it could be that 3.0 is using "banker's rounding" --- rounding to the
even digit. the idea behind it behind it being to reduce error
accumulation when working with large sets of values.
Works for me on Python 2.5 on Linux running on "Intel(R) Core(TM)2 Duo
CPU". What system are you on?
I
>
> Where is the correct round() method?
> Hello,
>
> I need a round function that _always_ rounds to the higher integer if
> the argument is equidistant between two integers. In Python 3.0, this
> is not the advertised behavior of the built-in function round() as
> seen below:
>
> >>> round(0.5)
>
josh logan wrote:
Hello,
I need a round function that _always_ rounds to the higher integer if
the argument is equidistant between two integers. In Python 3.0, this
is not the advertised behavior of the built-in function round() as
seen below:
round(0.5)
0
round(1.5)
On 20Jul2008 00:08, Kay Schluehr <[EMAIL PROTECTED]> wrote:
| > Google was not my friend on this one, and I suspect there is no
| > answer.
|
| Even the Great Google can't help if you don't use the right
| keywords ;)
Actually, I was shown an useful Google search syntax the other day:
Searching
On Sun, 27 Jul 2008 16:04:43 -0400, Colin J. Williams wrote:
>> For those who don't like the way the empty first argument looks, maybe
>> something like this could be allowed:
>>
>> def fun( ., cat):
>>
> I don't see the need for the comma in fun.
Or the parentheses and colon. Can we remov
On Sun, 27 Jul 2008 12:33:16 -0700, Russ P. wrote:
> On Jul 27, 1:19 am, Steven D'Aprano <[EMAIL PROTECTED]
> cybersource.com.au> wrote:
>> On Sat, 26 Jul 2008 17:14:46 -0700, Russ P. wrote:
>
>> > You take the name down to a single letter. As I suggested in an
>> > earlier post on this thread, w
On Jul 27, 3:11 pm, "Russ P." <[EMAIL PROTECTED]> wrote:
> On Jul 27, 12:39 pm, Bruno Desthuilliers
>
>
>
> <[EMAIL PROTECTED]> wrote:
> > Derek Martin a écrit :
>
> > > On Sun, Jul 27, 2008 at 08:19:17AM +, Steven D'Aprano wrote:
> > >>> You take the name down to a single letter. As I suggeste
On Sun, 27 Jul 2008 20:04:27 +0200, Bruno Desthuilliers wrote:
>> In general, anything that looks like this:
>>
>> s = ''
>> for i in range(1): # or any big number
>> s = s + 'another string'
>>
>> can be slow. Very slow.
>
> But this is way faster:
>
> s = ''
> for i in range(1):
On Jul 27, 12:39 pm, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> Derek Martin a écrit :
>
>
>
> > On Sun, Jul 27, 2008 at 08:19:17AM +, Steven D'Aprano wrote:
> >>> You take the name down to a single letter. As I suggested in an earlier
> >>> post on this thread, why not take it down to ze
Hello folks ,I have a program in which a text file is generated as an output
eg
C:\prog\ prog -x test.txt
Right now whenever i have to read the test file i have to put its name
manually in my code.
eg
f=open("c:\\prog\\test.txt","r")
How ever i want to add the name of the test file dynamically to
Hello,
I need a round function that _always_ rounds to the higher integer if
the argument is equidistant between two integers. In Python 3.0, this
is not the advertised behavior of the built-in function round() as
seen below:
>>> round(0.5)
0
>>> round(1.5)
2
>>> round(2.5)
2
I would think this
Terry Reedy schrieb:
DaveM wrote:
On Sun, 27 Jul 2008 19:46:32 +0200, "Diez B. Roggisch"
<[EMAIL PROTECTED]>
wrote:
As a rule of thumb, don't return objects you didn't create inside a
function from scratch.
Unless its job is specifically to get/fetch an object (reference
thereto) from som
Derek Martin a écrit :
On Sun, Jul 27, 2008 at 08:19:17AM +, Steven D'Aprano wrote:
You take the name down to a single letter. As I suggested in an earlier
post on this thread, why not take it down to zero letters?
The question isn't "why not", but "why". The status quo works well as it
is
braver schrieb:
Can open two files in a with statement:
with open(src) as readin, open(dst,"w") as writin: # WRONG: comma
doesn't work
...
-- so that you have transactional safety for two file descriptors?
The comma syntax doesn't work, but is there a way, except for
with open(src) as read
> a) Intellisense (tells you what classes/methods are available and what
> variables go into a function)
> b) Code Completion (guesses your code after four letters)
> c) Data-Orientation; multiple data sessions can be open, data can be
> viewed easily
>
> Python's IDLE has only half of the first of
DaveM wrote:
On Sun, 27 Jul 2008 19:46:32 +0200, "Diez B. Roggisch" <[EMAIL PROTECTED]>
wrote:
As a rule of thumb, don't return objects you didn't create inside a
function from scratch.
Unless its job is specifically to get/fetch an object (reference
thereto) from someplace the caller canno
Can open two files in a with statement:
with open(src) as readin, open(dst,"w") as writin: # WRONG: comma
doesn't work
...
-- so that you have transactional safety for two file descriptors?
The comma syntax doesn't work, but is there a way, except for
with open(src) as readin:
with open(ds
Jordan a écrit :
(snip)
about Python Zen:
Perhaps we're just looking at an instance of a wider problem - smart
people boil good ideas down into short slogans, which are nice and
memorable and somewhat helpful, but can lead to bad consequences when
lots of others start overusing or misunderstand
Lawrence D'Oliveiro a écrit :
In message
<[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
"Support OO but it doesn't have to"? That sounds like saying that in
some Python implementations you'll be able to use OO, but that you
just might bump into a Python distribution ...
Change "distribution" t
Russ P. a écrit :
On Jul 26, 11:22 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
Russ P. wrote:
On Jul 26, 2:25 pm, Terry Reedy
There is a lot of code you have not seen. Really. In informal code I
use 's' and 'o' for 'self' and 'other'. I don't usually post such
because it is not considered po
Marcus.CM a écrit :
Well after reading some of these posts on "sacred python cow" on the
"self" , i would generally feel that most programmers
who started with C++/Java would find it odd. And its true, i agree
completely there should not be a need to put "self" into every single
member function
Torsten Bronger a écrit :
Hallöchen!
Bruno Desthuilliers writes:
Torsten Bronger a écrit :
(snip)
One could surely find ways to realise this. However, the design
goal should be: Make the frequent case simple, and the rare case
possible.
Given the (more and more prominent) use of decorato
Russ P. wrote:
On Jul 26, 2:25 pm, Terry Reedy
There is a lot of code you have not seen. Really. In informal code I
use 's' and 'o' for 'self' and 'other'. I don't usually post such
because it is not considered polite. So you have seen a biased sample
of the universe.
You take the name do
Steven D'Aprano a écrit :
On Sat, 26 Jul 2008 18:54:22 +, Robert Latest wrote:
Here's an interesting side note: After fixing my "Channel" thingy the
whole project behaved as expected. But there was an interesting hitch.
The main part revolves around another class, "Sequence", which has a
li
On Sun, Jul 27, 2008 at 08:19:17AM +, Steven D'Aprano wrote:
> > You take the name down to a single letter. As I suggested in an earlier
> > post on this thread, why not take it down to zero letters?
>
> The question isn't "why not", but "why". The status quo works well as it
> is, even if i
On Sun, 27 Jul 2008 19:46:32 +0200, "Diez B. Roggisch" <[EMAIL PROTECTED]>
wrote:
>As a rule of thumb, don't return objects you didn't create inside a
>function from scratch.
I wish I'd had that advice when I started learning python. It would have
saved me no end of grief.
DaveM
--
http://mail
On Jul 27, 1:19 am, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Sat, 26 Jul 2008 17:14:46 -0700, Russ P. wrote:
> > You take the name down to a single letter. As I suggested in an earlier
> > post on this thread, why not take it down to zero letters?
>
> The question isn't "
On Sun, Jul 27, 2008 at 08:13:53AM +, Steven D'Aprano wrote:
> On Sun, 27 Jul 2008 10:23:06 +0800, Marcus.CM wrote:
>
> > Well after reading some of these posts on "sacred python cow" on the
> > "self" , i would generally feel that most programmers who started with
> > C++/Java would find it o
On Sun, 27 Jul 2008 09:28:28 -0700, Gary Herron <[EMAIL PROTECTED]>
wrote:
>> a = list(set(itertools.chain(*sessexam.values(
>> a.sort() #As I write I'm wondering if I really need it sorted. Hmm...
>> return a
>Didn't someone already answer that. List addition and sum() both do
On Sat, Jul 26, 2008 at 12:06:05AM -0400, Terry Reedy wrote:
> There is no requirement to have 'self' in the parameter list.
But there is a requirement to have *something* which refers to the
object instance. Why can't this be implicit with a keyword defined in
python to refer to it?
> So the
On Jul 27, 3:11 am, alex23 <[EMAIL PROTECTED]> wrote:
> On Jul 27, 4:26 pm, "Russ P." <[EMAIL PROTECTED]> wrote:
>
> > On Jul 26, 11:18 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
> > > The use of '.' has been suggested before and rejected.
>
> > Where and why?
>
> Google is your
> friend:http://ma
Gary Herron wrote:
>>> A = [1,2,3]
>>> B = [4,5,6]
>>> C = [7,8,9]
>>> A+B+C
[1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> sum([A,B,C], [])
[1, 2, 3, 4, 5, 6, 7, 8, 9]
Careful now, this can be very slow. sum uses __add__, not __iadd__, which gives
this approach quadratic worst-case runtime.
- Ande
> - AMD64 (or x86-64 or x64 or EMT64 or Intel64) is a 64-bit instruction
> set from AMD which is an extension to the i386 instruction set, and runs
> 32-bit (and 16-bit) i386-code natively. But, and this is important,
> despite the name the instruction set is also used by Intel (though they
> call
Hi, is there any possible way to get the class or class name inside a method
decorator? For example in the code sample below:
def decorate(func):
print type(func)
return func
class myclass:
@decorate
def foo(self):
pass
The output of this program will be the type of the supplied fun
On Jul 26, 4:08 am, Nikolaus Rath <[EMAIL PROTECTED]> wrote:
> Terry Reedy <[EMAIL PROTECTED]> writes:
> > Nikolaus Rath wrote:
> >> Terry Reedy <[EMAIL PROTECTED]> writes:
> >>> Torsten Bronger wrote:
> Hallöchen!
> >>> > And why does this make the implicit insertion of "self" difficult?
> >
On Jul 27, 2:56 am, Nikolaus Rath <[EMAIL PROTECTED]> wrote:
> Terry Reedy <[EMAIL PROTECTED]> writes:
> >> What he wants is to write
>
> > > class foo:
> >> def bar(arg):
> >> self.whatever = arg + 1
>
> >> instead of
>
> >> class foo:
> >> def bar(self, arg)
> >> self.whateve
DaveM wrote:
On Sun, 27 Jul 2008 16:57:14 +0200, "Diez B. Roggisch" <[EMAIL PROTECTED]>
You'll have guessed, I'm sure, that I'm not a professional programmer. This
was the third rewrite of a program to match candidate groups to examiners on
a three day course I run, necessitated on this occasi
Can you tell us what you mean by "several names of one object"? You mean
this?
a = range(10)
b = a
id(a) == id(b)
? Passing references instead of values is an extremely important concept
of many languages, without it you would end up copying most of the time.
OK. I've obviously been thin
On Sun, 27 Jul 2008 16:41:19 +0200, "Diez B. Roggisch" <[EMAIL PROTECTED]>
wrote:
>You obviously aren't aware of the pitfalls regarding the mis-use of or
>and and for this usage.
Well, yes, I am (and the way around the problem), but as its never caught me
out (so far), I hadn't considered it.
Steven D'Aprano wrote:
On Sun, 27 Jul 2008 10:23:06 +0800, Marcus.CM wrote:
Well after reading some of these posts on "sacred python cow" on the
"self" , i would generally feel that most programmers who started with
C++/Java would find it odd.
You know, there are some programmers who haven
On Sat, 26 Jul 2008 21:46:31 -0700, s0suk3 wrote:
> (It's true that C++ has more OO features than Python, like private/
> public members, virtual methods, etc.
Oh yeah, again the discussion about `private`/`public` and if that's an
important OOP feature. :-)
Aren't *all* methods in Python "vir
Hi
I have created a group called architectgurus (http://groups.google.com/
group/architectgurus) or [EMAIL PROTECTED] .
Irrespective of technology, vendor, domain I will be discussing and
share my thoughts in homogenous and harmonious way. If you are
interested even you can join and contribute y
DaveM schrieb:
On Sun, 27 Jul 2008 16:57:14 +0200, "Diez B. Roggisch" <[EMAIL PROTECTED]>
wrote:
Marc 'BlackJack' Rintsch schrieb:
On Sun, 27 Jul 2008 16:41:19 +0200, Diez B. Roggisch wrote:
DaveM schrieb:
Getting back to the list concatenation, I finally found the itertools.chain
command w
DaveM wrote:
On Sun, 27 Jul 2008 16:57:14 +0200, "Diez B. Roggisch" <[EMAIL PROTECTED]>
wrote:
Marc 'BlackJack' Rintsch schrieb:
On Sun, 27 Jul 2008 16:41:19 +0200, Diez B. Roggisch wrote:
DaveM schrieb:
Getting back to the list concatenation, I finally found the iter
On Sun, 27 Jul 2008 16:57:14 +0200, "Diez B. Roggisch" <[EMAIL PROTECTED]>
wrote:
>Marc 'BlackJack' Rintsch schrieb:
>> On Sun, 27 Jul 2008 16:41:19 +0200, Diez B. Roggisch wrote:
>>
>>> DaveM schrieb:
Getting back to the list concatenation, I finally found the
itertools.chain
co
On Jul 28, 1:26 am, ssecorp <[EMAIL PROTECTED]> wrote:
> I might be misunderstanding OP but:
>
> a+b+c+d+e is simple way of concatenating 5 lists...
>
> as a function that takes any amount of lists and concatenates them:
> def concat(*args):
> c = []
> for elem in args:
>
>
> So import STDOUT and make stderr=STDOUT in the Popen call, you will then
> have one file/pipe to deal with p1.stdout.
Thank you - that works great!
Mahesh
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 27, 1:41�am, Peter Otten <[EMAIL PROTECTED]> wrote:
> Mensanator wrote:
> > I don't know why you're using stdin if you're reading from a file.
>
> From Francesco's initial post in his previous thread I inferred that he had
> a script like
>
> f = open("xxx.pdb")
> for line in f:
> � � # proc
I might be misunderstanding OP but:
a+b+c+d+e is simple way of concatenating 5 lists...
as a function that takes any amount of lists and concatenates them:
def concat(*args):
c = []
for elem in args:
c += elem
return c
don't know if extend is faster or slo
Marc 'BlackJack' Rintsch schrieb:
On Sun, 27 Jul 2008 16:41:19 +0200, Diez B. Roggisch wrote:
DaveM schrieb:
Getting back to the
list concatenation, I finally found the itertools.chain command which
is the most compact and fastest (or second fastest by a trivial amount,
I can't remember which)
On Sun, 27 Jul 2008 16:41:19 +0200, Diez B. Roggisch wrote:
> DaveM schrieb:
>> Getting back to the
>> list concatenation, I finally found the itertools.chain command which
>> is the most compact and fastest (or second fastest by a trivial amount,
>> I can't remember which). Along the way, I must
DaveM wrote:
On Sun, 27 Jul 2008 05:24:36 -0700 (PDT), alex23 <[EMAIL PROTECTED]> wrote:
On Jul 27, 10:13 pm, ssecorp <[EMAIL PROTECTED]> wrote:
I have seen somewhere that you can write something like:
x*x if x>10
but exactly that doesn't work and I can't get any variation
DaveM schrieb:
On Sun, 27 Jul 2008 05:24:36 -0700 (PDT), alex23 <[EMAIL PROTECTED]> wrote:
On Jul 27, 10:13 pm, ssecorp <[EMAIL PROTECTED]> wrote:
I have seen somewhere that you can write something like:
x*x if x>10
but exactly that doesn't work and I can't get any variation to work.
It'
On Sun, Jul 27, 2008 at 10:17 AM, DaveM <[EMAIL PROTECTED]> wrote:
> On Sun, 27 Jul 2008 05:24:36 -0700 (PDT), alex23 <[EMAIL PROTECTED]>
> wrote:
>
> >On Jul 27, 10:13 pm, ssecorp <[EMAIL PROTECTED]> wrote:
> >> I have seen somewhere that you can write something like:
>
> >> x*x if x>10
> >> but
On Sun, 27 Jul 2008 05:24:36 -0700 (PDT), alex23 <[EMAIL PROTECTED]> wrote:
>On Jul 27, 10:13 pm, ssecorp <[EMAIL PROTECTED]> wrote:
>> I have seen somewhere that you can write something like:
>> x*x if x>10
>> but exactly that doesn't work and I can't get any variation to work.
>It's called a t
King wrote:
> I have a text file and contents are:
>
> Help="""
> Code is written by xteam.
> """
> value = 0.0
>
>
> How do I read this file like python syntax. What I mean is first
> readline operation should return complete declaration of 'Help'
> variable. If I evaluate this string then it s
Lie wrote:
> I'm more concerned about the number of modules imported by making an
> error (from 30 on the startup to 187) and the side-effect of making an
> error, which makes modules such as xml.*/email.* that previously
> doesn't exist get imported out of the blue...
Using my system Python (2.5.
I have a text file and contents are:
Help="""
Code is written by xteam.
"""
value = 0.0
How do I read this file like python syntax. What I mean is first
readline operation should return complete declaration of 'Help'
variable. If I evaluate this string then it should create a 'Help'
variable wit
wrote in news:7ae96aff-c1a7-4763-8db7-
[EMAIL PROTECTED] in comp.lang.python:
> Hi folks,
>
> I am trying to tee off both stdout and stderr from a process run
> through Popen.
> As a test, I am first trying to print the output below:
>
> from subprocess import Popen,PIPE
> ...
> p1 = Popen(['cv
1 - 100 of 120 matches
Mail list logo