Re: Best IDE?

2006-10-16 Thread limodou
On 10/14/06, Fulvio <[EMAIL PROTECTED]> wrote: > *** > Your mail has been scanned by InterScan MSS. > *** > > > On Friday 13 October 2006 23:17, limodou wrote: > > hope you try it. > > If you'll manage for macro recording, playing back and from file then I'll

Re: a question about s[i:j] when i is negative

2006-10-16 Thread [EMAIL PROTECTED]
dracula571 wrote: > s[i:j] slice of s from i to j (3), (4) > > (3) > If i or j is negative, the index is relative to the end of the string: > len(s) + i or len(s) + j is substituted. But note that -0 is still 0. > > > (4) > The slice of s from i to j is defined as the sequence of items wit

Re: Python component model

2006-10-16 Thread Ilias Lazaridis
Peter Wang wrote: > Ilias Lazaridis wrote: > > looks interesting. > > Thanks! > > > what about persistency? > > Um... what about it? " As far as I can see, there's no persistency binding available. Is one planned? " http://groups.google.com/group/comp.lang.python/msg/dbdaedc68eee653a . -- htt

Scope of decorator argument

2006-10-16 Thread Gregor Horvath
Hi, this: class base(object): @adecorator(xy) def edit(self): print "edit" class child(base): xy = 3 obviously fails because "xy" is not bound at class creation time of the base object. One solution could be delegation: class base(object): @classmethod def edit(se

Re: Python component model

2006-10-16 Thread Ilias Lazaridis
Terry Reedy wrote: > "Ilias Lazaridis" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > I share the infrastructure which I use: > > > > http://dev.lazaridis.com/base > > But not quite yet, it appears. "A public release is planned shortly" Thank you for you comment. You are right.

Re: a question about s[i:j] when i is negative

2006-10-16 Thread Fredrik Lundh
dracula571 wrote: > but k[-6:2] = [1,2] > why k[-6:2] is [1,2]not [].i do follow (3),to make i positive by > plusing len(k) twice. twice? -- http://mail.python.org/mailman/listinfo/python-list

a question about s[i:j] when i is negative

2006-10-16 Thread dracula571
s[i:j] slice of s from i to j (3), (4) (3) If i or j is negative, the index is relative to the end of the string: len(s) + i or len(s) + j is substituted. But note that -0 is still 0. (4) The slice of s from i to j is defined as the sequence of items with index k such that i <= k < j. If

Re: COM Error -- Urgent help

2006-10-16 Thread M�ta-MCI
Hi! .func( is not defined... @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocksin python

2006-10-16 Thread Hendrik van Rooyen
"Bruno Desthuilliers" <[EMAIL PROTECTED]> wrote: > Kay Schluehr wrote: > > Bruno Desthuilliers wrote: > > > >> Just for the record : Ruby's code-blocks (closures, really) come from > >> Smalltalk, which is still the OneTrueObjectLanguage(tm). > > > > IsTheOneTrueObjectLanguage(tm)ReallyCamelCased?

Re: Output from subprocess.Popen()

2006-10-16 Thread Fredrik Lundh
Clodoaldo Pinto Neto wrote: > But I still don't understand what is happening. The manual says that > when shell=True the executable argument specifies which shell to use: no, it says that when shell=True, it runs the command "through" the default shell. that is, it hands it over to the shell fo

Re: OT: What's up with the starship?

2006-10-16 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I admit I am totally flmmexed by your answer. > What does when the bug was introduced have to do with > anything? oh, I thought your main concern was whether the packages available had been compromised, and that you asked if that was the reason an advisory was released

COM Error -- Urgent help

2006-10-16 Thread Teja
HI all, I have a problem in accesing COM objects in threads. To be precise, lets assume that I have a class GenericFunctions which is defined as follows: import win32com.client, pythoncom, thread ie=win32com.client.Dispatch('internetexplorer.application') ie.Visible=1 class GenericFunctions:

Re: Can I set up a timed callback without Tkinter or twisted orsomething?

2006-10-16 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: > > Hendrik> is there not something based on signals? - I seem to recall > Hendrik> some such thing here in another thread.. ( I am running Linux) > > Have you tried: > > import signal > help(signal) > > at the interpreter prompt? > > Skip *blush*

[no subject]

2006-10-16 Thread zhaoren liu
-- http://mail.python.org/mailman/listinfo/python-list

Re: Plotting histograms

2006-10-16 Thread Theerasak Photha
On 16 Oct 2006 20:49:10 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > hi, I have some values(say from -a to a) stored in a vector and I want > to plot a histogram for those values. How can I get it done in python. > I have installed and imported the Matplotlib package but on executing > the

Re: Plotting histograms

2006-10-16 Thread Robert Kern
[EMAIL PROTECTED] wrote: > hi, I have some values(say from -a to a) stored in a vector and I want > to plot a histogram for those values. How can I get it done in python. > I have installed and imported the Matplotlib package but on executing > the code > [N,x]=hist(eig, 10) # make a histogram > I

Re: wing ide vs. komodo?

2006-10-16 Thread Theerasak Photha
On 13 Oct 2006 17:07:56 -0700, Sandra-24 <[EMAIL PROTECTED]> wrote: > John Salerno wrote: > > Just curious what users of the two big commercial IDEs think of them > > compared to one another (if you've used both). > > > > Wing IDE looks a lot nicer and fuller featured in the screenshots, but a > >

Plotting histograms

2006-10-16 Thread [EMAIL PROTECTED]
hi, I have some values(say from -a to a) stored in a vector and I want to plot a histogram for those values. How can I get it done in python. I have installed and imported the Matplotlib package but on executing the code [N,x]=hist(eig, 10) # make a histogram I am getting an error saying "NameEr

Re: Alphabetical sorts

2006-10-16 Thread Ron Adam
Neil Cerutti wrote: > On 2006-10-16, Ron Adam <[EMAIL PROTECTED]> wrote: >> I have several applications where I want to sort lists in >> alphabetical order. Most examples of sorting usually sort on >> the ord() order of the character set as an approximation. But >> that is not always what you want

Re: python's OOP question

2006-10-16 Thread neoedmund
On Oct 16, 9:01 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > neoedmund wrote: > > Bruno Desthuilliers wrote: > >> neoedmund wrote: > >> (*PLEASE* stop top-posting - corrected) > >>> Ben Finney wrote: > [Please don't top-post above the text to which you're replying.] > > "neoedmu

Re: httplib and HTTPS Connections

2006-10-16 Thread runningwild
runningwild wrote: > Helo, > > This is the first time I have cared about httplib's HTTPSConnection. > > In the docs I read "Note: HTTPS support is only available if the socket > module was compiled with SSL support." > > Although my small test script "seems" to work when connecting to a > webserve

httplib and HTTPS Connections

2006-10-16 Thread runningwild
Helo, This is the first time I have cared about httplib's HTTPSConnection. In the docs I read "Note: HTTPS support is only available if the socket module was compiled with SSL support." Although my small test script "seems" to work when connecting to a webserver via HTTPS I am really not sure.

Re: command text parsing and hints displaying on user input.

2006-10-16 Thread Andy
Anybody have an idea on this?? Does Natural Language Processing help in this case? -- http://mail.python.org/mailman/listinfo/python-list

PyGegl

2006-10-16 Thread bearophileHUGS
It looks interesting, PyGegl is a python binding for gegl: http://ervilha.org/pygegl/ Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Output from subprocess.Popen()

2006-10-16 Thread Clodoaldo Pinto Neto
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > I can't see any obvious way to ask subprocess to use a shell other than > > the default. > > -c ? > > >>> f = Popen(["/bin/bash", "-c", "set|grep IFS"], stdout=PIPE) > >>> f.stdout.read() > "IFS=$' \\t\\n'\n" > >>> f = Popen(["/bin/sh", "-c",

doctest quiet again before exit how

2006-10-16 Thread p . lavarre
Looks like every run of doctest after the first is verbose: $ python2.5 quiet-once.py (0, 0) *** DocTestRunner.merge: '__main__' in both testers; summing outcomes. (0, 0) *** DocTestRunner.merge: '__main__' in both testers; summing outcomes. (0, 0) $ $ cat quiet-once.py import doctest print doctes

Dr. Dobb's Python-URL! - weekly Python news and links (Oct 16)

2006-10-16 Thread Cameron Laird
QOTW: "Well, I haven't yet seen a definition of 'Integrated Development Environment' which would exclude Emacs..." - Slawomir Nowaczyk "Let me tell you: There are times when I'm really glad that as a German, I'm not supposed to possess any sense of humour at all." - Georg Brandl Pythoneers

XLRDError: Can't find workbook in OLE2 compound document

2006-10-16 Thread kath
Hi XLRDError: Can't find workbook in OLE2 compound document What does this error means? When I try to open some excel files using XLRD, I encounter this error. Not with every excel, but with some file. Can anybody help me know, what is this error trying say and what I should do to avoid this

Re: Alphabetical sorts

2006-10-16 Thread Leo Kislov
On Oct 16, 2:39 pm, Tuomas <[EMAIL PROTECTED]> wrote: > My application needs to handle different language sorts. Do you know a > way to apply strxfrm dynamically i.e. without setting the locale? Collation is almost always locale dependant. So you have to set locale. One day I needed collation th

Re: always raise syntax error!

2006-10-16 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Larry Bates <[EMAIL PROTECTED]> wrote: >daniel wrote: . . . >> well, I would say, the reason why I could not position the error code >> may partly due to the ambiguous message that python provid

Re: Max-plus library

2006-10-16 Thread Robert Kern
Martin Manns wrote: > Hello, > > Is there any library that allows employing max-plus dioids in > python (e.g. based on numpy/scipy)? Google says "no" and I haven't heard of any, so I imagine that there aren't. There might be something buried in some of the control theory packages, but as I nei

Max-plus library

2006-10-16 Thread Martin Manns
Hello, Is there any library that allows employing max-plus dioids in python (e.g. based on numpy/scipy)? The only libraries that I found so far are for Matlab / Octave, Scilab and Maple: http://ifatwww.et.uni-magdeburg.de/~stanczyk/mpa/index.php http://www-rocq.inria.fr/MaxplusOrg/soft.html Than

Re: Mail Delivery (failure [EMAIL PROTECTED])

2006-10-16 Thread support
Thank you for your email. This is an automatic acknowledgement, and we will process your email in one business day. To shorten your waiting period until your email is answered manually, you have the possibility to find a solution on our webpage i.e. 1.) I am unable to register my program I purc

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-16 Thread jmdeschamps
Bruno Desthuilliers wrote: > Kay Schluehr wrote: > > Bruno Desthuilliers wrote: > > > >> Just for the record : Ruby's code-blocks (closures, really) come from > >> Smalltalk, which is still the OneTrueObjectLanguage(tm). > > > > IsTheOneTrueObjectLanguage(tm)ReallyCamelCased? > > > ThatsAGoodQuest

Re: ADO with Python

2006-10-16 Thread Ravi Teja
Ralf wrote: > Is their anybody with xperience in using the both and can provide me with > some xamples. Googling for python ado returns this simple tutorial http://www.markcarter.me.uk/computing/python/ado.html COM access in Python is straight forward with win32all. -- http://mail.python.org/ma

Re: Alphabetical sorts

2006-10-16 Thread Tuomas
My application needs to handle different language sorts. Do you know a way to apply strxfrm dynamically i.e. without setting the locale? Tuomas Neil Cerutti wrote: > On 2006-10-16, Ron Adam <[EMAIL PROTECTED]> wrote: > >>I have several applications where I want to sort lists in >>alphabetical

Re: Output from subprocess.Popen()

2006-10-16 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I can't see any obvious way to ask subprocess to use a shell other than > the default. -c ? >>> f = Popen(["/bin/bash", "-c", "set|grep IFS"], stdout=PIPE) >>> f.stdout.read() "IFS=$' \\t\\n'\n" >>> f = Popen(["/bin/sh", "-c", "set|grep IFS"], stdout=PIPE) >>> f.st

Re: Need a strange sort method...

2006-10-16 Thread SpreadTooThin
Tim Chase wrote: > > for example: > > a = [1,2,3,4,5,6,7,8,9,10] #Although not necessarily in order > > > > def cmp(i,j): #to be defined in this thread. > > Well, if you're willing to give up doing it in a cmp() method, > you can do it as such: > > >>> a.sort() > >>> chunk_size = 3 > >>> [a[i:

Re: Output from subprocess.Popen()

2006-10-16 Thread [EMAIL PROTECTED]
Clodoaldo Pinto Neto wrote: > Output from the shell: > > [EMAIL PROTECTED] teste]$ set | grep IFS > IFS=$' \t\n' > > Output from subprocess.Popen(): > > >>> import subprocess as sub > >>> p = sub.Popen('set | grep IFS', shell=True, stdout=sub.PIPE) > >>> p.stdout.readlines()[1] > "IFS=' \t\n" > > B

Re: Re:RELEASED Python 2.4.4, release candidate 1

2006-10-16 Thread skip
Jonathan> When trying to build 2.4.4c1 with cross-compiling, I get the Jonathan> following error. Can you file a bug report on SourceForge please? Thx, Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: Standard Forth versus Python: a case study

2006-10-16 Thread Elizabeth D Rather
[EMAIL PROTECTED] wrote: > John you nailed it. I was a big forth fan in the mid-80s but it was > very clear that you either had to spend a lot of money on proprietary > systems or do it ALL yourself. Not having any money I was pleased to be > able to do it all but today, in the age of instant commu

Re: OT: What's up with the starship?

2006-10-16 Thread skip
Shane> I'm trying to understand: Shane> a) how urgent and/or exploitable this is, Perhaps not very. As I indicated in an earlier post, the exploit has been available since 2001, so it is probably fairly hard to exploit. Shane> b) how I can check whether a given Python installation

Re: ADO with Python

2006-10-16 Thread hg
Ralf wrote: > Is their anybody with xperience in using the both and can provide me with > some xamples. > > Thx a lot > Ralf > > I suggest you buy the book from Mark Hammond hg ex (major cut and paste): # def Get_U

Re: Need a strange sort method...

2006-10-16 Thread [EMAIL PROTECTED]
SpreadTooThin wrote: > SpreadTooThin wrote: > > Simon Brunning wrote: > > > On 10/16/06, Simon Brunning <[EMAIL PROTECTED]> wrote: > > > > >>> a = [1,2,3,4,5,6,7,8,9,10] > > > > >>> a.sort(key=lambda item: (((item-1) %3), item)) > > > > >>> a > > > > [1, 4, 7, 10, 2, 5, 8, 3, 6, 9] > > > > > > Re-

Re:RELEASED Python 2.4.4, release candidate 1

2006-10-16 Thread Jonathan Smith
Anthony Baxter wrote: > On behalf of the Python development team and the Python community, > I'm happy to announce the release of Python 2.4.4 (release candidate 1). When trying to build 2.4.4c1 with cross-compiling, I get the following error. checking for /dev/ptmx... configure: error: cannot

ADO with Python

2006-10-16 Thread Ralf
Is their anybody with xperience in using the both and can provide me with some xamples. Thx a lot Ralf -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: What's up with the starship?

2006-10-16 Thread Shane Hathaway
Fredrik Lundh wrote: > Shane Hathaway wrote: > > > I don't know if this concern applies to Starship specifically, but it > > seems to apply to thousands of web sites running Python CGIs and > > Python web servers. > > so are we seeing thousands of web sites running Python CGIs and web > serve

Re: Need a strange sort method...

2006-10-16 Thread Gerard Flanagan
Gerard Flanagan wrote: > Gerard Flanagan wrote: > > SpreadTooThin wrote: > > > I have a list and I need to do a custom sort on it... > > > > > > for example: > > > a = [1,2,3,4,5,6,7,8,9,10] #Although not necessarily in order > > > > > 1 4 7 10 > > > 2 5 8 > > > 3 6 9 > > > > > > > from math impor

Re: Need a strange sort method...

2006-10-16 Thread Paul Rubin
"SpreadTooThin" <[EMAIL PROTECTED]> writes: > > I have one extra 10 that I shouldn't... > > I think my loop termination is incorrect... It looks wrong to me; try your loop on range(20) and see what happens. > maybe I should just stop when my new series size is the same size as > the original? Y

Re: run subprocess in separate window

2006-10-16 Thread Radek
Hello, as you can see, I tried subprocess methods. But could not find the right call. Radek [EMAIL PROTECTED] wrote: > Radek a écrit : > > > Hi, > > > > I am trying to create GUI launcher of several applications using Python > > and Tkinter. > > > > Currently when using subprocess.Popen("mycomm

Re: string splitting

2006-10-16 Thread bearophileHUGS
A pair of solutions: >>> s = "central_african_republic_province.txt" >>> s.rsplit("_", 1)[-1].split(".")[0] 'province' >>> import re >>> p = re.compile(r"_ ([^_]+) \.", re.VERBOSE) >>> s = """\ ... wisconsin_state.txt ... french_guiana_district.txt ... central_african_republic_province.txt""" >>>

Re: OT: What's up with the starship?

2006-10-16 Thread Fredrik Lundh
Shane Hathaway wrote: > I don't know if this concern applies to Starship specifically, but it > seems to apply to thousands of web sites running Python CGIs and > Python web servers. so are we seeing thousands of web sites running Python CGIs and web servers being attacked right now? -- h

Re: Need a strange sort method...

2006-10-16 Thread SpreadTooThin
SpreadTooThin wrote: > Simon Brunning wrote: > > On 10/16/06, Simon Brunning <[EMAIL PROTECTED]> wrote: > > > >>> a = [1,2,3,4,5,6,7,8,9,10] > > > >>> a.sort(key=lambda item: (((item-1) %3), item)) > > > >>> a > > > [1, 4, 7, 10, 2, 5, 8, 3, 6, 9] > > > > Re-reading the OP's post, perhaps sorting

Re: Need a strange sort method...

2006-10-16 Thread Gerard Flanagan
Gerard Flanagan wrote: > SpreadTooThin wrote: > > I have a list and I need to do a custom sort on it... > > > > for example: > > a = [1,2,3,4,5,6,7,8,9,10] #Although not necessarily in order > > > 1 4 7 10 > > 2 5 8 > > 3 6 9 > > > > from math import sqrt > > for i in range(2,12): > seq = rang

Re: Book about database application development?

2006-10-16 Thread Wolfgang Keller
> Developping quality SQLDBMS-based applications requires more than "a > bit" of SQL knowledge. No doubt. :-) But my "bit" is enough to get me going and to know where to look for further information if I hit a wall. Especially the people on the Postgres mailinglists (as well as the excellent doc

Re: Need a strange sort method...

2006-10-16 Thread SpreadTooThin
Simon Brunning wrote: > On 10/16/06, Simon Brunning <[EMAIL PROTECTED]> wrote: > > >>> a = [1,2,3,4,5,6,7,8,9,10] > > >>> a.sort(key=lambda item: (((item-1) %3), item)) > > >>> a > > [1, 4, 7, 10, 2, 5, 8, 3, 6, 9] > > Re-reading the OP's post, perhaps sorting isn't what's required: > > >>> a[::3]

Re: Need a strange sort method...

2006-10-16 Thread Tim Chase
>>> that's trivial to do with slicing, of course. what makes you think you >>> need to do this by calling the "sort" method ? >>> >>> >> You are of course correct.. There might be a way to do this with >> slicing >> and i % 3 > > Slicing will work only with a sorted list. But modulus arithmeti

Re: OT: What's up with the starship?

2006-10-16 Thread skip
rurpy> It seems to have been disscussed publically starting around Oct 6 rurpy> or 7 (I didn't do a though search so this may be wrong.) It was rurpy> fixed in Python 2.5 so either it was treated as a ordinary bug rurpy> with unrecognised security implications, or the developers w

Re: string splitting

2006-10-16 Thread rdharles
Much thanks for your replies hiaips & Simon! R.D. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to send E-mail without an external SMTP server ?

2006-10-16 Thread Grant Edwards
On 2006-10-16, Sybren Stuvel <[EMAIL PROTECTED]> wrote: >> Yes, I want to find a way to send email without an external >> smtp server. > > You can't. Use a DNS server to find the MX record of the > destination domain, connect to that SMTP server, then deliver > the mail. Or, just send it to a rel

Re: How to send E-mail without an external SMTP server ?

2006-10-16 Thread Grant Edwards
On 2006-10-16, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Mon, 16 Oct 2006 17:04:19 +0800, "[EMAIL PROTECTED]" ><[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > >> >> Yes, I want to find a way to send email without an external smtp server. >> > You're going to have t

Re: Need a strange sort method...

2006-10-16 Thread Saizan
SpreadTooThin wrote: > > that's trivial to do with slicing, of course. what makes you think you > > need to do this by calling the "sort" method ? > > > > > > You are of course correct.. There might be a way to do this with > slicing > and i % 3 Slicing will work only with a sorted list. --

Re: string splitting

2006-10-16 Thread hiaips
[EMAIL PROTECTED] wrote: > Hello, > I have thousands of files that look something like this: > > wisconsin_state.txt > french_guiana_district.txt > central_african_republic_province.txt > > I need to extract the string between the *last* underscore and the > extention. > So based on the files abov

Re: Need a strange sort method...

2006-10-16 Thread Neil Cerutti
On 2006-10-16, Tim Chase <[EMAIL PROTECTED]> wrote: > If you need it in a flat list, rather than as a list of > chunk_size lists (which are handy for iterating over in many > cases), there are ways of obtaining it, such as the hackish > > >>> sum([a[i::chunk_size] for i in range(chunk_size)], []) >

Re: string splitting

2006-10-16 Thread Simon Brunning
On 16 Oct 2006 12:12:38 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > I have thousands of files that look something like this: > > wisconsin_state.txt > french_guiana_district.txt > central_african_republic_province.txt > > I need to extract the string between the *last* underscore

RE: jython and toString

2006-10-16 Thread Walter S. Leipold
toString() isn't supposed to be a static method. When you call x.toString(), you're accessing x's non-static version of toString(), which is inherited from Object. -- Walt ivansh ([EMAIL PROTECTED]) wrote: > For one java class (Hello) i use another (HelloPrinter) to build the > string represen

Re: urllib.urlopen: Errno socket error

2006-10-16 Thread kgrafals
Hi Salvatore, Even if I catch the exceptions in a loop it goes on forever. - ken -- http://mail.python.org/mailman/listinfo/python-list

Re: Need a strange sort method...

2006-10-16 Thread SpreadTooThin
Fredrik Lundh wrote: > SpreadTooThin wrote: > > > I have a list and I need to do a custom sort on it... > > > Its more like > > 1 4 7 10 > > 2 5 8 > > 3 6 9 > > that's trivial to do with slicing, of course. what makes you think you > need to do this by calling the "sort" method ? > > You are of

string splitting

2006-10-16 Thread rdharles
Hello, I have thousands of files that look something like this: wisconsin_state.txt french_guiana_district.txt central_african_republic_province.txt I need to extract the string between the *last* underscore and the extention. So based on the files above, I want returned: state district province

Re: OT: What's up with the starship?

2006-10-16 Thread Shane Hathaway
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > >> Then perhaps you or he could explain it to us less intelligent >> people in very simple terms? > > the security advisory explains that the cause of the problem is a bug > in the source code used to implement repr() for 32-bit Unicode strings,

Re: OT: What's up with the starship?

2006-10-16 Thread rurpy
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > Then perhaps you or he could explain it to us less intelligent > > people in very simple terms? > > the security advisory explains that the cause of the problem is a bug > in the source code used to implement repr() for 32-bit Unicode strings,

Re: Need a strange sort method...

2006-10-16 Thread Saizan
SpreadTooThin wrote: > I have a list and I need to do a custom sort on it... > > for example: > a = [1,2,3,4,5,6,7,8,9,10] #Although not necessarily in order > > def cmp(i,j): #to be defined in this thread. > > a.sort(cmp) > > print a > [1,4,7,10, 2,5,8, 3,6,9] > > So withouth making this into a

Re: Need a strange sort method...

2006-10-16 Thread Tim Chase
> for example: > a = [1,2,3,4,5,6,7,8,9,10] #Although not necessarily in order > > def cmp(i,j): #to be defined in this thread. Well, if you're willing to give up doing it in a cmp() method, you can do it as such: >>> a.sort() >>> chunk_size = 3 >>> [a[i::chunk_size] for i in range(chunk_si

Re: Alphabetical sorts

2006-10-16 Thread Neil Cerutti
On 2006-10-16, Ron Adam <[EMAIL PROTECTED]> wrote: > > I have several applications where I want to sort lists in > alphabetical order. Most examples of sorting usually sort on > the ord() order of the character set as an approximation. But > that is not always what you want. Check out strxfrm in

Re: How to send E-mail without an external SMTP server ?

2006-10-16 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: > Yes, I want to find a way to send email without an external smtp server. You can't. Use a DNS server to find the MX record of the destination domain, connect to that SMTP server, then deliver the mail. Sybren -- Sybren Stüvel Stüvel IT - http://www.stuv

Re: Ok. This IS homework ...

2006-10-16 Thread Frederic Rentsch
Nick Craig-Wood wrote: > Frederic Rentsch <[EMAIL PROTECTED]> wrote: > >> It was called a flow chart. Flow charts could be translated directly >> into machine code written in assembly languages which had labels, tests >> and jumps as the only flow-control constructs. When structured >> pr

Re: Need a strange sort method...

2006-10-16 Thread Gerard Flanagan
SpreadTooThin wrote: > I have a list and I need to do a custom sort on it... > > for example: > a = [1,2,3,4,5,6,7,8,9,10] #Although not necessarily in order > > def cmp(i,j): #to be defined in this thread. > > a.sort(cmp) > > print a > [1,4,7,10, 2,5,8, 3,6,9] > > So withouth making this into a

Re: Need a strange sort method...

2006-10-16 Thread Simon Brunning
On 10/16/06, Simon Brunning <[EMAIL PROTECTED]> wrote: > >>> a = [1,2,3,4,5,6,7,8,9,10] > >>> a.sort(key=lambda item: (((item-1) %3), item)) > >>> a > [1, 4, 7, 10, 2, 5, 8, 3, 6, 9] Re-reading the OP's post, perhaps sorting isn't what's required: >>> a[::3] + a[1::3] + a[2::3] [1, 4, 7, 10, 2, 5

Re: Need a strange sort method...

2006-10-16 Thread Fredrik Lundh
SpreadTooThin wrote: > I have a list and I need to do a custom sort on it... > Its more like > 1 4 7 10 > 2 5 8 > 3 6 9 that's trivial to do with slicing, of course. what makes you think you need to do this by calling the "sort" method ? -- http://mail.python.org/mailman/listinfo/python-li

Re: urllib.urlopen: Errno socket error

2006-10-16 Thread Salvatore
Hello, Try to increase the time out : socket.settimeout(n) and catch the timeout error when it occurs Regards [EMAIL PROTECTED] a écrit : > Hi, > > I'm just trying to read from a webpage with urllib but I'm getting > IOErrors. This is my code: > > import urllib > sock = urllib.urlopen("http:/

Re: Need a strange sort method...

2006-10-16 Thread Simon Brunning
On 16 Oct 2006 11:13:08 -0700, SpreadTooThin <[EMAIL PROTECTED]> wrote: > I have a list and I need to do a custom sort on it... > > for example: > a = [1,2,3,4,5,6,7,8,9,10] #Although not necessarily in order > > def cmp(i,j): #to be defined in this thread. > > a.sort(cmp) > > print a > [1,4,7,10,

Re: Need a strange sort method...

2006-10-16 Thread Paul Rubin
"SpreadTooThin" <[EMAIL PROTECTED]> writes: > a = [1,2,3,4,5,6,7,8,9,10] #Although not necessarily in order > > def cmp(i,j): #to be defined in this thread. > > a.sort(cmp) > > print a > [1,4,7,10, 2,5,8, 3,6,9] def k(n): return (n-1) % 3, (n-1) // 3 a.sort(key=k) -- http://mail.python.org/m

Alphabetical sorts

2006-10-16 Thread Ron Adam
I have several applications where I want to sort lists in alphabetical order. Most examples of sorting usually sort on the ord() order of the character set as an approximation. But that is not always what you want. The solution of converting everything to lowercase or uppercase is closer, but

Re: OT: What's up with the starship?

2006-10-16 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Then perhaps you or he could explain it to us less intelligent > people in very simple terms? the security advisory explains that the cause of the problem is a bug in the source code used to implement repr() for 32-bit Unicode strings, on all Python versions from 2.2 a

Re: set operations on dictionaries?

2006-10-16 Thread Tim Chase
> I understand this point but this is just an argument for > saying that it should throw an exception when the values don't > match. It is not an argument for not doing the logical thing > when they do. In fact in many situations it can be reasonably > expected that the values will be the same. If

Re: Web Hosting

2006-10-16 Thread Jose C
> With web hosting, does the ISP you chose have to support the framework > you work with as well? > > Im looking at making a site in Python, however, Im lost as to what ISPs > actually support. Some ISPs say they support Python so does that mean > if I wanted to use TurboGears It would just work an

Need a strange sort method...

2006-10-16 Thread SpreadTooThin
I have a list and I need to do a custom sort on it... for example: a = [1,2,3,4,5,6,7,8,9,10] #Although not necessarily in order def cmp(i,j): #to be defined in this thread. a.sort(cmp) print a [1,4,7,10, 2,5,8, 3,6,9] So withouth making this into an IQ test. Its more like 1 4 7 10 2 5 8 3 6

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-16 Thread Bruno Desthuilliers
Kay Schluehr wrote: > Bruno Desthuilliers wrote: > >> Just for the record : Ruby's code-blocks (closures, really) come from >> Smalltalk, which is still the OneTrueObjectLanguage(tm). > > IsTheOneTrueObjectLanguage(tm)ReallyCamelCased? > ThatsAGoodQuestion. DoYouMeanIsTheIdentifierTheOneTrueObj

Re: set operations on dictionaries?

2006-10-16 Thread aba cus
              It should be quite obvious what should happen when the values stored forthe relevant keys are identical. It is less obvious (and needs somethough) what should happen when the keys are the same in the twooperands, but the values are different.I think you answered you own pr

urllib.urlopen: Errno socket error

2006-10-16 Thread kgrafals
Hi, I'm just trying to read from a webpage with urllib but I'm getting IOErrors. This is my code: import urllib sock = urllib.urlopen("http://www.google.com/";) and this is the error: Traceback (most recent call last): File "", line 1, in sock = urllib.urlopen("http://www.google.com/";)

Re: OT: What's up with the starship?

2006-10-16 Thread rurpy
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > But, I am still completely at a loss why you, he, or anyone, > > based on the information presented so far,.would conclude > > that the python security problem is unrelated. > > Because he's read the security advisory, perhaps, and understands

Re: Python-list Digest, Vol 37, Issue 292

2006-10-16 Thread brojoe
thanks,do not sentonother message it's enougth --- For super low premiums, click here http://www.webmail.co.za/dd.pwm -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: What's up with the starship?

2006-10-16 Thread rurpy
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > > I don't think that would help in the case of Pywin32 since the > > Sourceforge dates for build 210 are 9/22. > > I emailed Mark Hammond but have not heard anything back yet. > > In the case of pywin32, are you at all sure that you actually

Re: OT: What's up with the starship?

2006-10-16 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > But, I am still completely at a loss why you, he, or anyone, > based on the information presented so far,.would conclude > that the python security problem is unrelated. Because he's read the security advisory, perhaps, and understands what it says? -- http://mail.

Re: OT: What's up with the starship?

2006-10-16 Thread micahel
[EMAIL PROTECTED] wrote: > > > 5. Verifying that such a thing has not happened can be very > > > difficult, particularly if the date and other details of the > > > compromise cannot be accurately determined. > > > > I guess you should find out from the author of whatever you downloaded > > what t

Re: OT: What's up with the starship?

2006-10-16 Thread rurpy
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: --snip-- > As far as I can tell, the machine was compromised on 2006-09-02. So it was compromised for over a month. > Irritatingly we didn't find out until just after logrotate had deleted > the logs for around the time of the attack. Murphy

SAPI and Python

2006-10-16 Thread Sean Kennedy
Ok - I've done a lot of searching with google for info on what I'm about to ask, and haven't found enough to accomplish what I'm after - so if anyone has the answers (or even just ideas on how to proceed) I'd love the help. I'm fairly new to Python, but not to OO programming. I've written a simp

Re: Strange Behavior

2006-10-16 Thread Fredrik Lundh
Carsten Haese wrote: > I think this statement needs to be clarified. The binding of "data" to > the empty list *does* happen at runtime, not at compile time. However, > the binding happens only once, when the "def" statement is executed, as > opposed to every time the __init__ function is called.

Re: Strange Behavior

2006-10-16 Thread Carsten Haese
On Mon, 2006-10-16 at 10:51, Steven D'Aprano wrote: > On Mon, 16 Oct 2006 07:26:05 -0700, abcd wrote: > > > class Foo: > > def __init__(self, name, data=[]): > > The binding of the name "data" to the empty list happens at compile time, > not runtime. I think this statement needs to be clarif

Problem: Python search path - module order

2006-10-16 Thread aznach
Hello! I have a shared hosting account at GrokThis.net and have a problem with the module order of the Python search path. I'd like to use django's svn trunk instead of the "Django-0.95-py2.4.egg" provided in site-packages. The problem is that the "django egg" gets preference over the "django sv

  1   2   >