Hello, Everyone. I have a problem when using Pexpect module.

2010-11-04 Thread dachuan
hi, everyone. When I use Pexpect Module, I met the following problem and don't know how to handle it. Any advice is appreciated ! My environment: Linux node08_xen3.4.3_rhel5_1 2.6.18.8-xen #1 SMP Wed Jul 14 17:20:01 CST 2010 i686 i686 i386 GNU/Linux (FYI: this is a virtual machine.) Python 2.5.5

Re: Compare source code

2010-11-04 Thread rantingrick
On Nov 4, 9:47 pm, Rustom Mody wrote: > However the original question -- mixing > tabs and spaces is bad -- has got lost in the flames.  Do the most > die-hard python fanboys deny this? Hey we need to get something strait right now... i am the only true fanboy around here, all the others are pues

Re: Compare source code

2010-11-04 Thread Terry Reedy
On 11/4/2010 10:47 PM, Rustom Mody wrote: As far as I am concerned python would not be python if its indentation=structure went. However the original question -- mixing tabs and spaces is bad -- has got lost in the flames. Do the most die-hard python fanboys deny this? Of course not. Not mix

Re: Best method for a menu in a command line program?

2010-11-04 Thread Terry Reedy
On 11/4/2010 7:51 PM, Ben Finney wrote: Terry Reedy writes: Others have answered that, but I would point to the inefficiency for users of having to enter unit and value on two separate lines. The prompt could be "Enter value and unit (f, c, or k) or q to quit: " Allow upper and lower case, wit

Re: Compare source code

2010-11-04 Thread Rustom Mody
The real issue is not tabs/spaces vs braces but academic/scientific orientation vs engineering/commercial needs. Mostly these worlds are so far separated that no dialogue happens -- think C vs Pascal, Java vs Eiffel etc The problem -- actually advantage -- is that Python straddles both worlds. Mai

Re: subprocess.Popen not replacing current process?

2010-11-04 Thread Lawrence D'Oliveiro
In message <7c5be6d7-5782-44ad-aae7-7f7bbc798...@n32g2000prc.googlegroups.com>, goodman wrote: > Though I'm still a little confused how, if subprocess.Popen is using > os.execvp, it still maintains control of things like interrupts. The implied point, being that we are spawning subprocesses, is

Re: Compiling/Installing Python 2.7 on OSX 10.6

2010-11-04 Thread Jeremy
On Nov 4, 5:08 pm, Ned Deily wrote: > In article <6f087ce1-5391-4ee3-b92a-5a499fdf0...@semanchuk.com>, >  Philip Semanchuk wrote: > > > You might want to try this before running tar to see if it inhibits the ._ > > files: > > export COPYFILE_DISABLE=True > > > I know that tells tar to ignore thos

Re: Man pages and info pages

2010-11-04 Thread Tim Harig
On 2010-11-04, Ben Finney wrote: > As has been noted before, there is no intuitive interface except the > nipple. Everything else is not intuitive, but must be learned. What exactly is so intuitive about being slapped in the face followed by being slapped with a lawsuit? -- http://mail.python.or

C++ comment in Javadoc style -> reStructuredText compiler?

2010-11-04 Thread Xavier Ho
Hey all, Apologies if I am posting this in the wrong list. Does anyone know of a good compiler for javadoc comment style into reStructuredText, for Sphinx to chew? Cheers, Xavier -- http://mail.python.org/mailman/listinfo/python-list

Re: Man pages and info pages

2010-11-04 Thread Ben Finney
Tim Harig writes: > On 2010-11-04, Mark Wooding wrote: > > Tim Harig writes: > >> Actually, the left arrow key does not work at all intuitively. One > >> would expect that it should go back to the previous page as it > >> would in lynx, etc. It does not. > > > > It moves the cursor so you can h

Re: Passing File Objects into Subprocess.Popen

2010-11-04 Thread Christian Heimes
Am 04.11.2010 23:49, schrieb Brandon Harris: > What do you mean by rewind the file pointer before reading from it? > Seek back to the beginning? And It sounded very unlikely to me too, but > it's the only thing I have found that explains why a very verbose job > with tons of feedback locks up

Re: subprocess.Popen not replacing current process?

2010-11-04 Thread goodman
On Nov 4, 4:43 pm, Lawrence D'Oliveiro wrote: > In message > <0f1a17f4-b6a9-4e89-ac26-74b1098a0...@b19g2000prj.googlegroups.com>, goodman > wrote: > > > Hi, I'm wondering why subprocess.Popen does not seem to replace the > > current process, even when it uses os.execvp (according to the > > docume

Re: Best method for a menu in a command line program?

2010-11-04 Thread Ben Finney
braden faulkner writes: > Sorry, I wasn't aware it was doing that but... I've removed it :-) Thank you, it's good to keep a polite discourse going :-) -- \“I don't accept the currently fashionable assertion that any | `\ view is automatically as worthy of respect as any equal

Re: Best method for a menu in a command line program?

2010-11-04 Thread Ben Finney
Terry Reedy writes: > Others have answered that, but I would point to the inefficiency for > users of having to enter unit and value on two separate lines. The > prompt could be "Enter value and unit (f, c, or k) or q to quit: " > Allow upper and lower case, with or without a space between. Well

Re: subprocess.Popen not replacing current process?

2010-11-04 Thread goodman
On Nov 4, 1:22 am, goodman wrote: > Note: Our server is a Linux machine, but we're restricted to Python > 2.4. > > Hi, I'm wondering why subprocess.Popen does not seem to replace the > current process, even when it uses os.execvp (according to the > documentation:http://docs.python.org/library/sub

Re: subprocess.Popen not replacing current process?

2010-11-04 Thread Lawrence D'Oliveiro
In message <0f1a17f4-b6a9-4e89-ac26-74b1098a0...@b19g2000prj.googlegroups.com>, goodman wrote: > Hi, I'm wondering why subprocess.Popen does not seem to replace the > current process, even when it uses os.execvp (according to the > documentation: > http://docs.python.org/library/subprocess.html#s

Re: Compiling/Installing Python 2.7 on OSX 10.6

2010-11-04 Thread Ned Deily
In article <6f087ce1-5391-4ee3-b92a-5a499fdf0...@semanchuk.com>, Philip Semanchuk wrote: > You might want to try this before running tar to see if it inhibits the ._ > files: > export COPYFILE_DISABLE=True > > > I know that tells tar to ignore those files (resource forks, no?) when > building

Re: Man pages and info pages

2010-11-04 Thread Mark Wooding
Tim Harig writes: > Right, and in info with the default key bindings, backspace takes me > to the command help. I would have expected it to either scroll up the > page or take me to the previously visited node. Sounds like your terminal is misconfigured. Backspace should produce ^?, not ^H. (

Re: Passing File Objects into Subprocess.Popen

2010-11-04 Thread Brandon Harris
ok. Jumping back to the start of the file solved the problem. (file.seek(0)) Big thanks for that insight! Brandon L. Harris On 11/04/2010 05:49 PM, Brandon Harris wrote: What do you mean by rewind the file pointer before reading from it? Seek back to the beginning? And It sounded very unlik

Re: functions, list, default parameters

2010-11-04 Thread Mark Wooding
Lawrence D'Oliveiro writes: > Mediocre programmers with a hankering towards cleverness latch onto it > as an ingenious way of maintaing persistent context in-between calls > to a function, completely overlooking the fact that Python offers much > more straightforward, comprehensible, flexible, an

Re: functions, list, default parameters

2010-11-04 Thread Mark Wooding
Lawrence D'Oliveiro writes: > In message <20101021235138.609fe...@geekmail.invalid>, Andreas > Waldenburger wrote: > > While not very commonly needed, why should a shared default argument be > > forbidden? > > Because it’s safer to disallow it than to allow it. Scissors with rounded ends are saf

Re: Passing File Objects into Subprocess.Popen

2010-11-04 Thread Brandon Harris
What do you mean by rewind the file pointer before reading from it? Seek back to the beginning? And It sounded very unlikely to me too, but it's the only thing I have found that explains why a very verbose job with tons of feedback locks up at the same point and won't process at all. I did tr

Re: Passing File Objects into Subprocess.Popen

2010-11-04 Thread Antoine Pitrou
On Thu, 04 Nov 2010 17:13:09 -0500 Brandon Harris wrote: > I'm running python 2.5 and have bumped into an issue whereby the PIPE > in subprocess.Popen locks up after taking too many characters. I found > some documentation that discuss this problem and offers some ideas for > solutions, the b

Passing File Objects into Subprocess.Popen

2010-11-04 Thread Brandon Harris
I'm running python 2.5 and have bumped into an issue whereby the PIPE in subprocess.Popen locks up after taking too many characters. I found some documentation that discuss this problem and offers some ideas for solutions, the best one being to pass a file object into subprocess instead of PIP

Re: Compare source code

2010-11-04 Thread Seebs
On 2010-11-04, Terry Reedy wrote: > I am sorry you feel compelled to use a language you so dislike. Not our > fault though. I don't dislike it all that much. What I dislike is being told that the problems don't exist. > If you add the normally redundant information in the form of explicit > d

Re: Compare source code

2010-11-04 Thread Seebs
On 2010-11-04, Grant Edwards wrote: > It exists because so many people change whitespace intentionally in C > source code because no two C programmers seem able to agree on how to > format code. Diff -b allows you to attempt to ignore semantically > null stylistic changes made by programmers. I

Re: Final state of underlying sequence in islice

2010-11-04 Thread Terry Reedy
On 11/4/2010 12:42 PM, Shashank Singh wrote: Are there any promises made with regard to final state of the underlying sequence that islice slices? The one you quote below. for example consider this >>> from itertools import * >>> c = count() >>> list(islice(c, 1, 3, 50)) [1] >>> c.next(

Re: Compare source code

2010-11-04 Thread Tim Harig
On 2010-11-04, Grant Edwards wrote: > On 2010-11-04, Seebs wrote: >> On 2010-11-04, D'Arcy J.M. Cain wrote: >>> Right. If you mangle spaces in Python or mangle braces in C then >>> recovery becomes impossible. I don't think anyone is contesting that. >>> What we question is the idea that someh

Re: Man pages and info pages

2010-11-04 Thread Tim Harig
On 2010-11-04, Mark Wooding wrote: > Tim Harig writes: > >> When the GNU folk decided to clone *nix they decided that they knew >> better and simply decided to create their own interfaces. > > This isn't the case. Actually Info has a long history prior to GNU: it > was the way that the documenta

Re: How convert list to nested dictionary?

2010-11-04 Thread Arnaud Delobelle
macm writes: > Hi Folks > > How convert list to nested dictionary? > l > ['k1', 'k2', 'k3', 'k4', 'k5'] result > {'k1': {'k2': {'k3': {'k4': {'k5': {}} > > Regards > > macm reduce(lambda x,y: {y:x}, reversed(l), {}) -- Arnaud -- http://mail.python.org/mailman/listinfo/python-lis

Re: How convert list to nested dictionary?

2010-11-04 Thread Chris Rebert
> On 4 nov, 16:53, Chris Rebert wrote: >> On Thu, Nov 4, 2010 at 11:48 AM, macm wrote: >> > Hi Folks >> >> > How convert list to nested dictionary? >> >> l >> > ['k1', 'k2', 'k3', 'k4', 'k5'] >> result >> > {'k1': {'k2': {'k3': {'k4': {'k5': {}} >> >> We don't do homework. >> Hint:

Re: Best method for a menu in a command line program?

2010-11-04 Thread braden faulkner
Sorry, I wasn't aware it was doing that but... I've removed it :-) Sorry about that, Braden Faulkner -- http://mail.python.org/mailman/listinfo/python-list

Re: Compare source code

2010-11-04 Thread Tim Harig
On 2010-11-04, Mark Wooding wrote: > Tim Harig writes: > >> I use simple comments that are not effected by white space. I don't >> waste my time trying to make comments look artistic. They are there >> to convey information; not to look pretty. I really detest having to >> edit other peoples c

Re: using google app through python

2010-11-04 Thread Steve Holden
On 11/1/2010 5:05 AM, charu gangal wrote: > Hey! Can anyone help me with python script for reading google > spreadsheets? what all packages do i need to import to make the code > run successfully after deploying it on google environment..thnx in > advance I've found the xlrd module very usable. r

Re: How find all childrens values of a nested dictionary, fast!

2010-11-04 Thread Arnaud Delobelle
macm writes: > Hi Folks > > How find all childrens values of a nested dictionary, fast! > a = {'a' : {'b' :{'/' :[1,2,3,4], 'ba' :{'/' :[41,42,44]} ,'bc' :{'/':[51,52,54], 'bcd' :{'/':[68,69,66]}}},'c' :{'/' :[5,6,7,8]}}, 'ab' : {'/' :[12,13,14,15]}, 'ac' :{'/' :[21,22,23]}}

Re: How convert list to nested dictionary?

2010-11-04 Thread macm
Hi Chris Thanks for your hint. I am reading this http://www.amk.ca/python/writing/functional Do you have good links or books to me learn "Functional Programming"? but I am not asking "...because is easy but because is hard." Show me, please! if you can. Thanks is advance. Best regards macm

Re: Compiling/Installing Python 2.7 on OSX 10.6

2010-11-04 Thread Philip Semanchuk
On Nov 4, 2010, at 4:05 PM, Ned Deily wrote: > In article > <238cec6d-2f47-4c97-8941-e28e68089...@a9g2000pro.googlegroups.com>, > Jeremy wrote: > [...] >> I downloaded the source from python.org and extracted with 'tar -xzvf >> Python-2.7.tgz' My home space is on some network somewhere. I thi

Re: Compare source code

2010-11-04 Thread Terry Reedy
On 11/4/2010 4:17 AM, Seebs wrote: I am sorry you feel compelled to use a language you so dislike. Not our fault though. Other languages I use are mostly amenable to the development of tools to automatically indent code. Makefiles and Python are the only two exceptions... If you add the no

3rd party python module with pyd picking up wrong dlls

2010-11-04 Thread Pix
Hi, I'm trying to install OpenSSL by placing it in site-packages\OpenSSL. In the directory there the following files, crypto.pyd libeay32.dll rand.pyd SSL.pyd ssleay32.dll When i try to import the module by doing "import OpenSSL" i get an import error saying "ImportError: DLL load failed: The sp

Re: Allow multiline conditions and the like

2010-11-04 Thread Chris Rebert
On Thu, Nov 4, 2010 at 11:09 AM, Mark Wooding wrote: > Chris Rebert writes: >> Or, if possible, refactor the conditional into a function (call) so >> it's no longer multiline in the first place. > > No!  This /increases/ cognitive load for readers, because they have to > deal with the indirection

Re: Compare source code

2010-11-04 Thread Grant Edwards
On 2010-11-04, Seebs wrote: > On 2010-11-04, D'Arcy J.M. Cain wrote: >> Right. If you mangle spaces in Python or mangle braces in C then >> recovery becomes impossible. I don't think anyone is contesting that. >> What we question is the idea that somehow Python is special in this >> regard. If

Re: Compare source code

2010-11-04 Thread Seebs
On 2010-11-04, D'Arcy J.M. Cain wrote: > Right. If you mangle spaces in Python or mangle braces in C then > recovery becomes impossible. I don't think anyone is contesting that. > What we question is the idea that somehow Python is special in this > regard. If you move files around in ways that

Re: Compare source code

2010-11-04 Thread Mark Wooding
Tim Harig writes: > I use simple comments that are not effected by white space. I don't > waste my time trying to make comments look artistic. They are there > to convey information; not to look pretty. I really detest having to > edit other peoples comment formatting where you have to re-alig

Re: Compare source code

2010-11-04 Thread Seebs
On 2010-11-04, Mark Wooding wrote: > Seebs writes: >> Python's the only language I use where an obvious flaw, which is >> repeatedly observed by everyone I know who uses the language, is >> militantly and stridently defended by dismissing, insulting, and >> attacking the character and motives of

Re: Best method for a menu in a command line program?

2010-11-04 Thread Terry Reedy
On 11/3/2010 9:19 PM, braden faulkner wrote: I'm using a menu for my command line app using this method. choice = "foobar" while choice != "q": if choice == "c": temp = input("Celsius temperature:") print "Fahrenheit:",celsius_to_fahrenheit(temp) elif choice == "f":

Re: Best method for a menu in a command line program?

2010-11-04 Thread D'Arcy J.M. Cain
On Thu, 4 Nov 2010 19:46:28 + (UTC) Grant Edwards wrote: > I don't know whether it's that somebody is bragging about having a > blackberry/iphone (whoop-de-friggin-do!), or that having one is > somehow a valid excuse for poorly-written postings. I'm not It's really just a matter of not knowi

Re: Compare source code

2010-11-04 Thread D'Arcy J.M. Cain
On Thu, 4 Nov 2010 19:37:25 + (UTC) Tim Harig wrote: > On 2010-11-04, D'Arcy J.M. Cain wrote: > You are the one who seems to be on a crusade against against braces. It You totally misunderstand me. I am not on a crusade of any sort. I am happy with Python and the number of other people wh

Re: Compiling/Installing Python 2.7 on OSX 10.6

2010-11-04 Thread Ned Deily
In article <238cec6d-2f47-4c97-8941-e28e68089...@a9g2000pro.googlegroups.com>, Jeremy wrote: [...] > I downloaded the source from python.org and extracted with 'tar -xzvf > Python-2.7.tgz' My home space is on some network somewhere. I think > the network filesystem creates the ._ at the beginn

Re: Ways of accessing this mailing list?

2010-11-04 Thread Mark Wooding
John Bond writes: > Hope this isn't too O/T - I was just wondering how people read/send to > this mailing list, eg. normal email client, gmane, some other software > or online service? > > My normal inbox is getting unmanageable, and I think I need to find a > new way of following this and other

Re: Python documentation too difficult for beginners

2010-11-04 Thread News123
On 11/02/2010 02:42 PM, Steven D'Aprano wrote: > However, there is a Python wiki. It doesn't get anywhere near as much > love as it deserves, and (I think) the consensus was that the official > Python docs should stay official, but link to the wiki for user- > contributed content. This hasn't ha

Re: Best method for a menu in a command line program?

2010-11-04 Thread Grant Edwards
On 2010-11-04, Ned Deily wrote: > Ben Finney wrote: >> brf...@gmail.com writes: >> > Thanks again, >> > Braden Faulkner >> > >> > Sent wirelessly from my BlackBerry device on the Bell network. >> > Envoy?? sans fil par mon terminal mobile BlackBerry sur le r??seau de Bell. >> >> Please show yo

Re: Final state of underlying sequence in islice

2010-11-04 Thread Ned Deily
In article , Shashank Singh wrote: > Are there any promises made with regard to final state of the underlying > sequence that islice slices? [...] > While "fixing" this should be rather easy in terms of the change in code > required it might break any code depending > on this seemingly incorrec

Re: Compare source code

2010-11-04 Thread Tim Harig
On 2010-11-04, D'Arcy J.M. Cain wrote: > On Thu, 4 Nov 2010 17:55:55 + (UTC) > Tim Harig wrote: >> What Seebs is refering to is that it is difficult or impossible to >> re-indent Python source automatically after the indent structure has been >> broken (such as his email being converted to ht

Re: Compiling/Installing Python 2.7 on OSX 10.6

2010-11-04 Thread Jeremy
On Nov 4, 1:23 pm, Ned Deily wrote: > In article > <3d9139ae-bd6f-4567-bb02-b21a8ba86...@o15g2000prh.googlegroups.com>, > > > > > >  Jeremy wrote: > > I'm having trouble installing Python 2.7 on OSX 10.6  I was able to > > successfully compile it from source, but ran into problems when I did > >

Re: Man pages and info pages

2010-11-04 Thread Mark Wooding
Tim Harig writes: > When the GNU folk decided to clone *nix they decided that they knew > better and simply decided to create their own interfaces. This isn't the case. Actually Info has a long history prior to GNU: it was the way that the documentation was presented at the MIT AI lab. In fact

Re: Compare source code

2010-11-04 Thread Tim Harig
On 2010-11-04, Mark Wooding wrote: > Tim Harig writes: > This is wishful thinking. Firstly, code written with a narrow > indentation offset (e.g., two spaces) can take up an uncomfortable width > when viewed with a wider offset. I can accept that as a trade-off. People have different ideas abo

Re: Compiling/Installing Python 2.7 on OSX 10.6

2010-11-04 Thread Ned Deily
In article <3d9139ae-bd6f-4567-bb02-b21a8ba86...@o15g2000prh.googlegroups.com>, Jeremy wrote: > I'm having trouble installing Python 2.7 on OSX 10.6 I was able to > successfully compile it from source, but ran into problems when I did > make install. The error I got (I received many similar e

Re: Best method for a menu in a command line program?

2010-11-04 Thread Ned Deily
In article <87wrotfhj2@benfinney.id.au>, Ben Finney wrote: > brf...@gmail.com writes: > > Thanks again, > > Braden Faulkner > > > > Sent wirelessly from my BlackBerry device on the Bell network. > > Envoyé sans fil par mon terminal mobile BlackBerry sur le réseau de Bell. > > Please show yo

Re: Compare source code

2010-11-04 Thread Mark Wooding
Tim Harig writes: > So, your telling me that mixing tabs and spaces is considered a good > practice in Haskell? It doesn't seem to be a matter which is discussed much. I think Haskell programmers are used to worrying their brains with far more complicated things like wobbly[1] types. > I would

Re: How convert list to nested dictionary?

2010-11-04 Thread Chris Rebert
On Thu, Nov 4, 2010 at 11:48 AM, macm wrote: > Hi Folks > > How convert list to nested dictionary? > l > ['k1', 'k2', 'k3', 'k4', 'k5'] result > {'k1': {'k2': {'k3': {'k4': {'k5': {}} We don't do homework. Hint: Iterate through the list in reverse order, building up your result. Usi

How convert list to nested dictionary?

2010-11-04 Thread macm
Hi Folks How convert list to nested dictionary? >>> l ['k1', 'k2', 'k3', 'k4', 'k5'] >>> result {'k1': {'k2': {'k3': {'k4': {'k5': {}} Regards macm -- http://mail.python.org/mailman/listinfo/python-list

Re: Compare source code

2010-11-04 Thread D'Arcy J.M. Cain
On Thu, 4 Nov 2010 17:55:55 + (UTC) Tim Harig wrote: > What Seebs is refering to is that it is difficult or impossible to > re-indent Python source automatically after the indent structure has been > broken (such as his email being converted to html on the server or a web Right. If you mangl

Re: Compare source code

2010-11-04 Thread Neil Cerutti
On 2010-11-04, Grant Edwards wrote: > On 2010-11-04, Neil Cerutti wrote: >> On 2010-11-04, D'Arcy J.M. Cain wrote: * Not being able to write an auto-indenter, ever, because it is by design theoretically impossible: Annoying. >>> >>> Right. And in C you can never write an auto-bracer

Re: Allow multiline conditions and the like

2010-11-04 Thread Mark Wooding
Chris Rebert writes: > Or, if possible, refactor the conditional into a function (call) so > it's no longer multiline in the first place. No! This /increases/ cognitive load for readers, because they have to deal with the indirection through the name. If you actually use the function multiple

Re: How find all childrens values of a nested dictionary, fast!

2010-11-04 Thread Peter Otten
macm wrote: > About Peter script > > I am receiving > for v in f(a['a']['b']): > ... b.extend(v) > ... > Traceback (most recent call last): > File "", line 2, in > TypeError: 'int' object is not iterable > > I am trying understand this error. You are probably mixing Diez' implement

Re: How find all childrens values of a nested dictionary, fast!

2010-11-04 Thread macm
Peter Ok! Both works fine! Thanks a lot! >>> for v in f(a['a']['b']): ... b.extend(v) b Now I will try find which script is the fast! Regards macm On 4 nov, 15:56, macm wrote: > Hi Folks > > Thanks a lot > > Script from Diez works: > > print list(f(a)) > > but should be > > print lis

Re: Compare source code

2010-11-04 Thread Tim Harig
On 2010-11-04, MRAB wrote: > On 04/11/2010 16:49, Mark Wooding wrote: >> Seebs writes: >>* I don't have many problems with tools trashing whitespace in Python >> programs, though I have seen web forum software mangling >> indentation; since this makes nontrivial chunks of almost any

Re: How find all childrens values of a nested dictionary, fast!

2010-11-04 Thread macm
Hi Folks Thanks a lot Script from Diez works: print list(f(a)) but should be print list(f(a['a']['b'])) to fit my example. About Peter script I am receiving >>> for v in f(a['a']['b']): ... b.extend(v) ... Traceback (most recent call last): File "", line 2, in TypeError: 'int' obj

Re: Compare source code

2010-11-04 Thread Tim Harig
On 2010-11-04, Neil Cerutti wrote: > On 2010-11-04, D'Arcy J.M. Cain wrote: Seebs Wrote: >>> * Not being able to write an auto-indenter, ever, because it >>> is by design theoretically impossible: Annoying. >> >> Right. And in C you can never write an auto-bracer for exactly >> the same reason.

Re: Compare source code

2010-11-04 Thread Tim Harig
On 2010-11-04, Mark Wooding wrote: > Tim Harig writes: > >> Python is the only language that I know that *needs* to specify tabs >> versus spaces since it is the only language I know of which uses >> whitespace formating as part of its syntax and structure. > > You need to get out more. Miranda,

Re: Compare source code

2010-11-04 Thread Emile van Sebille
On 11/4/2010 7:15 AM Neil Cerutti said... The handsome ':' terminator of if/elif/if statements allows us to omit a newline, conserving vertical space. This improves the readability of certain constructs. if x: print(x) elif y: print(y) else: print() Analogously, x+=1;y=f(x);return We don't h

Re: What people are using to access this mailing list

2010-11-04 Thread Peter Pearson
On Wed, 3 Nov 2010 08:02:29 + (UTC), John Bond wrote: > Hope this isn't too O/T - I was just wondering how people read/send to this > mailing list, eg. normal email client, gmane, some other software or online > service? Usenet via a server at news.individual.net, newsgroup name comp.lang.p

Re: Compare source code

2010-11-04 Thread MRAB
On 04/11/2010 16:49, Mark Wooding wrote: Seebs writes: Python's the only language I use where an obvious flaw, which is repeatedly observed by everyone I know who uses the language, is militantly and stridently defended by dismissing, insulting, and attacking the character and motives of anyon

Re: How find all childrens values of a nested dictionary, fast!

2010-11-04 Thread Peter Otten
macm wrote: > How find all childrens values of a nested dictionary, fast! > a = {'a' : {'b' :{'/' :[1,2,3,4], 'ba' :{'/' :[41,42,44]} ,'bc' :{'/':[51,52,54], 'bcd' :{'/':[68,69,66]}}},'c' :{'/' :[5,6,7,8]}}, 'ab' : {'/' :[12,13,14,15]}, 'ac' :{'/' :[21,22,23]}} a['a'] > {'c': {'/':

Re: Compare source code

2010-11-04 Thread Grant Edwards
On 2010-11-04, Neil Cerutti wrote: > On 2010-11-04, D'Arcy J.M. Cain wrote: >>> * Not being able to write an auto-indenter, ever, because it >>> is by design theoretically impossible: Annoying. >> >> Right. And in C you can never write an auto-bracer for exactly >> the same reason. > > It's not

Re: How find all childrens values of a nested dictionary, fast!

2010-11-04 Thread Diez B. Roggisch
macm writes: > Hi Folks > > How find all childrens values of a nested dictionary, fast! There is no faster than O(n) here. > a = {'a' : {'b' :{'/' :[1,2,3,4], 'ba' :{'/' :[41,42,44]} ,'bc' :{'/':[51,52,54], 'bcd' :{'/':[68,69,66]}}},'c' :{'/' :[5,6,7,8]}}, 'ab' : {'/' :[12,13,1

Re: Compare source code

2010-11-04 Thread Neil Cerutti
On 2010-11-04, D'Arcy J.M. Cain wrote: >> * Not being able to write an auto-indenter, ever, because it >> is by design theoretically impossible: Annoying. > > Right. And in C you can never write an auto-bracer for exactly > the same reason. It's not right, actually. Auto-indent is fairly easy i

Re: Compare source code

2010-11-04 Thread Mark Wooding
Tim Harig writes: > Python is the only language that I know that *needs* to specify tabs > versus spaces since it is the only language I know of which uses > whitespace formating as part of its syntax and structure. You need to get out more. Miranda, Gofer, Haskell, F#, make(1), and many others

Re: Compare source code

2010-11-04 Thread Mark Wooding
Seebs writes: > Python's the only language I use where an obvious flaw, which is > repeatedly observed by everyone I know who uses the language, is > militantly and stridently defended by dismissing, insulting, and > attacking the character and motives of anyone who suggests that it > might be a

sigaction?

2010-11-04 Thread Neal Becker
Why doesn't python signal support sigaction? I'm interested in trying sigaction with SA_RESTART to prevent interrupted system calls. Or, would the usage of SA_RESTART within python cause other problems? -- http://mail.python.org/mailman/listinfo/python-list

Re: DateTime object

2010-11-04 Thread M.-A. Lemburg
jf wrote: > Hi, > > I've a bug in my code and I'm trying de reproduce it. > > To trace the bug I print arguments, and it produces this: > {'date': } > > My question is: what is: ? > > I use mx.DateTime put if I print it I get: > > > So what kind of object is ? You might be using the old Pyt

Re: Compare source code

2010-11-04 Thread John Nagle
On 10/31/2010 6:52 AM, jf wrote: Le 31/10/2010 13:10, Martin v. Loewis a écrit : I've a project with tabs and spaces mixed (yes I know it's bad). I edit each file to remove tabs, but it's so easy to make a mistake. Do you know a tools to compare the initial file with the cleaned one to know if

Re: functions, list, default parameters

2010-11-04 Thread Robert Kern
On 11/4/10 2:07 AM, Lawrence D'Oliveiro wrote: In message, Robert Kern wrote: On 11/2/10 2:12 AM, Lawrence D'Oliveiro wrote: In message, Robert Kern wrote: "Immutable objects" are just those without an obvious API for modifying them. They are ones with NO legal language constructs for mod

Final state of underlying sequence in islice

2010-11-04 Thread Shashank Singh
Hi, Apologies if this has been discussed in this list before. Google has not been very helpful in locating any such previous discussion. Are there any promises made with regard to final state of the underlying sequence that islice slices? for example consider this >>> from itertools import * >>>

Re: Compare source code

2010-11-04 Thread D'Arcy J.M. Cain
On 04 Nov 2010 08:17:10 GMT Seebs wrote: > Outside of people who seem to be deeply emotionally invested in insisting > that it is never, at all, in ANY way, for ANY person, annoying, it seems > to be pretty consistent to observe that, benefits or no benefits, it has > some kind of non-zero annoyan

How find all childrens values of a nested dictionary, fast!

2010-11-04 Thread macm
Hi Folks How find all childrens values of a nested dictionary, fast! >>> a = {'a' : {'b' :{'/' :[1,2,3,4], 'ba' :{'/' :[41,42,44]} ,'bc' >>> :{'/':[51,52,54], 'bcd' :{'/':[68,69,66]}}},'c' :{'/' :[5,6,7,8]}}, 'ab' : >>> {'/' :[12,13,14,15]}, 'ac' :{'/' :[21,22,23]}} >>> a['a'] {'c': {'/': [5, 6

Re: Compare source code

2010-11-04 Thread Lawrence D'Oliveiro
In message , Seebs wrote: > The question is *why* diff has that option. > > The answer is because whitespace changes (spaces to tabs, different > tab stops, etcetera) are an extremely common failure mode, such that > it's quite common for files to end up with unintentional whitespace > changes.

Re: Python documentation too difficult for beginners

2010-11-04 Thread Lawrence D'Oliveiro
In message , Cameron Simpson wrote: > But its weakness is stuff like this: > > http://epydoc.sourceforge.net/stdlib/Canvas.Polygon-class.html > > Automatic docness, no useful information. But it Conforms to Documentation-Production Metrics as decreed by the Corporate Task Force on Policy. S

Re: Allowing comments after the line continuation backslash

2010-11-04 Thread Lawrence D'Oliveiro
In message , Chris Rebert wrote: > Actually, my PEP 8 reference was in regards to the (imo, terrible) > UseOfCamelCaseForNonClasses (Python != C#), not the formatting of the > for-loop; hence the "In any case" qualification. Hmm ... OK, I might accept that particular criticism. I have to say it’

Re: Compare source code

2010-11-04 Thread Lawrence D'Oliveiro
In message , Seebs wrote: > It is extremely useful to me to have spaces converted to tabs > for every other file I edit. I’m thinking of going the other way. After many years of treating tabs as four-column steps, I might give up on them and use spaces everywhere. -- http://mail.python.org/mail

Re: functions, list, default parameters

2010-11-04 Thread Lawrence D'Oliveiro
In message , Robert Kern wrote: > On 11/2/10 2:12 AM, Lawrence D'Oliveiro wrote: > >> In message, Robert >> Kern wrote: >> >>> "Immutable objects" are just those without an obvious API for modifying >>> them. >> >> They are ones with NO legal language constructs for modifying them. Hint: >> if a

Re: Man pages and info pages

2010-11-04 Thread Lawrence D'Oliveiro
In message <1bdce24e-4406-44c5-9133-bfd0acd02...@p1g2000yqm.googlegroups.com>, rustom wrote: > The printed python docs come to several thousand pages. Do we want them > to be 1 manpage? a hundred? a thousand? Perl managed to condense a lot of useful information into a handful of man pages. --

Re: Allowing comments after the line continuation backslash

2010-11-04 Thread Lawrence D'Oliveiro
In message , Roy Smith wrote: >> > > That URL takes me to a github page. Can you be more specific about > which file I should be looking at? The extract I previously quoted was from dvd_menu_animator. > 2) You have provided comments for each function,

Re: execute shell script from python, needs sys.argv

2010-11-04 Thread Peter Otten
Matt wrote: > I am trying to execute a shell script from within python.. This shell > script takes the format, where $1 and $2 are variables from the > command line: cat $1 | Fastx_trimmer -n COUNT -o $2 > > straight into the cmd line it would be: cat file.1 | Fastx_trimmer -n > COUNT -o file.2

Re: execute shell script from python, needs sys.argv

2010-11-04 Thread Benjamin Kaplan
On Thu, Nov 4, 2010 at 11:37 AM, Matt wrote: > Hi All, > > I am trying to execute a shell script from within python..  This shell > script takes the format, where $1 and $2 are variables from the > command line: cat $1 | Fastx_trimmer -n COUNT -o $2 > > straight into the cmd line it would be:  cat

Re: Popen Question

2010-11-04 Thread Alain Ketterlin
moogyd writes: import os, subprocess os.environ['MYVAR'] = "myval" p = subprocess.Popen(['echo', '$MYVAR'],shell=True) p = subprocess.Popen(['echo', '$MYVAR']) $MYVAR > p = subprocess.Popen('echo $MYVAR',shell=True) myval > p = subprocess.Popen('echo $

execute shell script from python, needs sys.argv

2010-11-04 Thread Matt
Hi All, I am trying to execute a shell script from within python.. This shell script takes the format, where $1 and $2 are variables from the command line: cat $1 | Fastx_trimmer -n COUNT -o $2 straight into the cmd line it would be: cat file.1 | Fastx_trimmer -n COUNT -o file.2 So, know that

Re: [ANN] pyOpenSSL 0.11 released

2010-11-04 Thread Giampaolo Rodolà
2010/11/1 : > Hello all, > > I'm happy to announce the release of pyOpenSSL 0.11.  The primary change > from the last release is that Python 3.2 is now supported.  Python 2.4 > through Python 2.7 are still supported as well.  This release also fixes a > handful of bugs in error handling code.  It

Re: cms 4 static pages?

2010-11-04 Thread Daniel Fetchinson
> m looking 4 a framework, that allows to build static community software > (similar to facebook) without having to start scripts, database > connects, admin cookies, e.t.c. > > means - should be dynamic without really being dynamic, delivering just > static pages. (yes, i know e.g. nginx does that

Re: Popen Question

2010-11-04 Thread Ravi
On Nov 4, 7:06 pm, moogyd wrote: > Hi, > I usually use csh for my simulation control scripts, but these scripts > are becoming more complex, so I plan to use python for the next > project. > To this end, I am looking at subprocess.Popen() to actually call the > simulations, and have a very basic q

  1   2   >