Re: Obtaining a full path name from file

2011-05-25 Thread Ulrich Eckhardt
RVince wrote: > s = "C:\AciiCsv\Gravity_Test_data\A.csv" > f = open(s,"r") > > How do I obtain the full pathname given the File, f? Apart from the issue that the 'name' attribute is only the name used to open the file, there is another issue, though not on the platform you're using: Multiple di

Re: Code Review

2011-05-25 Thread Peter Otten
ad wrote: > Please review the code pasted below. I am wondering what other ways > there are of performing the same tasks. This was typed using version > 3.2. The script is designed to clean up a directory (FTP, Logs, etc.) > Basically you pass two arguments. The first argument is an number of > da

Re: Obtaining a full path name from file

2011-05-25 Thread Tim Golden
On 25/05/2011 07:36, Ulrich Eckhardt wrote: RVince wrote: s = "C:\AciiCsv\Gravity_Test_data\A.csv" f = open(s,"r") How do I obtain the full pathname given the File, f? Apart from the issue that the 'name' attribute is only the name used to open the file, there is another issue, though not on

Re: English Idiom in Unix: Directory Recursively

2011-05-25 Thread Thorsten Kampe
* Rikishi42 (Wed, 25 May 2011 00:06:06 +0200) > > On 2011-05-24, Steven D'Aprano wrote: > >>> I think that is a patronizing remark that under-estimates the > >>> intelligence of lay people and over-estimates the difficulty of > >>> understanding recursion. > >> > >> Why would you presume this to

Re: Why did Quora choose Python for its development?

2011-05-25 Thread Thorsten Kampe
* Chris Angelico (Wed, 25 May 2011 08:01:38 +1000) > > On Wed, May 25, 2011 at 3:39 AM, D'Arcy J.M. Cain wrote: > > One of my favorite quotes (not sure if it was about Perl or APL) is "I > > refuse to use a programming language where the proponents of it stick > > snippets under each other's nos

Re: File access denied after subprocess completion on Windows platform

2011-05-25 Thread Tim Golden
On 24/05/2011 21:18, Claudiu Nicolaie CISMARU wrote: Now. There is one more issue. Seems that on faster computers and/or Windows 7 (the Win32 thing I have tested on a HVM Xen machine with Windows XP) the os.rename is too fast after fp.close() and generates the same Exception. The code follows: c

Re: Code Review

2011-05-25 Thread Chris Torek
In article <37ba7b40-3663-4094-b507-696fc598b...@l26g2000yqm.googlegroups.com> ad wrote: >Please review the code pasted below. I am wondering what other ways >there are of performing the same tasks. ... I imagine one enhancement >would be to create a function out of some of this. Indeed -- "rec

BEST WAY TO EARN DOLLARS FROM COMPANY JUST SUBSCRIBE AND SEE , JOIN NOW

2011-05-25 Thread shoba kasthuri
shoba.1...@rediffmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: English Idiom in Unix: Directory Recursively

2011-05-25 Thread Xah Lee
On May 25, 12:26 am, Thorsten Kampe wrote: > * Rikishi42 (Wed, 25 May 2011 00:06:06 +0200) > > > > > > > > > > > > > On 2011-05-24, Steven D'Aprano wrote: > > >>> I think that is a patronizing remark that under-estimates the > > >>> intelligence of lay people and over-estimates the difficulty of

Re: English Idiom in Unix: Directory Recursively

2011-05-25 Thread Chris Angelico
On Wed, May 25, 2011 at 5:51 PM, Xah Lee wrote: > well said. > > half of posts in this thread are from idiots. just incredible, but > again, its newsgroups ... what am i thinking ... > >  Xah > Thank you. As soon as we figure out which half of us you just publicly insulted, we'll see about gettin

Re: Code Review

2011-05-25 Thread Ulrich Eckhardt
ad wrote: > Please review the code pasted below. I am wondering what other ways > there are of performing the same tasks. On a unix system, you would call "find" with according arguments and then handle the found files with "-exec rm ..." or something like that, but I see you are on MS Windows.

pyGTK identify a button

2011-05-25 Thread Tracubik
Hi all, i'm trying to write a simple windows with two button in GTK, i need a way to identify wich button is pressed. Consider that: the two button are connected (when clicked) to infoButton(self, widget, data=None) infoButton() is something like this infoButton(self, widget, data=None):

Re: File access denied after subprocess completion on Windows platform

2011-05-25 Thread Claudiu Nicolaie CISMARU
> There used to be a problem with subprocess fds being held by > a traceback. IIRC, the problem could be triggered by having > an except clause around a subprocess call within which something > attempted to, eg, > remove one of the affected files. I have no subprocess call.. in this last issue.

Re: pyGTK identify a button

2011-05-25 Thread Claudiu Nicolaie CISMARU
> the two button are connected (when clicked) to infoButton(self, > widget, > data=None) From documentation: handler_id = object.connect(name, func, func_data) So: button1.connect(when is pressed, your_function, 1) button2.connect(when is pressed, your_function, 2) (This code is conception, I

Re: Hotshoting recursive function

2011-05-25 Thread Gabriel Genellina
En Sun, 22 May 2011 10:42:08 -0300, Selvam escribió: I am using hotshot module to profile my python function. I used the details from ( http://code.activestate.com/recipes/576656-quick-python-profiling-with-hotshot/ ). The function I profile is a recursive one and I am getting the followin

Re: Link errors embedding Python 3.2

2011-05-25 Thread Chris Angelico
Followup. I'm now using Python 3.3 straight from Mercurial, and am seeing the same issues. I've managed to get the compilation step to succeed by naming the library for full inclusion and adding -lutil -ldl (sounding rather Donizetti there), and my program runs. However, it's unable to import all i

Re: pyGTK identify a button

2011-05-25 Thread Tracubik
On 25/05/2011 10:44, Claudiu Nicolaie CISMARU wrote: the two button are connected (when clicked) to infoButton(self, widget, data=None) From documentation: handler_id = object.connect(name, func, func_data) So: button1.connect(when is pressed, your_function, 1) button2.connect(when is presse

Re: pyGTK identify a button

2011-05-25 Thread Chris Angelico
On Wed, May 25, 2011 at 6:18 PM, Tracubik wrote: > Hi all, > i'm trying to write a simple windows with two button in GTK, i need a way to > identify wich button is pressed. > Consider that: > > the two button are connected (when clicked) to infoButton(self, widget, > data=None) I'm not terribly f

Re: pyGTK identify a button

2011-05-25 Thread Claudiu Nicolaie CISMARU
> thanks but, as i've sayed before, i can't use func_data 'cause i don't > know how to set it on glade3.8, that is the program i use to create > the > GUI. > Anyway, i think this is the only way to identify the button :-/ Hack into the generated source! -- Claudiu Nicolaie CISMARU GNU GPG

Re: Beginner needs advice

2011-05-25 Thread Jean-Michel Pichavant
Lew Schwartz wrote: So, if I read between the lines correctly, you recommend Python 3? Does the windows version install with a development environment? If you want to use python 3, make sure before that all the good stuff you need (==modules) have been ported to python 3. If you are a complet

Re: pexpect: TIMEOUT no longer clears child.before

2011-05-25 Thread Gabriel Genellina
En Thu, 19 May 2011 08:29:21 -0300, Adrian Casey escribió: The behaviour of pexpect has changed between version 2.1 and 2.3. In version 2.1, the following code would result in child.before being cleared -: >>>child.expect(pexpect.TIMEOUT,1) In version 2.3, this is no longer the case.

[pyodbc] Setting values to SQL_* constants while creating a connection

2011-05-25 Thread srinivasan munisamy
Hi, I would like to know how to set values to values to SQL_* constants while creating a db connection through pyodbc module. For example, i am getting a connection object like below: In [27]: dbh1 = pyodbc.connect("DSN=;UID= ;PWD=;DATABASE=;APP=") In [28]: dbh1.getinfo(pyodbc.SQL_DESCRIBE_PARAM

Re: English Idiom in Unix: Directory Recursively

2011-05-25 Thread Steven D'Aprano
On Wed, 25 May 2011 08:14:27 +1000, Chris Angelico wrote: > On Wed, May 25, 2011 at 3:40 AM, Xah Lee wrote: >> On May 23, 9:28 pm, Chris Angelico wrote: >>> Because I do not consider its behaviour to be errant. And I suspect >>> its main developers won't either. That's why I suggested you grab t

Re: Obtaining a full path name from file

2011-05-25 Thread Dave Angel
On 01/-10/-28163 02:59 PM, RVince wrote: s = "C:\AciiCsv\Gravity_Test_data\A.csv" f = open(s,"r") How do I obtain the full pathname given the File, f? (which should equal "C:\AciiCsv\Gravity_Test_data"). I've tried all sorts of stuff and am just not finding it. Any help greatly appreciated !

ANN: eGenix mxODBC - Python ODBC Database Interface 3.1.1

2011-05-25 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC - Python ODBC Database Interface Version 3.1.1 mxODBC is our commercially supported Python extension providing ODBC database connectivity to Py

Re: Why did Quora choose Python for its development?

2011-05-25 Thread Roy Smith
In article , Dennis Lee Bieber wrote: > On Tue, 24 May 2011 13:39:02 -0400, "D'Arcy J.M. Cain" > declaimed the following in gmane.comp.python.general: > > > > My point was that even proponents of the language can make a > > significant error based on the way the variable is named. It's like

Re: Why did Quora choose Python for its development?

2011-05-25 Thread Chris Angelico
On Wed, May 25, 2011 at 9:36 PM, Roy Smith wrote: > Remembering that I, J, K, L, M, and N were integer was trivial if you > came from a math background.  And, of course, Fortran was all about > math, so that was natural.  Those letters are commonly used for integers > in formulae.  If I write $ x

Re: Why did Quora choose Python for its development?

2011-05-25 Thread John Bokma
Dennis Lee Bieber writes: > Python books than after six months of trying to understand PERL... And Perl is the language, and perl is what runs Perl. -- John Bokma j3b Blog: http://johnbokma.com/Perl Consultancy: http://cast

Re: Why did Quora choose Python for its development?

2011-05-25 Thread John Bokma
Thorsten Kampe writes: > * Chris Angelico (Wed, 25 May 2011 08:01:38 +1000) >> >> On Wed, May 25, 2011 at 3:39 AM, D'Arcy J.M. Cain wrote: >> > One of my favorite quotes (not sure if it was about Perl or APL) is > "I >> > refuse to use a programming language where the proponents of it stick >>

Unable to make ironpython run in browser with silverlight

2011-05-25 Thread ErichCart ErichCart
Basically i am following this tutorial: http://blog.jimmy.schementi.com/2010/03/pycon-2010-python-in-browser.html According to it, this code should run fine: http://www.w3.org/TR/html4/strict.dtd";> http://gestalt.ironpython.net/dlr-20100305.js";> http://github.com/jschementi/ pyco

mresh

2011-05-25 Thread Vijayakumar Vijayakumar
website --> www.srilakshmi.infoinyohyou -- http://mail.python.org/mailman/listinfo/python-list

Re: Why did Quora choose Python for its development?

2011-05-25 Thread Roy Smith
In article , Chris Angelico wrote: > On Wed, May 25, 2011 at 9:36 PM, Roy Smith wrote: > > Remembering that I, J, K, L, M, and N were integer was trivial if you > > came from a math background.  And, of course, Fortran was all about > > math, so that was natural.  Those letters are commonly use

Re: Beginner needs advice

2011-05-25 Thread Colin J. Williams
On 25-May-11 02:22 AM, Lew Schwartz wrote: So, if I read between the lines correctly, you recommend Python 3? Does the windows version install with a development environment? It would be safer to stick with Python 2.7 initially and then consider the transition to 3.2 later. No, there is not

Newbie string questions

2011-05-25 Thread Matty Sarro
Hey everyone, This is a super noob question, so please be gentle. I am working my way through "Learn Python the Hard Way" using both python 2.7 and python 3.1 (I want to get a handle on the differences between the two - the intention to write things in python 3 but be able to understand things from

Re: Newbie string questions

2011-05-25 Thread Chris Angelico
On Wed, May 25, 2011 at 11:06 PM, Matty Sarro wrote: > Right now what is stumping me... what exactly does %r do? You're talking about the formatting operator? It's like the repr function: http://docs.python.org/library/functions.html#repr Chris Angelico -- http://mail.python.org/mailman/listin

Re: Newbie string questions

2011-05-25 Thread Chris Guidry
On Wednesday, May 25, 2011 9:06:02 AM UTC-4, Matty Sarro wrote: > can't seem to find some of the items in the documentation. Right now > what is stumping me... what exactly does %r do? I can't find it in the > documentation anywhere. Matty, %r in a format string is very much like %s. %s calls str

Re: Newbie string questions

2011-05-25 Thread Matty Sarro
Thanks guys! I appreciate it. I was wondering why %r was always showing things enclosed in single-quotes. On Wed, May 25, 2011 at 9:13 AM, Chris Guidry wrote: > On Wednesday, May 25, 2011 9:06:02 AM UTC-4, Matty Sarro wrote: >> can't seem to find some of the items in the documentation. Right now

FW: python

2011-05-25 Thread Shawnta Henman
python We should take a look at how this latest good fortune is going to change your lifestyle. Don't you remember all of those times I said how hard it's been just to get by? Alright you know what?, Your computer is going to be your very best pal once you try out this thing for one month's tim

Re: Unable to make ironpython run in browser with silverlight

2011-05-25 Thread ErichCart ErichCart
Here is how it looks on free webhosting account: http://silverlighttest.zzl.org/silverlighttest.html It is supposed to show a window with "Hello from python", but it shows smth else completely. -- http://mail.python.org/mailman/listinfo/python-list

Re: Code Review

2011-05-25 Thread ad
On May 25, 4:06 am, Ulrich Eckhardt wrote: > ad wrote: > > Please review the code pasted below. I am wondering what other ways > > there are of performing the same tasks. > > On a unix system, you would call "find" with according arguments and then > handle the found files with "-exec rm ..." or s

Re: Why did Quora choose Python for its development?

2011-05-25 Thread D'Arcy J.M. Cain
On Wed, 25 May 2011 07:36:40 -0400 Roy Smith wrote: > Remembering that I, J, K, L, M, and N were integer was trivial if you > came from a math background. And, of course, Fortran was all about The easiest way to remember was that the first two letters of INteger gave you the range. -- D'Arcy

Re: Why did Quora choose Python for its development?

2011-05-25 Thread Chris Angelico
On Thu, May 26, 2011 at 12:23 AM, D'Arcy J.M. Cain wrote: > The easiest way to remember was that the first two letters of INteger > gave you the range. > G for Green and R for Right, which are the first two letters of Green. (I wonder how many Pythonistas are familiar with that?) Chris Angelico

Re: Code Review

2011-05-25 Thread Iain King
On May 25, 2:44 pm, ad wrote: > On May 25, 4:06 am, Ulrich Eckhardt > wrote: > > > > > ad wrote: > > > Please review the code pasted below. I am wondering what other ways > > > there are of performing the same tasks. > > > On a unix system, you would call "find" with according arguments and then

Re: Why did Quora choose Python for its development?

2011-05-25 Thread Steven D'Aprano
On Wed, 25 May 2011 10:23:59 -0400, D'Arcy J.M. Cain wrote: > On Wed, 25 May 2011 07:36:40 -0400 > Roy Smith wrote: >> Remembering that I, J, K, L, M, and N were integer was trivial if you >> came from a math background. And, of course, Fortran was all about > > The easiest way to remember was

Kind of OT - Books on software development?

2011-05-25 Thread Matty Sarro
Hey everyone, I am looking at some projects coming up, which may or may not involve python. So I figured I would throw the question out there and see what everyone thinks. I am looking for some books on software engineering/development... something that discusses techniques from ideation, up throug

Re: Why did Quora choose Python for its development?

2011-05-25 Thread Matty Sarro
I hate using L for anything, namely because if you type it lowercase you always have to wonder if its an l or a 1 in a terminal window. -Matthew On Wed, May 25, 2011 at 10:56 AM, Steven D'Aprano wrote: > On Wed, 25 May 2011 10:23:59 -0400, D'Arcy J.M. Cain wrote: > >> On Wed, 25 May 2011 07:36:40

Re: Kind of OT - Books on software development?

2011-05-25 Thread Ed Keith
I do not have my library with me, but I remember a book that fits the bill exactly, is was from Microsoft Press, I think it was called "Writing Solid Code" Hope this helps, -EdK Ed Keith e_...@yahoo.com Blog: edkeith.blogspot.com --- On Wed, 5/25/11, Matty Sarro wrote: > From: Matty Sar

Re: Kind of OT - Books on software development?

2011-05-25 Thread gregarican
On May 25, 11:45 am, Ed Keith wrote: > I do not have my library with me, but I remember a book that fits the bill > exactly, is was from Microsoft Press, I think it was called "Writing Solid > Code" > > Hope this helps, > >    -EdK > > Ed Keith > e_...@yahoo.com > > Blog: edkeith.blogspot.com >

Re: Kind of OT - Books on software development?

2011-05-25 Thread Verde Denim
Hey everyone, I am looking at some projects coming up, which may or may not involve python. So I figured I would throw the question out there and see what everyone thinks. I am looking for some books on software engineering/development... something that discusses techniques from ideation, up throug

Re: pyGTK identify a button

2011-05-25 Thread Cousin Stanley
Tracubik wrote: > Hi all, > i'm trying to write a simple windows with two button in GTK, > i need a way to identify wich button is pressed. > #!/usr/bin/env python import gtk def console_display( button , args ) : a0 , a1 , a2 = args print '%s %s %s ' % ( a0 , a1 , a2

Re: Why did Quora choose Python for its development?

2011-05-25 Thread Terry Reedy
On 5/25/2011 8:01 AM, John Bokma wrote: to. Like I already stated before: if Python is really so much better than Python readability wise, why do I have such a hard time dropping Perl and moving on? [you meant 'than Perl'] You are one of the people whose brain fits Perl (or vice versa) better

Re: Why did Quora choose Python for its development?

2011-05-25 Thread Ethan Furman
Terry Reedy wrote: On 5/25/2011 8:01 AM, John Bokma wrote: to. Like I already stated before: if Python is really so much better than Python readability wise, why do I have such a hard time dropping Perl and moving on? [you meant 'than Perl'] You are one of the people whose brain fits Perl (o

Re: Kind of OT - Books on software development?

2011-05-25 Thread Ed Keith
--- On Wed, 5/25/11, Ed Keith wrote: > I do not have my library with me, but > I remember a book that fits the bill exactly, is was from > Microsoft Press, I think it was called "Writing Solid Code" I have done some research at amazon.com, and while "Writing Solid Code" is an excellent book tha

super() in class defs?

2011-05-25 Thread Jess Austin
I may be attempting something improper here, but maybe I'm just going about it the wrong way. I'm subclassing http.server.CGIHTTPRequestHandler, and I'm using a decorator to add functionality to several overridden methods. def do_decorate(func): . def wrapper(self): . if appropriate(): .

Cherrypy

2011-05-25 Thread Bryton
Is anyone having a step by step tutorial of cherrypy(or book title).I have used the tutorial in their site as well as the book (cherrypy essentials) and I would like to have a one that is a bit more step by step...Please help... -- Regards, Bryton. -- http://mail.python.org/mailman/listinfo/p

Newbie question about SQLite + Python and twitter

2011-05-25 Thread Jayme Proni Filho
Helo guys, I'm building a local application for twitter for my brother's store. I'm in the beginning and I have some newbie problems, so: I create a table called tb_messages with int auto increment and varchar(140) fields; I did three SQL funcionts, insert_tweet, delete_tweet, select_tweet selec

Re: super() in class defs?

2011-05-25 Thread Ian Kelly
On Wed, May 25, 2011 at 11:54 AM, Jess Austin wrote: > So I guess that when super() is called in the context of a class def > rather than that of a method def, it doesn't have the information it > needs. Now I'll probably just say: > >    do_GET = do_decorate(CGIHTTPRequestHandler.do_GET) > > but

Re: Why did Quora choose Python for its development?

2011-05-25 Thread John Bokma
Ethan Furman writes: > Terry Reedy wrote: >> On 5/25/2011 8:01 AM, John Bokma wrote: >> >>> to. Like I already stated before: if Python is really so much better >>> than Python readability wise, why do I have such a hard time dropping >>> Perl and moving on? >> >> [you meant 'than Perl'] You are

Python 3.2 bug? Reading the last line of a file

2011-05-25 Thread tkp...@hotmail.com
The following function that returns the last line of a file works perfectly well under Python 2.71. but fails reliably under Python 3.2. Is this a bug, or am I doing something wrong? Any help would be greatly appreciated. import os def lastLine(filename): ''' Returns the last line of

bdist_wininst: install_script not run on uninstall

2011-05-25 Thread Wilbert Berendsen
Hi, according to the docs the installer bdist_wininst creates will run the install-script on install with -install (which works perfectly) and on uninstall with the -remove argument (which seemingly never happens). However I want to cleanup some registry stuff on uninstall so I want the uninst

Re: Python 3.2 bug? Reading the last line of a file

2011-05-25 Thread MRAB
On 25/05/2011 20:33, tkp...@hotmail.com wrote: The following function that returns the last line of a file works perfectly well under Python 2.71. but fails reliably under Python 3.2. Is this a bug, or am I doing something wrong? Any help would be greatly appreciated. import os def lastLine(fi

Re: super() in class defs?

2011-05-25 Thread Eric Snow
On Wed, May 25, 2011 at 12:31 PM, Ian Kelly wrote: > On Wed, May 25, 2011 at 11:54 AM, Jess Austin > wrote: > > So I guess that when super() is called in the context of a class def > > rather than that of a method def, it doesn't have the information it > > needs. Now I'll probably just say: > >

Re: Python 3.2 bug? Reading the last line of a file

2011-05-25 Thread Ian Kelly
On Wed, May 25, 2011 at 2:00 PM, MRAB wrote: > You're opening the file in text mode, and seeking relative to the end > of the file is not allowed in text mode, presumably because the file > contents have to be decoded, and, in general, seeking to an arbitrary > position within a sequence of encode

using masks and numpy record arrays

2011-05-25 Thread Catherine Moroney
Hello, I am trying to work with a structured array and a mask, and am encountering some problems. For example: >>> xtype = numpy.dtype([("n", numpy.int32), ("x", numpy.float32)]) >>> a = numpy.zeros((4), dtype=xtype) >>> b = numpy.arange(0,4) >>> a2 = numpy.zeros((4), dtype=xtype) >>> mask =

Re: Why did Quora choose Python for its development?

2011-05-25 Thread Matty Sarro
On Wed, May 25, 2011 at 3:14 PM, John Bokma wrote: > Ethan Furman writes: > >> Terry Reedy wrote: >>> On 5/25/2011 8:01 AM, John Bokma wrote: >>> to. Like I already stated before: if Python is really so much better than Python readability wise, why do I have such a hard time dropping >>

Re: using masks and numpy record arrays

2011-05-25 Thread Robert Kern
On 5/25/11 3:27 PM, Catherine Moroney wrote: Hello, I am trying to work with a structured array and a mask, and am encountering some problems. You will want to ask numpy questions on the numpy mailing list: http://www.scipy.org/Mailing_Lists For example: >>> xtype = numpy.dtype([("n", n

Re: Why did Quora choose Python for its development?

2011-05-25 Thread theg...@nospam.net
On 5/24/2011 1:39 PM, D'Arcy J.M. Cain wrote: [snip] One of my favorite quotes (not sure if it was about Perl or APL) is "I refuse to use a programming language where the proponents of it stick snippets under each other's nose and say 'I bet you can't guess what this does.'" I dunno. That sounds

Re: super() in class defs?

2011-05-25 Thread Steven D'Aprano
On Wed, 25 May 2011 12:31:33 -0600, Ian Kelly wrote: > I would recommend against using super() in general. > > http://fuhm.net/super-harmful/ If you actually read that article, carefully, without being fooled by the author's provocative ex-title and misleading rhetoric, you will discover that

Re: Python 3.2 bug? Reading the last line of a file

2011-05-25 Thread MRAB
On 25/05/2011 21:54, Ian Kelly wrote: On Wed, May 25, 2011 at 2:00 PM, MRAB wrote: You're opening the file in text mode, and seeking relative to the end of the file is not allowed in text mode, presumably because the file contents have to be decoded, and, in general, seeking to an arbitrary pos

Re: English Idiom in Unix: Directory Recursively

2011-05-25 Thread Steven D'Aprano
On Wed, 25 May 2011 09:26:11 +0200, Thorsten Kampe wrote: > Naming something in the terms of its implementation details (in this > case recursion) is a classical WTF. *If* that's true, it certainly doesn't seem to apply to real-world objects. Think about the exceptions: microwave oven vacuum cl

Re: English Idiom in Unix: Directory Recursively

2011-05-25 Thread Steven D'Aprano
On Wed, 25 May 2011 00:06:06 +0200, Rikishi42 wrote: > On 2011-05-24, Steven D'Aprano > wrote: I think that is a patronizing remark that under-estimates the intelligence of lay people and over-estimates the difficulty of understanding recursion. >>> >>> Why would you presume this

Re: Why did Quora choose Python for its development?

2011-05-25 Thread Steven D'Aprano
On Wed, 25 May 2011 07:01:07 -0500, John Bokma wrote: > if Python is really so much better than Python [Perl] > readability wise, why do I have such a hard time dropping > Perl and moving on? My guess is that you have an adversarial view of computer languages, therefore after investing so much

Re: Why did Quora choose Python for its development?

2011-05-25 Thread Steven D'Aprano
On Wed, 25 May 2011 08:01:38 +1000, Chris Angelico wrote: > On Wed, May 25, 2011 at 3:39 AM, D'Arcy J.M. Cain > wrote: >> When I first looked at Perl it looked like line noise.  When I first >> looked at Python it looked like pseudo-code. > > When I first looked at assembly language it looked l

Re: Python 3.2 bug? Reading the last line of a file

2011-05-25 Thread tkp...@hotmail.com
Thanks for the guidance - it was indeed an issue with reading in binary vs. text., and I do now succeed in reading the last line, except that I now seem unable to split it, as I demonstrate below. Here's what I get when I read the last line in text mode using 2.7.1 and in binary mode using 3.2 resp

Re: super() in class defs?

2011-05-25 Thread Carl Banks
On Wednesday, May 25, 2011 10:54:11 AM UTC-7, Jess Austin wrote: > I may be attempting something improper here, but maybe I'm just going > about it the wrong way. I'm subclassing > http.server.CGIHTTPRequestHandler, and I'm using a decorator to add > functionality to several overridden methods. >

Re: super() in class defs?

2011-05-25 Thread Ian Kelly
On Wed, May 25, 2011 at 3:40 PM, Steven D'Aprano wrote: > If you actually read that article, carefully, without being fooled by the > author's provocative ex-title and misleading rhetoric, you will discover > that super is not harmful. What is harmful is making unjustified > assumptions about what

Re: Python 3.2 bug? Reading the last line of a file

2011-05-25 Thread Ethan Furman
tkp...@hotmail.com wrote: Thanks for the guidance - it was indeed an issue with reading in binary vs. text., and I do now succeed in reading the last line, except that I now seem unable to split it, as I demonstrate below. Here's what I get when I read the last line in text mode using 2.7.1 and i

Re: bdist_wininst: install_script not run on uninstall

2011-05-25 Thread Mark Hammond
On 26/05/2011 5:28 AM, Wilbert Berendsen wrote: Hi, according to the docs the installer bdist_wininst creates will run the install-script on install with -install (which works perfectly) and on uninstall with the -remove argument (which seemingly never happens). However I want to cleanup some r

Re: super() in class defs?

2011-05-25 Thread Raymond Hettinger
On May 25, 4:31 pm, Ian Kelly wrote: > Right.  It's unnecessary, so why saddle yourself with it? FWIW, I expect to release a blog post tomorrow about the principal use cases for super() and how to use it effectively. With just a little bit of know-how, it can be an important tool in your Python

Re: Why did Quora choose Python for its development?

2011-05-25 Thread Steven D'Aprano
On Wed, 25 May 2011 17:30:48 -0400, theg...@nospam.net wrote: > On 5/24/2011 1:39 PM, D'Arcy J.M. Cain wrote: [snip] >> One of my favorite quotes (not sure if it was about Perl or APL) is "I >> refuse to use a programming language where the proponents of it stick >> snippets under each other's nos

Re: Python 3.2 bug? Reading the last line of a file

2011-05-25 Thread MRAB
On 26/05/2011 00:25, tkp...@hotmail.com wrote: Thanks for the guidance - it was indeed an issue with reading in binary vs. text., and I do now succeed in reading the last line, except that I now seem unable to split it, as I demonstrate below. Here's what I get when I read the last line in text m

Re: Why did Quora choose Python for its development?

2011-05-25 Thread RainyDay
On May 25, 3:14 pm, John Bokma wrote: > Ethan Furman writes: > > Terry Reedy wrote: > >> On 5/25/2011 8:01 AM, John Bokma wrote: > > >>> to. Like I already stated before: if Python is really so much better > >>> than Python readability wise, why do I have such a hard time dropping > >>> Perl and

Re: Python 3.2 bug? Reading the last line of a file

2011-05-25 Thread Ethan Furman
MRAB wrote: On 26/05/2011 00:25, tkp...@hotmail.com wrote: Thanks for the guidance - it was indeed an issue with reading in binary vs. text., and I do now succeed in reading the last line, except that I now seem unable to split it, as I demonstrate below. Here's what I get when I read the last l

Re: Unable to make ironpython run in browser with silverlight

2011-05-25 Thread Jimmy Schementi
You need to run it from a web-server; it doesn't work when running from file:// due to Silverlight's security sandbox. Read the comments on my blog-post, it mentions the web-server there. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-list Digest, Vol 92, Issue 221

2011-05-25 Thread Richard Parker
> Writing code is primarily for *human readers*. Once you've compiled the > code once, the computer never need look at it again, but human being come > back to read it over and over again, to learn from it, or for > maintenance. We rightfully value our own time and convenience as more > valuab

Re: Python 3.2 bug? Reading the last line of a file

2011-05-25 Thread Ian Kelly
On Wed, May 25, 2011 at 3:52 PM, MRAB wrote: > What do you mean by "may include the decoder state in its return value"? > > It does make sense that the values returned from tell() won't be in the > middle of an encoded sequence of bytes. If you take a look at the source code, tell() returns a lon

Re: Cherrypy

2011-05-25 Thread Miki Tebeka
I wrote http://drdobbs.com/showArticle.jhtml?articleID=199102936&queryText=query way back then. It might be of some help. If you have any specific questions, feel free to post them to the group. -- http://mail.python.org/mailman/listinfo/python-list

Re: Odp: Re: Strange behaviour of input() function (Python 3.2)

2011-05-25 Thread Algis Kabaila
On Wednesday 25 May 2011 06:27:52 sunrrrise wrote: > Ok, another time I'd like to thank you for your help. I gave > up, I'm going to get used to IDLE GUI... at least this one > works! With IDLE, after any changes to the program, you are asked to "save file". IDLE knows that a file in python needs

Re: Unable to make ironpython run in browser with silverlight

2011-05-25 Thread Sunny
On May 26, 9:44 am, Jimmy Schementi wrote: > You need to run it from a web-server; it doesn't work when running from > file:// due to Silverlight's security sandbox. Read the comments on my > blog-post, it mentions the web-server there. I see.. But here: http://silverlighttest.zzl.org/silverlig

Re: Newbie question about SQLite + Python and twitter

2011-05-25 Thread Philip Semanchuk
On May 25, 2011, at 2:17 PM, Jayme Proni Filho wrote: > Helo guys, > > I'm building a local application for twitter for my brother's store. I'm in > the beginning and I have some newbie problems, so: > > I create a table called tb_messages with int auto increment and varchar(140) > fields; > I

Re: Unable to make ironpython run in browser with silverlight

2011-05-25 Thread ErichCart ErichCart
On May 26, 9:44 am, Jimmy Schementi wrote: > You need to run it from a web-server; it doesn't work when running from > file:// due to Silverlight's security sandbox. Read the comments on my > blog-post, it mentions the web-server there. I see.. But here: http://silverlighttest.zzl.org/silverli

Re: Why did Quora choose Python for its development?

2011-05-25 Thread John Bokma
Steven D'Aprano writes: > On Wed, 25 May 2011 07:01:07 -0500, John Bokma wrote: > >> if Python is really so much better than Python [Perl] >> readability wise, why do I have such a hard time dropping >> Perl and moving on? > > My guess is that you have an adversarial view of computer languages,

Re: English Idiom in Unix: Directory Recursively

2011-05-25 Thread Chris Angelico
On Thu, May 26, 2011 at 8:58 AM, Steven D'Aprano wrote: > ... For everyone else, I'll use an > ordinary adult vocabulary, and that includes the word "recursion" or > "recursive". Overheard yesterday: "Our conversation was recursing..." I don't know what they were talking about, but I'm pretty sur

Re: Python-list Digest, Vol 92, Issue 221

2011-05-25 Thread Chris Angelico
On Thu, May 26, 2011 at 10:58 AM, Richard Parker wrote: > It's time to stop having flame wars about languages and embrace programmers > who care enough about possible future readers of their code to thoroughly > comment it. Comments are far more valuable than the actual language in which > the cod

Re: Why did Quora choose Python for its development?

2011-05-25 Thread Ben Finney
> Get a life. Or better, just fuck off and die. It will improve both the > world and the Python community, of which you are nothing but a little, > smelly shitstain. That abuse is entirely unwelcome in this community, against any person. Please desist. If you find any contributing members so dif

Parse config file and command-line arguments, to get a single collection of options

2011-05-25 Thread Ben Finney
Howdy all, Python's standard library has modules for configuration file parsing (configparser) and command-line argument parsing (optparse, argparse). I want to write a program that does both, but also: * Has a cascade of options: default option values, overridden by config file options, overri

Puzzled by list-appending behavior

2011-05-25 Thread Uncle Ben
In playing with lists of lists, I found the following: (In 3.1, but the same happens also in 2.7) list = [1,2,3] list.append ( [4,5,6] ) x = list x -> [1,2,3,[4,5,6]] as expected. But the shortcut fails: list=[1,2,3] x = list.append( [4,5,6] ) x -> nothing Can someone explain this t

Re: Python 3.2 bug? Reading the last line of a file

2011-05-25 Thread Jussi Piitulainen
tkp...@hotmail.com writes: > Looking through the docs did not clarify my understanding of the > issue. Why can I not split on '\t' when reading in binary mode? You can split on b'\t' to get a list of byteses, which you can then decode if you want them as strings. You can decode the bytes to get

Re: Puzzled by list-appending behavior

2011-05-25 Thread Ben Finney
Uncle Ben writes: > Can someone explain this to me? Yes, the documentation for that function (‘list.append’) can explain it. In short: if a method modifies the instance, that method does not return the instance. This policy holds for the built-in types, and should be followed for user-defined t

Re: Puzzled by list-appending behavior

2011-05-25 Thread Chris Rebert
On Wed, May 25, 2011 at 9:46 PM, Uncle Ben wrote: > In playing with lists of lists, I found the following: > > (In 3.1, but the same happens also in 2.7) > > list = [1,2,3] > list.append ( [4,5,6] ) Note the lack of output after this line. This indicates that list.append([4,5,6]) returned None. C

  1   2   >