Re: Seeking old post on developers who like IDEs vs developers who like simple languages

2009-05-19 Thread Colin J. Williams
Ulrich Eckhardt wrote: Steve Ferg wrote: On the one hand, there are developers who love big IDEs with lots of features (code generation, error checking, etc.), and rely on them to provide the high level of support needed to be reasonably productive in heavy-weight languages (e.g. Java). On the

Re: Is there a better way to chose a slice of a list?

2009-05-19 Thread Terry Reedy
walterbyrd wrote: On May 8, 5:55 pm, John Yeung wrote: On May 8, 3:03 pm,walterbyrd wrote: This works, but it seems like there should be a better way. -- week = ['sun','mon','tue','wed','thu','fri','sat'] for day in week[week.index('tue'):week.index('fri')]: print day -

Re: Is there a better way to chose a slice of a list?

2009-05-19 Thread Rhodri James
On Tue, 19 May 2009 22:38:19 +0100, walterbyrd wrote: On May 8, 5:55 pm, John Yeung wrote: On May 8, 3:03 pm,walterbyrd wrote: > This works, but it seems like there should be a better way. > -- > week = ['sun','mon','tue','wed','thu','fri','sat'] > for day in week[week.index('

Re: optparse options

2009-05-19 Thread Ben Finney
icarus writes: > parser = optparse.OptionParser(usage="%prog [-p dir] [--part=dir] ", > version="%prog 1.0") > > parser.add_option( "-p", "--part", dest="directory", > help="process target directory", metavar="dir") > (options, args) = parser.parse_args(

Re: package with executable

2009-05-19 Thread Ben Finney
Stefano Costa writes: > my name is Stefano Costa, I am an archaeologist and I am developing > GNUCal, a radiocarbon calibration program released under the GNU GPL. > [1][2] That is a great use of Python, and sounds like interesting work. I would highly recommend you change the name, though. Yo

Re: Is there a better way to chose a slice of a list?

2009-05-19 Thread Ben Finney
walterbyrd writes: > On May 8, 5:55 pm, John Yeung wrote: > > On May 8, 3:03 pm,walterbyrd wrote: > > I think you should provide much more information, primarily why you > > want to do this.  What is the larger goal you are trying to achieve? > > I am just looking for a less verbose, more elega

Re: Is there a better way to chose a slice of a list?

2009-05-19 Thread John Machin
On May 20, 7:38 am, walterbyrd wrote: > On May 8, 5:55 pm, John Yeung wrote: > > > On May 8, 3:03 pm,walterbyrd wrote: > > > > This works, but it seems like there should be a better way. > > > > -- > > > --- > > > I think you should provide much more information, primarily

Re: Package problem

2009-05-19 Thread David Lyon
On Tue, 19 May 2009 13:29:47 +0100, "A. Cavallo" wrote: > You could try: > > http://download.opensuse.org/repositories/home:/cavallo71:/python-opt/ > > This is a python interpreter installed under /opt/opt-python-2.7a0. > All you have to do is sourcing /opt/opt-python-2.7a0/opt-python-env.sh > f

Re: package with executable

2009-05-19 Thread MRAB
Ben Finney wrote: Stefano Costa writes: my name is Stefano Costa, I am an archaeologist and I am developing GNUCal, a radiocarbon calibration program released under the GNU GPL. [1][2] That is a great use of Python, and sounds like interesting work. I would highly recommend you change the n

sqlite3, qmarks, and NULL values

2009-05-19 Thread Mitchell L Model
Suppose I have a simple query in sqlite3 in a function: def lookupxy(x, y): conn.execute("SELECT * FROM table WHERE COL1 = ? AND COL2 = ?", (x, y)) However, COL2 might be NULL. I can't figure out a value for y that would retrieve rows for which COL2 is NULL. It s

Re: Adding a Par construct to Python?

2009-05-19 Thread Aaron Brady
On May 17, 7:05 am, jer...@martinfamily.freeserve.co.uk wrote: > From a user point of view I think that adding a 'par' construct to > Python for parallel loops would add a lot of power and simplicity, > e.g. > > par i in list: >     updatePartition(i) > > There would be no locking and it would be t

Re: sqlite3, qmarks, and NULL values

2009-05-19 Thread MRAB
Mitchell L Model wrote: Suppose I have a simple query in sqlite3 in a function: def lookupxy(x, y): conn.execute("SELECT * FROM table WHERE COL1 = ? AND COL2 = ?", (x, y)) However, COL2 might be NULL. I can't figure out a value for y that would retrieve rows fo

Re: sqlite3, qmarks, and NULL values

2009-05-19 Thread John Machin
On May 20, 10:54 am, MRAB wrote: > Mitchell L Model wrote: > > Suppose I have a simple query in sqlite3 in a function: > > >     def lookupxy(x, y): > >         conn.execute("SELECT * FROM table WHERE COL1 = ? AND COL2 = ?", > >                      (x, y)) > > > However, COL2 might be NULL. I can

Re: Is there a better way to chose a slice of a list?

2009-05-19 Thread Steven D'Aprano
On Tue, 19 May 2009 14:38:19 -0700, walterbyrd wrote: > On May 8, 5:55 pm, John Yeung wrote: >> On May 8, 3:03 pm,walterbyrd wrote: >> >> > This works, but it seems like there should be a better way. >> >> > -- >> > week = ['sun','mon','tue','wed','thu','fri','sat'] for day in >> > we

Re: How can i use Spread Sheet as Data Store

2009-05-19 Thread alex23
On May 19, 11:57 pm, "D'Arcy J.M. Cain" wrote: > I hear you but I'm not so sure that that is an absolute.  There are > many applications that allow you to have your password emailed to you. > For something with low risk that's perfectly acceptable. Having -any- password stored in plaintext is una

Re: Adding a Par construct to Python?

2009-05-19 Thread Steven D'Aprano
On Tue, 19 May 2009 03:57:43 -0700, jeremy wrote: >> you want it so simple to use that amateurs can mechanically replace >> 'for' with 'par' in their code and everything will Just Work, no effort >> or thought required. > > Yes I do want the par construction to be simple, but of course you can't

Re: strip char from list of strings

2009-05-19 Thread alex23
On May 20, 12:55 am, Laurent Luce wrote: > I had a simple loop stripping each string but I was looking for > something concise and efficient. I like the following answer: > x = [s.rstrip('\n') for s in x] Your initial requirement stated that you needed this to happen in- place. What you're doing

Re: Adding a Par construct to Python?

2009-05-19 Thread Steven D'Aprano
On Tue, 19 May 2009 05:52:04 -0500, Grant Edwards wrote: > On 2009-05-19, Steven D'Aprano > wrote: >> On Mon, 18 May 2009 02:27:06 -0700, jeremy wrote: >> >>> Let me clarify what I think par, pmap, pfilter and preduce would mean >>> and how they would be implemented. >> [...] >> >> Just for fun,

distutils and building an distribution that includes other packages

2009-05-19 Thread Paul Hemans
Hi, I am new to Python, and after a lot of sweat and tears, I have my first app. Now I need to deploy it to end-users. The application includes the use of lxml and sqlAlchemy so I need those to install automatically as part of the installation process. I really don't want the users having to dow

Re: distutils and building an distribution that includes other packages

2009-05-19 Thread Chris Rebert
On Tue, May 19, 2009 at 8:55 PM, Paul Hemans wrote: > Hi, > I am new to Python, and after a lot of sweat and tears, I have my first app. > Now I need to deploy it to end-users. The application includes the use of > lxml and sqlAlchemy so I need those to install automatically as part of the > insta

Re: Adding a Par construct to Python?

2009-05-19 Thread Paul Rubin
Steven D'Aprano writes: > (4) the caller is responsible for making sure he never shares data while > looping over it. > > I don't think I've missed any possibilities. You have to pick one of > those four. I wonder if the compiler can check that a given function doesn't change any data. Then:

Re: distutils and building an distribution that includes other packages

2009-05-19 Thread Paul Hemans
Hi Chris, Yes I do intend to use py2exe for windows installation but I don't understand how it will help me distribute lxml and sqlAlchemy as part of the install, or am I missing something? "Chris Rebert" wrote in message news:mailman.426.1242792992.8015.python-l...@python.org... > On Tue, May

Re: Adding a Par construct to Python?

2009-05-19 Thread Aaron Brady
On May 19, 11:20 pm, Paul Rubin wrote: > Steven D'Aprano writes: > > (4) the caller is responsible for making sure he never shares data while > > looping over it. > > > I don't think I've missed any possibilities. You have to pick one of > > those four. > > I wonder

Re: distutils and building an distribution that includes other packages

2009-05-19 Thread Chris Rebert
> "Chris Rebert" wrote in message > news:mailman.426.1242792992.8015.python-l...@python.org... >> On Tue, May 19, 2009 at 8:55 PM, Paul Hemans wrote: >>> Hi, >>> I am new to Python, and after a lot of sweat and tears, I have my first >>> app. >>> Now I need to deploy it to end-users. The applicat

Re: Seeking old post on developers who like IDEs vs developers who like simple languages

2009-05-19 Thread Joshua Judson Rosen
Ulrich Eckhardt writes: > > That said, an IDE that provides auto-completion (e.g. that gives you a list > of available class members) is a good thing in Java, because you don't have > to browse the documentation as often. While I find at least some types of autocompletion to be laudable features

Re: Conceptual flaw in pxdom?

2009-05-19 Thread Damien Neil
"Diez B. Roggisch" wrote: > APIs such as ElementTree don't try to burden themselves with the > language-agnosticism, and thus are much more powerful. Having used both ElementTree and xml.dom, I don't see that ET is any more powerful. Both APIs let you manipulate an XML tree in pretty much any

How to get Form values in Python code and Send Email

2009-05-19 Thread Kalyan Chakravarthy
Hi All, I have one doubt, I have feedback form (HTML Page) in one website user enters all the details and after submitting the page, in back end Python class i want to get all those data and send to one email id. for this please any one can guide me how to do it in Python( how to get HTML fo

Re: Adding a Par construct to Python?

2009-05-19 Thread Steven D'Aprano
On Tue, 19 May 2009 21:41:08 -0700, Aaron Brady wrote: > On May 19, 11:20 pm, Paul Rubin wrote: >> Steven D'Aprano writes: >> > (4) the caller is responsible for making sure he never shares data >> > while looping over it. >> >> > I don't think I've missed any possi

Re: package with executable

2009-05-19 Thread A. Cavallo
Hi, > Matplotlib and Numpy, and a command line program. My goal is to create a > distributable package, that should ideally contain both the "gnucal" > package and the command line program. > * where should the executable module be wrt setup.py and/or the > package directory in the s

Re: distutils and building an distribution that includes other packages

2009-05-19 Thread Paul Hemans
On May 20, 3:01 pm, Chris Rebert wrote: > > "Chris Rebert" wrote in message > >news:mailman.426.1242792992.8015.python-l...@python.org... > >> On Tue, May 19, 2009 at 8:55 PM, Paul Hemans wrote: > >>> Hi, > >>> I am new to Python, and after a lot of sweat and tears, I have my first > >>> app. >

Re: Python mail truncate problem

2009-05-19 Thread Tim Roberts
David wrote: > >I am writing Python script to process e-mails in a user's mail >account. What I want to do is to update that e-mail's Status to 'R' >after processing it, however, the following script truncates old e- >mails even though it updates that e-mail's Status correctly. Anybody >knows how

Re: Subversion commit from Python?

2009-05-19 Thread Lawrence D'Oliveiro
In message <5f7f9840-0e17-48fb-acf9-04186fb1b...@r3g2000vbp.googlegroups.com>, Jack Trades wrote: > On May 19, 3:53 am, Lawrence D'Oliveiro > wrote: > >> Possibly your CGI scripts are running as some user like "nobody", which >> doesn't have the right access to the files/directories. Changing A

Re: Subversion commit from Python?

2009-05-19 Thread Lawrence D'Oliveiro
In message <77fv7jf1h44c...@mid.uni-berlin.de>, Diez B. Roggisch wrote: > I have had many troubles with SVN + permissions. I create a custom captive user to own write access to the repository, with access only to keys belonging to authorized users via svn+ssh. Problem solved. -- http://mail.p

<    1   2