Re: BaseHTTPServer and Apache

2007-04-14 Thread Ron Garret
In article <[EMAIL PROTECTED]>, "Luis M. González" <[EMAIL PROTECTED]> wrote: > On Apr 13, 8:44 pm, Ron Garret <[EMAIL PROTECTED]> wrote: > > In article <[EMAIL PROTECTED]>, > > Ron Garret <[EMAIL PROTECTED]> wrote: > > > > > Does > > > anyone know of a straightforward way to get Apache to "forw

Re: nonstandard XML character entities?

2007-04-14 Thread Martin v. Löwis
> I'm new to xml mongering so forgive me if there's an obvious > well-known answer to this. It's not real obvious from the library > documentation I've looked at so far. Basically I have to munch of a > bunch of xml files which contain character entities like ú > which are apparently nonstandard

Re: Lists and Tuples and Much More

2007-04-14 Thread Hendrik van Rooyen
"7stud" <[EMAIL PROTECTED]> wrote: > .. But using a tuple as a > key in a dictionary is probably something you will never do. Yikes! I do this all the time... Think of an address in any one town. It has a Street, and a number (could be more complex, like a sub number for an apartme

Re: tuples, index method, Python's design

2007-04-14 Thread Martin v. Löwis
> The use case has already been discussed. Removing the pointless > inconsistency between lists and tuples means you can stop having to > remember it, so you can free up brain cells for implementing useful > things. That increases your programming productivity. So to increase consistency, the .i

Re: How to get a forum for your free site?

2007-04-14 Thread Ann
On 4月14日, 下午2时49分, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Normaly I would consider this way way off topic but I did notice that > you offer unlimited space so I suppose it could be usefull for those > of us that distribute software.. what else do I get some of the add > space?? If you

Re: How to get a forum for your free site?

2007-04-14 Thread ann
On 4月14日, 下午3时39分, "Ann" <[EMAIL PROTECTED]> wrote: > On 4月14日, 下午2时49分, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > Normaly I would consider this way way off topic but I did notice that > > you offer unlimited space so I suppose it could be usefull for those > > of us that distribute soft

Stdout

2007-04-14 Thread gbastian
Dear Users, I am trying to recover through the python function popen3 the stdout,in,err of a launched process. I would like also to recover the stdout which you can get only through the command: command1 >& filename Do you know how I can access to that stdout by python? Thanks GIacomo -- h

Re: tuples, index method, Python's design

2007-04-14 Thread Steven D'Aprano
On Sat, 14 Apr 2007 08:19:36 +0200, Hendrik van Rooyen wrote: > This is the point where the whole thing falls apart in my head and > I get real confused - I can't find a reason why, list or tuple, the first > item can't be something, the second something else, etc... It's not that they _can't_ b

Re: Append data to a list within a dict

2007-04-14 Thread Hendrik van Rooyen
"Tina I" wrote: > Hello group, > > Say I have the following dictionary: > > ListDict = { > 'one' : ['oneone' , 'onetwo' , 'onethree'], > 'two' : ['twoone' , 'twotwo', 'twothree'], > 'three' : ['threeone' , 'threetwo', threethree']} > > Now I want to append 'twofour' to the list of the 'two'

Re: reading from sys.stdin

2007-04-14 Thread 7stud
On Apr 13, 6:20 am, Michael Hoffman <[EMAIL PROTECTED]> wrote: > 7stud wrote: > > On Apr 13, 3:13 am, Michael Hoffman <[EMAIL PROTECTED]> wrote: > >> 7stud wrote: > >>> I assume all input is buffered by default, so I'm not sure how it > >>> explains things to say that input from sys.stdin is buffer

Re: tuples, index method, Python's design

2007-04-14 Thread Hendrik van Rooyen
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > So to increase consistency, the .index method should be removed > from lists, as well, IMO. If you find yourself doing a linear > search, something is wrong. > I agree. You should at the very least make it a binary search. To do that you have to so

Re: Python editor/IDE on Linux?

2007-04-14 Thread Ali
On 14 Apr, 05:48, "Jack" <[EMAIL PROTECTED]> wrote: > That's a good one. I got to find out what's special with Emacs :) The users. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and XML?

2007-04-14 Thread Stefan Behnel
Leonard J. Reder wrote: > What is the best way to process a Relax NG Schema and auto generate XML > Python parser/generator code? > Any suggestions? Not sure what you mean with "XML Python parser/generator code", but regarding RNG, you should definitely give lxml a try. It may already be what you

Double backslash in filepaths ?

2007-04-14 Thread Stef Mientki
It looks like sometimes a single backslash is replaced by a double backslash, but sometimes it's not ??? See the error message below, the first backslash is somewhere (not explicitly in my code) replaced, but the second is not ??? Is it in general better to use double backslash in filepaths ? than

Willa Ford Angelina Joli Paris Hilton

2007-04-14 Thread A - J
Willa Ford Angelina Joli Paris Hilton www.alphasearch.GR-- http://mail.python.org/mailman/listinfo/python-list

list comparison help?

2007-04-14 Thread Dropkick Punt
Hi. I have a list of common prefixes: >>> prefixes = [ "the", "this", "that", "da", "d", "is", "are", "r", "you", "u"] And I have a string, that I split() into a list. >>> sentence = "what the blazes is this" >>> sentence = sentence.split() Now I want to strip the sentence of all words in the p

Re: list comparison help?

2007-04-14 Thread Wojciech Muła
Dropkick Punt wrote: prefixes = [ "the", "this", "that", "da", "d", "is", "are", "r", "you", "u"] > > And I have a string, that I split() into a list. > sentence = "what the blazes is this" sentence = sentence.split() > > Now I want to strip the sentence of all words in the

Re: Double backslash in filepaths ?

2007-04-14 Thread Michael Bentley
On Apr 14, 2007, at 4:26 AM, Stef Mientki wrote: > It looks like sometimes a single backslash is replaced by a double > backslash, > but sometimes it's not ??? > See the error message below, > the first backslash is somewhere (not explicitly in my code) replaced, > but the second is not ??? > I

Re: "HTTP error -1" from urllib2

2007-04-14 Thread John J. Lee
John Nagle <[EMAIL PROTECTED]> writes: > I'm getting a wierd error from urllib2 when opening certain > URLs. The code works for most sites, but not all of them. > Here's the traceback: [...] > InfoException: Problem with page "http://www.fourmilab.ch": HTTP error -1 - .. > > This fails ident

Re: Emergence of Grok

2007-04-14 Thread Anton Vredegoor
Paul McGuire wrote: > I just stumbled upon a great-looking project, to make Zope3 more > approachable to mere mortals such as myself. Echoing the ROR mantra > of "convention over configuration", the Grok project (http:// > grok.zope.org/) aims to stand on the shoulders of Zope3, while > providin

Python Feature Request: Explicit variable declarations

2007-04-14 Thread samjnaa
Hello. Please tell me whether this feature request is sane (and not done before) for python so it can be posted to the python-dev mailing list. I should say first that I am not a professional programmer with too much technical knowledge. I would like to have something like the "option explicit" st

Re: list comparison help?

2007-04-14 Thread 7stud
On Apr 14, 3:36 am, "Dropkick Punt" <[EMAIL PROTECTED]> wrote: > Hi. I have a list of common prefixes: > > >>> prefixes = [ "the", "this", "that", "da", "d", "is", "are", "r", "you", > >>> "u"] > > And I have a string, that I split() into a list. > > >>> sentence = "what the blazes is this" > >>>

Python Feature Request: Allow changing base of member indices to 1

2007-04-14 Thread samjnaa
This is like the previous one. Please check for sanity and approve for posting at python-dev. I would like to have something like "option base" in Visual Basic. IIRC it used to allow me to choose whether 0 or 1 should be used as the base of member indices of arrays. In Python, the same can be used

Python Feature Request: (?) Group all file-directory-related stdlib functions in one place

2007-04-14 Thread samjnaa
Please check for sanity and approve for posting at python-dev. Currently file-directory-related functionality in the Python standard library is scattered among various modules such as shutil, os, dircache etc. So I request that the functions be gathered and consolidated at one place. Some may need

Re: Python Feature Request: Explicit variable declarations

2007-04-14 Thread Paddy
On Apr 14, 11:21 am, [EMAIL PROTECTED] wrote: > Hello. Please tell me whether this feature request is sane (and not > done before) for python so it can be posted to the python-dev mailing > list. I should say first that I am not a professional programmer with > too much technical knowledge. > > I w

Re: Double backslash in filepaths ?

2007-04-14 Thread John J. Lee
Stef Mientki <[EMAIL PROTECTED]> writes: > It looks like sometimes a single backslash is replaced by a double backslash, > but sometimes it's not ??? > See the error message below, > the first backslash is somewhere (not explicitly in my code) replaced, > but the second is not ??? > Is it in gener

problem with qthread and signal/slot

2007-04-14 Thread Pradnyesh Sawant
Hello, i've written a small pyqt code which increments a counter in the backend, and prints it on the frontend. However, i'm passing a dummy string var along with it in the signal/slot mechanism. The problem is that from the 2nd call onwards, the string gets printed, but NOT in the 1st call. (eg, i

Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

2007-04-14 Thread samjnaa
Please check for sanity and approve for posting at python-dev. In Visual Basic there is the keyword "with" which allows an object- name to be declared as governing the following statements. For example: with quitCommandButton .enabled = true .default = true end with This is syntactic sugar for

Re: list comparison help?

2007-04-14 Thread bearophileHUGS
7stud: > prefixes = [ "the", "this", "that", "da", "d", "is", "are", "r", > "you", "u"] > sentence = "what the blazes is the da this da this the" > sentence = sentence.split() > result = [word for word in sentence if word not in prefixes] > print result If prefixes becomes long enough (let's say

Re: Python editor/IDE on Linux?

2007-04-14 Thread Paddy
On Apr 13, 7:20 pm, "Jack" <[EMAIL PROTECTED]> wrote: > I wonder what everybody uses for Python editor/IDE on Linux? > I use PyScripter on Windows, which is very good. Not sure if > there's something handy like that on Linux. I need to do some > development work on Linux and the distro I am using i

Re: Python Feature Request: Explicit variable declarations

2007-04-14 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hello. Please tell me whether this feature request is sane (and not > done before) for python so it can be posted to the python-dev mailing > list. I should say first that I am not a professional programmer with > too much technical knowledge. > > I would like to have so

Re: Python Feature Request: (?) Group all file-directory-related stdlib functions in one place

2007-04-14 Thread bearophileHUGS
> Currently file-directory-related functionality in the Python standard > library is scattered among various modules such as shutil, os, > dircache etc. So I request that the functions be gathered and > consolidated at one place. Some may need renaming to avoid conflicts > or for clarification. I

Re: list comparison help?

2007-04-14 Thread mik3l3374
On Apr 14, 5:36 pm, "Dropkick Punt" <[EMAIL PROTECTED]> wrote: > Hi. I have a list of common prefixes: > > >>> prefixes = [ "the", "this", "that", "da", "d", "is", "are", "r", "you", > >>> "u"] > > And I have a string, that I split() into a list. > > >>> sentence = "what the blazes is this" > >>>

Re: XML/encoding/prolog/python hell...

2007-04-14 Thread Stefan Behnel
fscked schrieb: > I am a beginning pythoner and I am having a terrible time trying to > figure out how to do something that (it would seeme to me) should be > fairly simple. > > I have a CSV file of unknown encoding and I need to parse that file to > get the fields <--- DONE > I need to create an

Re: Python Feature Request: Explicit variable declarations

2007-04-14 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > Hello. Please tell me whether this feature request is sane (and not > done before) for python so it can be posted to the python-dev mailing > list. I should say first that I am not a professional programmer with > too much technical knowledge. I believe it has been req

Re: XML/encoding/prolog/python hell...

2007-04-14 Thread Stefan Behnel
with lxml (although untested): fscked wrote: > import os,sys > import csv from lxml.etree import Element, SubElement, ElementTree, tostring > root = Element("{Boxes}boxes") > myfile = open('ClientsXMLUpdate.csv') > csvreader = csv.reader(myfile) > > for row in csvreader: > mainbox = SubElem

Re: Double backslash in filepaths ?

2007-04-14 Thread Stef Mientki
John J. Lee wrote: > Stef Mientki <[EMAIL PROTECTED]> writes: > >> It looks like sometimes a single backslash is replaced by a double backslash, >> but sometimes it's not ??? >> See the error message below, >> the first backslash is somewhere (not explicitly in my code) replaced, >> but the second

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-14 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > This is like the previous one. Please check for sanity and approve for > posting at python-dev. This one is not sane. It's not possible to change the indexing of objects on a per-module basis, as objects may cross module boundaries. Suppose you have this code: option

Re: Python Feature Request: (?) Group all file-directory-related stdlib functions in one place

2007-04-14 Thread Martin v. Löwis
> Currently file-directory-related functionality in the Python standard > library is scattered among various modules such as shutil, os, > dircache etc. So I request that the functions be gathered and > consolidated at one place. Some may need renaming to avoid conflicts > or for clarification. >

Re: Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

2007-04-14 Thread James Stroud
[EMAIL PROTECTED] wrote: > Please check for sanity and approve for posting at python-dev. > > In Visual Basic there is the keyword "with" which allows an object- > name to be declared as governing the following statements. For > example: > > with quitCommandButton > .enabled = true > .default =

Re: ulimit on open sockets ?

2007-04-14 Thread Maxim Veksler
On 4/13/07, Alex Martelli <[EMAIL PROTECTED]> wrote: > > On Apr 12, 2007, at 1:17 PM, Maxim Veksler wrote: > ... > > Now, someone I work with suggested a simple work around "Pass the list > > objects in groups of 1024 each time to the select.select structure". I > > think it's acceptable and go

Re: reading from sys.stdin

2007-04-14 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, 7stud wrote: > Anyway, it seems everyone is saying that when you iterate over a file, the > whole file is first read into memory. Therefore iterating over sys.stdin > is consistent: you have to type Ctrl+D to signal EOF before the iteration > can start. Is that about righ

Re: Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

2007-04-14 Thread jamadagni
> I like this one for some reason. Just the "using self" would save hella > typing in a lot of classes. I would favor a convention with leading dots > to disambiguate from other variables. This wouldn't conflict with, say, > floats, because variable names can't begin with a number. Excellent. Now

Re: Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

2007-04-14 Thread James Stroud
jamadagni wrote: >> I like this one for some reason. Just the "using self" would save hella >> typing in a lot of classes. I would favor a convention with leading dots >> to disambiguate from other variables. This wouldn't conflict with, say, >> floats, because variable names can't begin with a num

Re: Portably generating infinity and NaN

2007-04-14 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > % python > Python 2.6a0 (trunk:54264M, Mar 10 2007, 15:19:48) > [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin > Type "help", "copyright", "credits" or "license" for more > information. > >>> import struct > >>> struct.pack("f", flo

Re: Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

2007-04-14 Thread James Stroud
jamadagni wrote: >> I like this one for some reason. Just the "using self" would save hella >> typing in a lot of classes. I would favor a convention with leading dots >> to disambiguate from other variables. This wouldn't conflict with, say, >> floats, because variable names can't begin with a num

Re: Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

2007-04-14 Thread Duncan Booth
James Stroud <[EMAIL PROTECTED]> wrote: > I like this one for some reason. Just the "using self" would save > hella typing in a lot of classes. I would favor a convention with > leading dots to disambiguate from other variables. This wouldn't > conflict with, say, floats, because variable names can

Re: Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

2007-04-14 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > In Visual Basic there is the keyword "with" which allows an > object- name to be declared as governing the following statements. > For example: > > with quitCommandButton > .enabled = true > .default = true > end with > > This is syntactic sugar for: > > quitCommand

Re: wxPython, mac, wx.HSCROLL not working

2007-04-14 Thread Bjoern Schliessmann
7stud wrote: > Huh? Are you saying you found a solution? Yes, the solution to | Where is that list? Regards, Björn -- BOFH excuse #382: Someone was smoking in the computer room and set off the halon systems. -- http://mail.python.org/mailman/listinfo/python-list

visit http://www.real-article.com/computer/index.php

2007-04-14 Thread chuancs
The www.real-article.com website provides a ton of information about computer. In addition, you will find extensive information on leading computer to help you on your way to success. Please have a look at our computer articles, products, resources, and additional information located throughout ww

Re: Python Feature Request: Explicit variable declarations

2007-04-14 Thread nikolas pontikos
[EMAIL PROTECTED] wrote: > Hello. Please tell me whether this feature request is sane (and not > done before) for python so it can be posted to the python-dev mailing > list. I should say first that I am not a professional programmer with > too much technical knowledge. > > I would like to have so

Re: Stdout

2007-04-14 Thread Dustan
On Apr 14, 2:49 am, [EMAIL PROTECTED] wrote: > Dear Users, > > I am trying to recover through the python function > popen3 the stdout,in,err of a launched process. > > I would like also to recover the stdout which you can > get only through the command: command1 >& filename > > Do you know how I

Re: Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

2007-04-14 Thread jamadagni
On Apr 14, 5:06 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > I can't see how it is going to save you any typing over what you can > already do. > > The suggested example: The suggested example is only a small case. I realize that the main usage would be when there are a lot of repetitive usages

Re: Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

2007-04-14 Thread jamadagni
> Personally, I'd never use it. You are free to avoid using it of course. :) > In more complex modules, when you are > looking for, e. g., self.myVar and anotherObject.myVar, > this "using" statement decreases readability and maintainability > (in full text searching). IMHO. Why? Just search for

Re: Python Feature Request: Explicit variable declarations

2007-04-14 Thread jamadagni
> Languages like Perl and VB need a strict mode because they will > auto-vivify variable for you. I.e. they will bring variables to life > with defined or undefined values if you use them in a l-value (left hand > side of an assignment) without having declared them prior. If you do > that in Pyth

Re: reading from sys.stdin

2007-04-14 Thread Steve Holden
7stud wrote: > On Apr 13, 6:20 am, Michael Hoffman <[EMAIL PROTECTED]> wrote: [...] > > But if you hit return on a blank line, there is no error. In other > words, will stop on a blank line and not return EOFError. > > Anyway, it seems everyone is saying that when you iterate over a file, > the

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-14 Thread jamadagni
On Apr 14, 4:01 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > This one is not sane. It's not possible to change the indexing of > objects on a per-module basis, as objects may cross module boundaries. I do not request for this to be changed per-module. Once I say something like: from __futu

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-14 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, jamadagni wrote: > On Apr 14, 4:01 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >> This one is not sane. It's not possible to change the indexing of >> objects on a per-module basis, as objects may cross module boundaries. > > I do not request for this to be changed

Re: Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

2007-04-14 Thread BJörn Lindqvist
Your idea isn't new and has already been discussed lots of time before. It was once planned to be implemented in py3k, but no longer is. One of the problems is that with a "using" statement, you always have to decide whether your code repeats some prefix enough times to use a "using" statement. Sh

Re: nonstandard XML character entities?

2007-04-14 Thread Chuck Rhode
Martin v. Löwis wrote this on Sat, 14 Apr 2007 09:10:44 +0200. My reply is below. > Paul Rubin: >> I'm new to xml mongering so forgive me if there's an obvious >> well-known answer to this. It's not real obvious from the library >> documentation I've looked at so far. Basically I have to munch

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-14 Thread jamadagni
> Modules are parsed when they are imported. And some modules are already > imported before your module is imported because they are built-in or > loaded to be able to import your module in the first place. And what > about modules that are written in C? OK fine. It is clear that this feature mu

Re: nonstandard XML character entities?

2007-04-14 Thread Chuck Rhode
Chuck Rhode wrote this on Sat, 14 Apr 2007 09:04:45 -0500. My reply is below. Fixed text wrap: > import xml.etree.ElementTree # or elementtree.ElementTree prior to 2.5 > ElementTree = xml.etree.ElementTree > import htmlentitydefs > class XmlFile(ElementTree.ElementTree): > def __init__(s

Option Explicit

2007-04-14 Thread Clement
Is there any command like Option Explicit[In visual basic]. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

2007-04-14 Thread jamadagni
> You already can emulate the using statement like this: You can emulate only assignments like this. How would you emulate function calls, like the ones in my example? -- http://mail.python.org/mailman/listinfo/python-list

Re: Option Explicit

2007-04-14 Thread jamadagni
On Apr 14, 7:20 pm, "Clement" <[EMAIL PROTECTED]> wrote: > Is there any command like Option Explicit[In visual basic]. We have been discussing that over the past few hours. Please see the thread: "Python Feature Request: Explicit Variable Declarations". -- http://mail.python.org/mailman

Making a tree out of a 2 column list

2007-04-14 Thread Sebastian Bassi
I have a two column list like: 2,131 6,335 7,6 8,9 10,131 131,99 5,10 And I want to store it in a tree-like structure. So if I request 131, it should return all the child of 131, like 2, 10 and 5 (since 5 is child of 10). If I request 335, it should return: 6 and 7. If I request 9, it should retu

Re: Python Feature Request: Explicit variable declarations

2007-04-14 Thread Army1987
"jamadagni" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] >> Languages like Perl and VB need a strict mode because they will >> auto-vivify variable for you. I.e. they will bring variables to life >> with defined or undefined values if you use them in a l-value (left hand >>

Simple integer comparison problem

2007-04-14 Thread tom
Hi! I ran in problem with simple exercise. I'm trying to get program to return grade when given points but no matter what, I always get F. def grader(): print "Insert points: " points = raw_input('> ') int(points) if points > 89 and points <= 100: return "A" eli

Re: Simple integer comparison problem

2007-04-14 Thread Jakub Stolarski
On Apr 14, 5:19 pm, [EMAIL PROTECTED] wrote: > Hi! > I ran in problem with simple exercise. I'm trying to get program to > return grade when given points but no matter what, I always get F. > > def grader(): > print "Insert points: " > points = raw_input('> ') > int(points) > >

Re: Simple integer comparison problem

2007-04-14 Thread Dan Bishop
On Apr 14, 10:19 am, [EMAIL PROTECTED] wrote: > Hi! > I ran in problem with simple exercise. I'm trying to get program to > return grade when given points but no matter what, I always get F. > > def grader(): > print "Insert points: " > points = raw_input('> ') > int(points) > >

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-14 Thread Steve Holden
jamadagni wrote: >> Modules are parsed when they are imported. And some modules are already >> imported before your module is imported because they are built-in or >> loaded to be able to import your module in the first place. And what >> about modules that are written in C? > > OK fine. It is c

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-14 Thread ici
On Apr 14, 1:27 pm, [EMAIL PROTECTED] wrote: ... > This would mean: > foo = "foo" > => foo[1] == 'f' > class Str1(str): def __getitem__(self,i): return str.__getitem__(self,i-1) s1 = Str1("foo") print s1[1] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-14 Thread Mel Wilson
jamadagni wrote: > OK fine. It is clear that this feature must be implemented if at all > only on a per-module basis. So can we have votes for per-module > implementation of this feature? The only way that can work is if the API to the module doesn't expose ANY sequence indices. It would be a gr

Re: how to strip the domain name in python?

2007-04-14 Thread Marko . Cain . 23
On Apr 14, 12:02 am, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Apr 13, 2007, at 11:49 PM, [EMAIL PROTECTED] wrote: > > > > > Hi, > > > I have a list of url names like this, and I am trying to strip out the > > domain name using the following code: > > >http://www.cnn.com > >www.yahoo.com > >h

Re: ulimit on open sockets ?

2007-04-14 Thread Alex Martelli
Maxim Veksler <[EMAIL PROTECTED]> wrote: ... > Thank you. I'm attaching the full code so far for reference, sadly it > still doesn't work. It seems that select.select gets it's count of > fd's not from the amount passed to it by the sub_list but from the > kernel (or whatever) count for the proc

Re: Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

2007-04-14 Thread Mel Wilson
[EMAIL PROTECTED] wrote: > In Visual Basic there is the keyword "with" which allows an object- > name to be declared as governing the following statements. For > example: > > with quitCommandButton > .enabled = true > .default = true > end with > > This is syntactic sugar for: > > quitCommandB

Re: Python editor/IDE on Linux?

2007-04-14 Thread Paulo da Silva
Jack escreveu: > I wonder what everybody uses for Python editor/IDE on Linux? > I use PyScripter on Windows, which is very good. Not sure if > there's something handy like that on Linux. I need to do some > development work on Linux and the distro I am using is Xubuntu. > > eric3 is nice and sim

Re: compiling modules with VS 2008 for python 2.4 prepared with Visual Studio 2003

2007-04-14 Thread alf
Martin v. Löwis wrote: >>well, instructions were clear enough for me. What is hard to get why it >>could not use free M$ compiler which is presumably produces compatible >>objects and libraries. > > > This presumption is incorrect. The compiler does *not* create compatible > objects and libraries

Re: Simple integer comparison problem

2007-04-14 Thread tom
Thanks for help! -- http://mail.python.org/mailman/listinfo/python-list

Re: Pydoc Rewrite Discussion at doc-sig list.

2007-04-14 Thread Colin J. Williams
Ron Adam wrote: > If anyone is interested in participating in discussing the details of the > PyDoc rewrite/refactoring I've been working on, a discussion is being > started on the doc-sig list. > > [EMAIL PROTECTED] > > The goal of this discussion will be to get it to a final finished fo

Re: Making a tree out of a 2 column list

2007-04-14 Thread [EMAIL PROTECTED]
On Apr 14, 9:37�am, "Sebastian Bassi" <[EMAIL PROTECTED]> wrote: > I have a two column list like: > > 2,131 > 6,335 > 7,6 > 8,9 > 10,131 > 131,99 > 5,10 > > And I want to store it in a tree-like structure. > So if I request 131, it should return all the child of 131, like 2, 10 > and 5 (since 5 is

Re: vocab question

2007-04-14 Thread Colin J. Williams
James Stroud wrote: > Alan G Isaac wrote: >> Pardon the vocab question; >> I'm not a computer science type. >> According to the Reference Manual, >> a class defintion has the structure:: >> >> classdef ::= "class" classname [inheritance] ":" suite >> >> What is the entire part before the

Re: Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

2007-04-14 Thread Duncan Booth
"BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > ? Not having to bother with petty things like that is an advantage. > Javascript has with-statements that are equivalent to your > using-statements but from what I've seen most programmers avoid them. > They don't increase readability one bit. That i

Re: Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

2007-04-14 Thread Duncan Booth
"jamadagni" <[EMAIL PROTECTED]> wrote: >> If you are going to reference self.quit a lot of times then it makes >> sense to also assign it to a local variable and then you already get >> even fewer characters (239): > > But you realize readability decreases considerably. > Not as much as it would

Re: Simple integer comparison problem

2007-04-14 Thread Bart Willems
> if points > 89 and points <= 100: > return "A" > elif points > 89 and points <= 89: > return "B" > elif points > 69 and points <= 79: > return "C" > elif points > 59 and points <= 69: > return "D" > else: > return "F" The previous poste

Re: Making a tree out of a 2 column list

2007-04-14 Thread [EMAIL PROTECTED]
Hope this helps # list of pairs [child,parent] list=[[2,131],[6,335],[7,6],[8,9],[10,131],[131,99],[5,10]] # list with loop #list=[[2,131],[6,335],[7,6],[8,9],[10,131],[131,99],[5,10],[3,10], [131,3]] # put the pairs in a dictionary, for easy retrieval d={} for c,p in list: # must be abl

Re: Python editor/IDE on Linux?

2007-04-14 Thread Kevin Walzer
Jack wrote: > I wonder what everybody uses for Python editor/IDE on Linux? > I use PyScripter on Windows, which is very good. Not sure if > there's something handy like that on Linux. I need to do some > development work on Linux and the distro I am using is Xubuntu. > > Why not IDLE? -- Kevi

Re: Python editor/IDE on Linux?

2007-04-14 Thread Dotan Cohen
On 14/04/07, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Jack wrote: > > I wonder what everybody uses for Python editor/IDE on Linux? > > I use PyScripter on Windows, which is very good. Not sure if > > there's something handy like that on Linux. I need to do some > > development work on Linux and th

Re: compiling modules with VS 2008 for python 2.4 prepared with Visual Studio 2003

2007-04-14 Thread Martin v. Löwis
> complier is just a compiler. perhaps final linking could be somehow > tweaked to include msvcrt71 instad of 80. Not easily. VS 2005 is not just a complier, it is also a rinkel, and ships with improt librareis. The import library for msvcrt.lib it ships with automatically links with msvcr8.dll.

WOLFOWITZ AND HIS IRANIAN PROSTITUTE SALARY OF $190k/yr Re: Test Tube Zealots: The American Chemical Society Terminates the Membership of Chemists from Iran

2007-04-14 Thread lemnitzer
"I now direct you to agree to a proposal which includes the following terms and conditions," Wolfowitz instructed. "You should accept immediately her offer to be detailed to an outside institution of her choosing, while retaining bank salary and benefits." The Wolfowitz memo went on say that Riza

ctypes and pointers

2007-04-14 Thread Diez B. Roggisch
Hi, I'm working under mac os x with the OpenCV-library that I load via ctypes. From a ObjectiveC-methodcall I get an integer, that "really" is a pointer to an IplImage-structure. I've got a function that takes such a pointer. But I don't find a way to pass it to that very function. These are

Re: Python editor/IDE on Linux?

2007-04-14 Thread Aahz
In article <[EMAIL PROTECTED]>, Michael Bentley <[EMAIL PROTECTED]> wrote: > >>> >>> Everybody uses vim. >>> >> Except for real programmers... > >Who instead use emacs ;-) "Emacs makes a good OS, but a lousy editor." -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/

Re: Simple integer comparison problem

2007-04-14 Thread Anton Vredegoor
Bart Willems wrote: > I have a feeling that there's a Python-solution that is shorter yet > better readable, I just can't figure it out yet... Shorter (and faster for big lists): Yes. More readable: I don't know, I guess that depends on ones familiarity with the procedure. import bisect def g

Re: Python editor/IDE on Linux?

2007-04-14 Thread Jorge Godoy
[EMAIL PROTECTED] (Aahz) writes: > In article <[EMAIL PROTECTED]>, > Michael Bentley <[EMAIL PROTECTED]> wrote: >> Everybody uses vim. >>> Except for real programmers... >> >>Who instead use emacs ;-) > > "Emacs makes a good OS, but a lousy editor." Yep. Emacs comes with a lot of

Re: Python editor/IDE on Linux?

2007-04-14 Thread Carl K
Jack wrote: > I wonder what everybody uses for Python editor/IDE on Linux? > I use PyScripter on Windows, which is very good. Not sure if > there's something handy like that on Linux. I need to do some > development work on Linux and the distro I am using is Xubuntu. > > I use spe - it is in un

Re: Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

2007-04-14 Thread BJörn Lindqvist
On 14 Apr 2007 07:24:32 -0700, jamadagni <[EMAIL PROTECTED]> wrote: > > You already can emulate the using statement like this: > > You can emulate only assignments like this. How would you emulate > function calls, like the ones in my example? You can't, of course. But using the with statement: u

Re: tuples, index method, Python's design

2007-04-14 Thread Rhamphoryncus
On Apr 13, 11:05 pm, Paul Rubin wrote: > "Rhamphoryncus" <[EMAIL PROTECTED]> writes: > > > i = s.index(e) => s[i] = e > > > Then this algorithm is no longer guaranteed to work with strings. > > It never worked correctly on unicode strings anyway (which becomes the > > c

Minimal Linux system to run Python

2007-04-14 Thread Chaz Ginger
I have a need for the minimal Linux system to run Python. Basically I want the system to boot up and instead of starting up Init/etc. I would love it to run python (and a python script I have written). Before embarking on doing it myself I was wondering if anyone knew of just such a system? Peace

Re: Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic

2007-04-14 Thread BJörn Lindqvist
On 4/14/07, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > On 14 Apr 2007 07:24:32 -0700, jamadagni <[EMAIL PROTECTED]> wrote: > > > You already can emulate the using statement like this: > > > > You can emulate only assignments like this. How would you emulate > > function calls, like the ones in my

Re: Python Feature Request: Explicit variable declarations

2007-04-14 Thread nikolas pontikos
Army1987 wrote: > "jamadagni" <[EMAIL PROTECTED]> ha scritto nel messaggio > news:[EMAIL PROTECTED] >>> Languages like Perl and VB need a strict mode because they will >>> auto-vivify variable for you. I.e. they will bring variables to life >>> with defined or undefined values if you use them in

  1   2   >