Re: while True or while 1

2010-12-12 Thread Paul Rubin
Steven D'Aprano writes: > I'm actually quite fond of the look of "while 1:", and sometimes use it, > not because it's faster, but just because I like it. for v in itertools.repeat(True): ... ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: while True or while 1

2010-12-12 Thread Steven D'Aprano
On Sun, 12 Dec 2010 23:20:40 -0500, Steve Holden wrote: > On 12/12/2010 2:32 PM, Christian Heimes wrote: [...] >> No argue with that! I was merely making a point that "while 1" executes >> different byte code than "while True". Readability is important but >> sometimes speed is of the essence. "wh

Re: Is there any way to SSH from Python ?!

2010-12-12 Thread Darshak Bavishi
i am trying from last week but no luck !! one thing only found that pexpect it not useful in windows pls help out of this On Mon, Dec 13, 2010 at 10:39 AM, Chris Rebert wrote: > On Sun, Dec 12, 2010 at 9:03 PM, Darshak Bavishi > wrote: > > Hi Experts, > > I need to know that is there any way t

Re: Is there any way to SSH from Python ?!

2010-12-12 Thread Chris Rebert
On Sun, Dec 12, 2010 at 9:03 PM, Darshak Bavishi wrote: > Hi Experts, > I need to know that is there any way to SSH (From Windows Host) to Unix > machine ?! > If Yes than How ? http://www.lag.net/paramiko/ Did you try googling "ssh python"? Cheers, Chris -- http://blog.rebertia.com -- http://m

Is there any way to SSH from Python ?!

2010-12-12 Thread Darshak Bavishi
Hi Experts, I need to know that is there any way to SSH (From Windows Host) to Unix machine ?! If Yes than How ? Because when i use telenet it not showing the no result !! As earlier it was suggested that i should try with exit first and than read_all() but still issue persist and getting hang

Re: while True or while 1

2010-12-12 Thread Steve Holden
On 12/12/2010 2:32 PM, Christian Heimes wrote: > Am 12.12.2010 19:31, schrieb Steve Holden: >> > Would you care to quantify how much CPU time that optimization will >> > typically save for a loop of fair magnitude (say, a billion iterations)? > The difference is minimal but measurable for very tigh

Re: Python on wikipedia

2010-12-12 Thread Bill Allen
Yeah, I noticed that a while back too. Kinda cool. --Bill On Sun, Dec 12, 2010 at 3:21 PM, DevPlayer wrote: > Snapshot in time, hey look at that; someone used Python as THE example > of what a programming language is on Wikipedia. > http://en.wikipedia.org/wiki/Programming_language > -- > htt

Re: Directly calling python's function arguments dispatcher

2010-12-12 Thread Peter Otten
Pascal Chambon wrote: > I've encountered several times, when dealing with adaptation of function > signatures, the need for explicitly resolving complex argument sets into > a simple variable mapping. Explanations. > > > Consider that function: > > def foo(a1, a2, *args, **kwargs): > pass

Re: Python on wikipedia

2010-12-12 Thread Terry Reedy
On 12/12/2010 4:38 PM, pakalk wrote: On 12 Gru, 22:21, DevPlayer wrote: Snapshot in time, hey look at that; someone used Python as THE example of what a programming language is on Wikipedia.http://en.wikipedia.org/wiki/Programming_language aand? what is the catch? Wikipedia ent

Tkinter polling example: file copy with progress bar

2010-12-12 Thread JohnWShipman
Attached below is a Tkinter script that demonstrates polling, that is, performing a long-running process in parallel with the GUI. The script asks for an input file name and an output file name and copies the input file to the output file. The copy operation is done in a child process managed wit

Re: while True or while 1

2010-12-12 Thread Steven D'Aprano
On Sun, 12 Dec 2010 16:33:41 +0100, Krister Svanlund wrote: > On Sun, Dec 12, 2010 at 3:14 PM, Max Countryman wrote: >> I'm sure this has been brought up many times, but a quick Googling >> didn't yield the decisive results I was hoping for, so I apologize if >> this has already been addressed in

Directly calling python's function arguments dispatcher

2010-12-12 Thread Pascal Chambon
Hello I've encountered several times, when dealing with adaptation of function signatures, the need for explicitly resolving complex argument sets into a simple variable mapping. Explanations. Consider that function: def foo(a1, a2, *args, **kwargs): pass calling foo(1, a2=2, a3=3) wi

Re: Python on wikipedia

2010-12-12 Thread pakalk
On 12 Gru, 22:21, DevPlayer wrote: > Snapshot in time, hey look at that; someone used Python as THE example > of what a programming language is on > Wikipedia.http://en.wikipedia.org/wiki/Programming_language aand? what is the catch? -- http://mail.python.org/mailman/listinfo/python

Python on wikipedia

2010-12-12 Thread DevPlayer
Snapshot in time, hey look at that; someone used Python as THE example of what a programming language is on Wikipedia. http://en.wikipedia.org/wiki/Programming_language -- http://mail.python.org/mailman/listinfo/python-list

Re: while True or while 1

2010-12-12 Thread Martin v. Loewis
>> Python is designed to provide readable code. Writing >> >> while True: >> ... >> >> is much more legible than its pre-True couterpart >> >> while 1: >> ... > > No argue with that! I actually want to argue with that: I find "while 1" more legible. That's probably because

Re: Wanted: slow regexes

2010-12-12 Thread Alexander Gattin
Hello, On Wed, Dec 08, 2010 at 04:24:02PM +, MRAB wrote: > Interestingly, that webpage says that: > > ("a" x 10) =~ /^(ab?)*$/ > > caused Perl to segfault. I tried it and it didn't segfault, but it > didn't match either It doesn't segfault but produces a warning with -w: xr...@xrgtn-

Re: while True or while 1

2010-12-12 Thread Christian Heimes
Am 12.12.2010 19:31, schrieb Steve Holden: > Would you care to quantify how much CPU time that optimization will > typically save for a loop of fair magnitude (say, a billion iterations)? The difference is minimal but measurable for very tight loops. $ python -m timeit -n20 -- "i = 0" "while 1:"

Re: Reading by positions plain text files

2010-12-12 Thread Tim Harig
On 2010-12-12, Tim Harig wrote: >> I used .seek() in this manner, but is not working. > > It is working the way it is supposed to. > If you want the absolute position in a column: > > f = open('somefile.txt', 'r').read().splitlines() > for column in f: > variable = column

Re: Needed: Real-world examples for Python's Cooperative Multiple Inheritance

2010-12-12 Thread Daniel Urban
> So far, the only situation I can find where method names necessarily > overlap is for the basics like __init__(), close(), flush(), and > save() where multiple parents need to have their own initialization > and finalization. One other possibility is subclasses of the JSONEncoder class. For exam

Re: Reading by positions plain text files

2010-12-12 Thread Tim Harig
On 2010-12-12, javivd wrote: > On Dec 1, 7:15 am, Tim Harig wrote: >> On 2010-12-01, javivd wrote: >> > On Nov 30, 11:43 pm, Tim Harig wrote: >> >> encodings and how you mark line endings.  Frankly, the use of the >> >> world columns in the header suggests that the data *is* separated by >> >>

Re: while True or while 1

2010-12-12 Thread Steve Holden
On 12/12/2010 10:30 AM, Christian Heimes wrote: > Am 12.12.2010 15:14, schrieb Max Countryman: >> I'm sure this has been brought up many times, but a quick Googling didn't >> yield the decisive results I was hoping for, so I apologize if this has >> already been addressed in great detail somewher

Re: stuck with Pexpect script need help!!

2010-12-12 Thread Alexander Kapps
On 12.12.2010 17:06, Emile van Sebille wrote: On 12/10/2010 10:02 PM Darshak Bavishi said... Pexpect is intended for UNIX-like operating systems.""") Can we use pexpect from windows host machine ?! I expect not... Emile According to [1] you might get it working with the Cygwin port o

Re: Ways of accessing this mailing list?

2010-12-12 Thread Emile van Sebille
On 12/12/2010 2:07 AM Harishankar said... On Sun, 12 Dec 2010 19:18:52 +1100, Ben Finney wrote: That's a function of the person typing into it, not of the program. I was talking about the default program behaviour. Yes, you can move the cursor up or down, but I was talking about the way regul

Re: stuck with Pexpect script need help!!

2010-12-12 Thread Emile van Sebille
On 12/10/2010 10:02 PM Darshak Bavishi said... Pexpect is intended for UNIX-like operating systems.""") Can we use pexpect from windows host machine ?! I expect not... Emile -- http://mail.python.org/mailman/listinfo/python-list

Re: Objects and validation

2010-12-12 Thread pakalk
On 12 Gru, 15:28, pyt...@lists.fastmail.net wrote: > I have a routine in Python which is extracting information from a > website. This information is read and inserted into objects. > > I currently have all the validations and checks implemented in the > routines which are reading the HTML and crea

Re: while True or while 1

2010-12-12 Thread Krister Svanlund
On Sun, Dec 12, 2010 at 3:14 PM, Max Countryman wrote: > I'm sure this has been brought up many times, but a quick Googling didn't > yield the decisive results I was hoping for, so I apologize if this has > already been addressed in great detail somewhere else. > > I am wondering what the ration

Re: while True or while 1

2010-12-12 Thread Christian Heimes
Am 12.12.2010 15:14, schrieb Max Countryman: > I'm sure this has been brought up many times, but a quick Googling didn't > yield the decisive results I was hoping for, so I apologize if this has > already been addressed in great detail somewhere else. > > I am wondering what the rationale is beh

while True or while 1

2010-12-12 Thread Max Countryman
I'm sure this has been brought up many times, but a quick Googling didn't yield the decisive results I was hoping for, so I apologize if this has already been addressed in great detail somewhere else. I am wondering what the rationale is behind preferring while True over while 1? For me, it see

Re: Reading by positions plain text files

2010-12-12 Thread javivd
On Dec 1, 7:15 am, Tim Harig wrote: > On 2010-12-01, javivd wrote: > > > > > > > > > > > On Nov 30, 11:43 pm, Tim Harig wrote: > >> On 2010-11-30, javivd wrote: > > >> > I have a case now in wich anotherfilehas been provided (besides the > >> > database) that tells me in wich column of thefilei

Objects and validation

2010-12-12 Thread python
I have a routine in Python which is extracting information from a website. This information is read and inserted into objects. I currently have all the validations and checks implemented in the routines which are reading the HTML and creating the objects. It is however also possible to move all th

Re: python-parser running Beautiful Soup needs to be reviewed

2010-12-12 Thread Stef Mientki
I've no opinion. >> I'm just struggling with BeautifulSoup myself, finding it one of the >> toughest libs I've seen ;-) > > Really? While I'm by no means an expert, I find it very easy to work with. > It's very well > structured IMHO. I think the cause lies in the documentation. The PySide docume

Re: class browser

2010-12-12 Thread rusi
On Dec 8, 11:24 pm, Adam Tauno Williams wrote: > On Wed, 2010-12-08 at 13:18 +0530, Rustom Mody wrote: > > If I have a medium to large python code base to browse/study, what are > > the class browsers available? > > Monodevelop has good Python support which includes a working Python > class browse

Get careers in Management stage.

2010-12-12 Thread gaurav
Great careers in Management work. Institutional careers in Management http://topcareer.webs.com/humanresourcemgmt.htm & http://rojgars.webs.com/bankingjobs.htm Full ranges of Banking and insurance banking jobs, railway jobs opportunities to make career. http://rojgars.webs.com/bankingjobs.htm --

Re: default argument in method

2010-12-12 Thread Chris Rebert
On Sun, Dec 12, 2010 at 3:35 AM, ernest wrote: > Hi, > > I'd like to have a reference to an instance attribute as > default argument in a method. It doesn't work because > "self" is not defined at the time the method signature is > evaluated. For example: > > class C(object): >    def __init__(sel

default argument in method

2010-12-12 Thread ernest
Hi, I'd like to have a reference to an instance attribute as default argument in a method. It doesn't work because "self" is not defined at the time the method signature is evaluated. For example: class C(object): def __init__(self): self.foo = 5 def m(self, val=self.foo):

Re: Bind C++ program for use with both Python 2.x and 3.x

2010-12-12 Thread Stefan Behnel
Peter C., 11.12.2010 23:41: Hello, I am looking at the possibility of making a program in C++. The catch is it will require the ability to work with binding for use with scripting in both Python 2.x and 3.x for various tool plugins. Do I read this right that you want your program to be written

Re: Ways of accessing this mailing list?

2010-12-12 Thread Harishankar
On Sun, 12 Dec 2010 19:18:52 +1100, Ben Finney wrote: > That's a function of the person typing into it, not of the program. I was talking about the default program behaviour. Yes, you can move the cursor up or down, but I was talking about the way regular e-mail clients generally handle quoted

Re: Ways of accessing this mailing list?

2010-12-12 Thread Ben Finney
Harishankar writes: > The advantage of a proper newsreader [program] is that it quotes > correctly (i.e. quote at top, reply below). That's a function of the person typing into it, not of the program. Placing the cursor at the top of the message allows the person to trim the superfluous parts o