Same code cause the different result.

2012-04-24 Thread 叶佑群
Hi, all I have code as: /pobj = subprocess.Popen (["smbpasswd", user], stdin =subprocess.PIPE) password += "\n" pobj.stdin.write (password) pobj.stdin.write (password)/ the command smbpasswd will change the samba user's password, In shel

Download now

2012-04-24 Thread lipoco...@yahoo.com
Download "Free Duplicate Remover v1.1 - 389 KB Detect and Remove Duplicate Files on your computer. By this free tool, you can help your computer work FASTER by removing unnecessary files. All you need to do is install this tool & start it. You'll get a list of redundant files that you'll have the c

Re: generate random numbers in a deterministic way

2012-04-24 Thread Temia Eszteri
Assuming you're using the Python's random module, which works based on the Mersenne Twister, you can preset the seed with random.seed(hashable). More details here: http://docs.python.org/library/random.html#random.seed ~Temia On Wed, 25 Apr 2012 07:51:18 +0200, you wrote: >Hi, > >I'm working wi

generate random numbers in a deterministic way

2012-04-24 Thread Jabba Laci
Hi, I'm working with some sorting algorithms and I want to compare their efficiency. One test fills a list with one million random integers, which serves as input for the algorithms. However, if this list is different each time I run the tests, the tests wouldn't be fair. At the moment the selecte

Re: from calendar import* doesn't import everything

2012-04-24 Thread Kiuhnm
On 4/25/2012 1:54, Rotwang wrote: On 25/04/2012 00:42, Kiuhnm wrote: On 4/25/2012 1:18, Rotwang wrote: Sorry if this is a stupid question, but what is up with this: >>> from calendar import* >>> Calendar Traceback (most recent call last): File "", line 1, in Calendar NameError: name 'Calendar

Re: from calendar import* doesn't import everything

2012-04-24 Thread Justin Ezequiel
see http://docs.python.org/tutorial/modules.html#importing-from-a-package http://stackoverflow.com/questions/2187583/whats-the-python-all-module-level-variable-for I know the 1st link is for importing from a package but the same applies for modules -- http://mail.python.org/mailman/listinfo/pytho

Re: from calendar import* doesn't import everything

2012-04-24 Thread Rotwang
On 25/04/2012 00:42, Kiuhnm wrote: On 4/25/2012 1:18, Rotwang wrote: Sorry if this is a stupid question, but what is up with this: >>> from calendar import* >>> Calendar Traceback (most recent call last): File "", line 1, in Calendar NameError: name 'Calendar' is not defined >>> from

Re: from calendar import* doesn't import everything

2012-04-24 Thread Kiuhnm
On 4/25/2012 1:18, Rotwang wrote: > Sorry if this is a stupid question, but what is up with this: > > >>> from calendar import* > >>> Calendar > > Traceback (most recent call last): > File "", line 1, in > Calendar > NameError: name 'Calendar' is not defined > >>> from calendar import Calenda

Re: from calendar import* doesn't import everything

2012-04-24 Thread Tim Chase
On 04/24/12 18:18, Rotwang wrote: Sorry if this is a stupid question, but what is up with this: >>> from calendar import* >>> Calendar Traceback (most recent call last): File "", line 1, in Calendar NameError: name 'Calendar' is not defined >>> from calendar import Calendar

Re: trying to use spec file

2012-04-24 Thread Ned Deily
In article , George Georgalis wrote: > I posted this yesterday to compiler-sig, but I'm not sure there is any > traffic there? > > There is a rather complex spec file for making rpm of python > interpreter, but I'm only seeing doc on making rpm packages (ie > programs); and, the spec file has

trying to use spec file

2012-04-24 Thread George Georgalis
Hi I posted this yesterday to compiler-sig, but I'm not sure there is any traffic there? There is a rather complex spec file for making rpm of python interpreter, but I'm only seeing doc on making rpm packages (ie programs); and, the spec file has difficult errors. Is anyone interested in the sp

Re: class versions and object deserialization

2012-04-24 Thread Ian Kelly
On Tue, Apr 24, 2012 at 1:02 AM, J. Mwebaze wrote: > We have classes of this form classA version1, classA version2, classA > version3 .. etc. This is same class that has been modified. Each > "modification" creates a new version of a class. Each object has a version > attribute which refers to the

Re: why () is () and [] is [] work in other way?

2012-04-24 Thread Kiuhnm
On 4/24/2012 15:25, rusi wrote: On Apr 24, 4:06 pm, Thomas Rachel wrote: Am 24.04.2012 08:02 schrieb rusi: On Apr 23, 9:34 am, Steven D'Apranowrote: "is" is never ill-defined. "is" always, without exception, returns True if the two operands are the same object, and False if they are no

Re: why () is () and [] is [] work in other way?

2012-04-24 Thread rusi
On Apr 24, 4:06 pm, Thomas Rachel wrote: > Am 24.04.2012 08:02 schrieb rusi: > > > On Apr 23, 9:34 am, Steven D'Aprano > +comp.lang.pyt...@pearwood.info>  wrote: > > >> "is" is never ill-defined. "is" always, without exception, returns True > >> if the two operands are the same object, and False i

Re: finding a regular expression in a file

2012-04-24 Thread Kushal Kumaran
On Apr 24, 2012 6:32 PM, "S.B" wrote: > > Hello friends. > > Newb question here. > I'm trying to find an efficient way to "grep" a file with python. > The problem is that all the solutions I find on the web read a line at a time from the file with a "for line in" loop and check each line for the R

Re: finding a regular expression in a file

2012-04-24 Thread Jussi Piitulainen
"S.B" writes: > Hello friends. > > Newb question here. > I'm trying to find an efficient way to "grep" a file with python. > The problem is that all the solutions I find on the web read a line > at a time from the file with a "for line in" loop and check each > line for the RE instead of sweeping

finding a regular expression in a file

2012-04-24 Thread S.B
Hello friends. Newb question here. I'm trying to find an efficient way to "grep" a file with python. The problem is that all the solutions I find on the web read a line at a time from the file with a "for line in" loop and check each line for the RE instead of sweeping through the entire file. T

Re: why () is () and [] is [] work in other way?

2012-04-24 Thread Kiuhnm
On 4/24/2012 8:02, rusi wrote: On Apr 23, 9:34 am, Steven D'Aprano wrote: "is" is never ill-defined. "is" always, without exception, returns True if the two operands are the same object, and False if they are not. This is literally the simplest operator in Python. Circular definition: In cas

Re: why () is () and [] is [] work in other way?

2012-04-24 Thread Thomas Rachel
Am 24.04.2012 08:02 schrieb rusi: On Apr 23, 9:34 am, Steven D'Aprano wrote: "is" is never ill-defined. "is" always, without exception, returns True if the two operands are the same object, and False if they are not. This is literally the simplest operator in Python. Circular definition: In

class versions and object deserialization

2012-04-24 Thread J. Mwebaze
We have classes of this form classA version1, classA version2, classA version3 .. etc. This is same class that has been modified. Each "modification" creates a new version of a class. Each object has a version attribute which refers to the version of the class from which it was derived. egObjectA.v