Re: Attack a sacred Python Cow

2008-07-27 Thread castironpi
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

Re: Python program as daemon?

2008-07-27 Thread Lawrence D'Oliveiro
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

Re: How to find processes from Python

2008-07-27 Thread Lawrence D'Oliveiro
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

Command line arguements

2008-07-27 Thread aditya shukla
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

Re: Attack a sacred Python Cow

2008-07-27 Thread Russ P.
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

Re: I love "shelf" BUT

2008-07-27 Thread alex23
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

Re: Where is the correct round() method?

2008-07-27 Thread Gary Herron
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

Re: Attack a sacred Python Cow

2008-07-27 Thread Russ P.
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]

Re: Command line arguements

2008-07-27 Thread Henry Chang
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

Re: Attack a sacred Python Cow

2008-07-27 Thread Russ P.
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

Re: Attack a sacred Python Cow

2008-07-27 Thread alex23
> > > > 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

Re: How to figure out if the platform is 32bit or 64bit?

2008-07-27 Thread Manuel Vazquez Acosta
-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

Re: Attack a sacred Python Cow

2008-07-27 Thread Russ P.
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

Re: Attack a sacred Python Cow

2008-07-27 Thread Michael Torrie
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

Re: Attack a sacred Python Cow

2008-07-27 Thread Terry Reedy
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

Re: Attack a sacred Python Cow

2008-07-27 Thread Michael Torrie
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

Re: write unsigned integer 32 bits to socket

2008-07-27 Thread Michael Torrie
[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

Re: Attack a sacred Python Cow

2008-07-27 Thread Russ P.
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*

Re: Attack a sacred Python Cow

2008-07-27 Thread s0suk3
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]

Re: Attack a sacred Python Cow

2008-07-27 Thread Carl Banks
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

<    1   2