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
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
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
[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
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
> 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
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
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,
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,
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
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
Hi Salvatore,
Even if I catch the exceptions in a loop it goes on forever.
- ken
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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)], [])
>
[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
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.
--
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
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
Much thanks for your replies hiaips & Simon!
R.D.
--
http://mail.python.org/mailman/listinfo/python-list
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
>>> 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
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]
> 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
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
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
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
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"""
>>>
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
"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
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
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
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
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
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-
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
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
[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
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
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
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:
[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
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
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
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
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
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
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
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
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
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
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
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
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",
It looks interesting, PyGegl is a python binding for gegl:
http://ervilha.org/pygegl/
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
Anybody have an idea on this??
Does Natural Language Processing help in this case?
--
http://mail.python.org/mailman/listinfo/python-list
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.
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
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
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
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
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
> >
[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
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
--
http://mail.python.org/mailman/listinfo/python-list
<[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*
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:
[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
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
"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?
Hi!
.func( is not defined...
@-salutations
--
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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.
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
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
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
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
101 - 178 of 178 matches
Mail list logo