I solved it myself.
Don't bother.
"John" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Given an array of elements, look at it as a binary tree. Start at the last
> interior node, and downheap it. Then downheap the previous interior node,
> and continue in this fashion, up to the
jeremito a écrit :
(snip)
>>
>>Thanks again! Sometimes the problem is simply not knowing where to
>>find the documentation,
http://python.org/doc is usually a good start !-)
>>or finding the right portion of the
>>documentation.
Yes, this is not always obvious. FWIW, browsing docs is probably
On 2007-02-07, John <[EMAIL PROTECTED]> wrote:
> Given an array of elements, look at it as a binary tree. Start
> at the last interior node, and downheap it. Then downheap the
> previous interior node, and continue in this fashion, up to
> the root.
I'll give you python code for that if you give
Andrea Gavana wrote:
> Hi All,
>
> in our office we work with quite complex input files for a
> reservoir simulator. Those files have thousands of keywords, switches,
> sub-keywords and whatever. Every time a modification is requested, we
> modify the input file and re-run the simulator. Obvio
Andrea Gavana wrote:
> Hi All,
>
> in our office we work with quite complex input files for a
> reservoir simulator. Those files have thousands of keywords, switches,
> sub-keywords and whatever. Every time a modification is requested, we
> modify the input file and re-run the simulator. Obviou
Hey,
Can someone plz make a function for that takes a array, and then search
in it for duplicates, if it finds 2 or more items thats the same string
then delete all except 1.
Short: it deletes all duplicates in a array
thanks
--
http://mail.python.org/mailman/listinfo/python-list
Hey,
Can someone plz make a function for that takes a array, and then search
in it for duplicates, if it finds 2 or more items thats the same string
then delete all except 1.
Short: it deletes all duplicates in a array
thanks
--
_.____ __
Does anyone know what happened to the subway project?
The sites gosubway.org and subway.python-hosting.com have been down
for a long time now. Actually, I would like to have the code just to
look at it and maybe learn something, but it seems it completely
disappeared from the net. Does anyone has
(Somehow this message didn't go through for the first time.)
Does anyone know what happened to the subway project?
The sites gosubway.org and subway.python-hosting.com have been down
for a long time now. Actually, I would like to have the code just to
look at it and maybe learn something, but it
Hello,
Is there a Quick Reference for Python web programming?
Thank you.
--Jojo
---
3webXS High Speed Cable or DSL Internet...surf at speeds up to 3.0 Mbps
for as low as $24.95/mo...visit www.get3web.com for details
--
http://ma
> I have certain data in the default file format ( GADGET ) .
Can you be more specific about the file format? what is the exact name, or the
format specification?
-
It's here! Your new message!
Get new email alerts with the free Yahoo! Toolbar.--
http://mail.p
Is there a good way how to use string.find function to find a
substring if I need to you case insensitive substring?
Thanks for reply
LL
--
http://mail.python.org/mailman/listinfo/python-list
John wrote:
> I solved it myself.
> Don't bother.
Heh heh, I don't think they were going to anyway.
--
http://mail.python.org/mailman/listinfo/python-list
"Johny" <[EMAIL PROTECTED]> wrote:
> Is there a good way how to use string.find function to find a
> substring if I need to you case insensitive substring?
s.lower().find(substring.lower())
--
http://mail.python.org/mailman/listinfo/python-list
lower() is also deprecated :) oh well
On 7 Feb 2007 21:06:08 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote:
> "Johny" <[EMAIL PROTECTED]> wrote:
>
> > Is there a good way how to use string.find function to find a
> > substring if I need to you case insensitive substring?
>
> s.lower().find(substring
king kikapu a écrit :
> at first, thanks you all for your help!
>
> So, i will follow your advice.In a moment though, i thought that "ok,
> do not check anything of the parameter's type but do a try/catch at
> the calls inside the function"
And so what ? Once an exception got caught, what are you
Johny a écrit :
> Is there a good way how to use string.find function to find a
> substring if I need to you case insensitive substring?
"abCdZEd".lower().find("BcD".lower())
--
http://mail.python.org/mailman/listinfo/python-list
Johny wrote:
> Is there a good way how to use string.find function to find a
> substring if I need to you case insensitive substring?
> Thanks for reply
> LL
>
Maybe something like:
x="my string I'm going to SEarCH"
hasword='SEARCH' in x.upper()
location=x.upper().find('SEARCH')
print hasword
Tr
string.find is deprecated as per the official python documentation.
take a look at the "re" module
On 7 Feb 2007 12:53:36 -0800, Johny <[EMAIL PROTECTED]> wrote:
> Is there a good way how to use string.find function to find a
> substring if I need to you case insensitive substring?
> Thanks for r
On Feb 8, 4:43 am, "Dongsheng Ruan" <[EMAIL PROTECTED]> wrote:
> I got feed back saying" list object is not callable". But I can't figure out
> what is wrong with my code.
>
> A=[3,5,4,9,6,7]
> l=len(A)-1
>
> for i in range(l):
> print A(i)
What the others said, *plus*:
(1) you are subtract
Hello,
I find it annoying that one has to write
self.assertEqual(x, y)
rather than just
assert x == y
when writing tests. This is a nuisance in all the programming
languages I know of (which are not too many). In Python however, there
appears to be a better alternative. The piece of code below
Marco wrote:
> The following code is my test program for control mplayer.
> in movies/ there are about 20 movies, the code plays them in circle,
> but mplayer will crash silently after a circle, the "sliently" means I
> can handle popen2 without except, but no movie.
i had some problem with mplay
Don Morrison wrote:
> lower() is also deprecated :) oh well
The string method .lower() is not deprecated.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying tru
On Feb 7, 3:13 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi all,
>
> I'm interested in Parallel Python and I learned from the website of
> Parallel Python
> that it can run on SMP and clusters. But can it run on a our muti-CPU
> server ?
> We are running an origin3800 server with 128 CPU
"Don Morrison" <[EMAIL PROTECTED]> wrote:
> lower() is also deprecated :) oh well
>
> On 7 Feb 2007 21:06:08 GMT, Duncan Booth
> <[EMAIL PROTECTED]> wrote:
>> "Johny" <[EMAIL PROTECTED]> wrote:
>>
>> > Is there a good way how to use string.find function to find a
>> > substring if I need to you
On 1/28/07, Scripter47 <[EMAIL PROTECTED]> wrote:
> Can someone plz make a function for that takes a array, and then search
> in it for duplicates, if it finds 2 or more items thats the same string
> then delete all except 1.
>>> myList = [1, 1, 2, 4, 8, 8, 8, 8, 8, 8, 10]
>>> myList = list(set(
My apologies, I confused the built-in "str" with the module "string".
I was reading from the section of the 2.4.4 docs called: 4.1.4
Deprecated string functions
On 2/7/07, Robert Kern <[EMAIL PROTECTED]> wrote:
> Don Morrison wrote:
> > lower() is also deprecated :) oh well
>
> The string method .
On 7 Feb 2007 11:31:32 -0800, James <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm a newbie to Python & wondering someone can help me with this...
>
> I have this code:
> --
> #! /usr/bin/python
>
> import sys
>
> month ={'JAN':1,'FEB':2,'MAR':3,'APR':4,'MAY':5,'JUN':6,'JUL':7
you have to undestand that python is not like other languages. I am
working wih it for 3 months. in this time i learned more than throgh
c, c++, java or php. you take. what the hell is php. a language
developed primary for webaplications. take zope and you have the same.
besides that zope will do f
> And so what ? Once an exception got caught, what are you going to do ?
You have absolutely right, that's the reason i rejected this.
> You're starting to see the light, my friend !-)
>
> > Strange world the dynamic one
>
> If that's too dynamic for you, then run for your life
Hehe...you k
Paul Boddie wrote:
> [snip]
>
> Take a look at the Python Wiki for information on parallel processing
> with Python:
>
> http://wiki.python.org/moin/ParallelProcessing
>
What a great resource! That one is book marked for sure. I was
wondering if anyone here had any opinions on some of the tec
Don Morrison wrote:
> string.find is deprecated as per the official python documentation.
>
but the str.find() method isn't.
> take a look at the "re" module
>
A possibility.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenwe
On Feb 7, 4:59 pm, "Shawn Milo" <[EMAIL PROTECTED]> wrote:
> On 7 Feb 2007 11:31:32 -0800, James <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello,
>
> > I'm a newbie to Python & wondering someone can help me with this...
>
> > I have this code:
> > --
> > #! /usr/bin/python
>
> >
> Don Morrison wrote:
> > string.find is deprecated as per the official python documentation.
> >
> but the str.find() method isn't.
>
> > take a look at the "re" module
> >
> A possibility.
>
> regards
> Steve
Thank you everyone. :) Johny did say "string.find" in his message, not
"str.find", but
For some reason Python 2.2.4 cannot find the Numeric module. It's been
suggested that I should re-install the Numeric file. How do that? Also the
PIL. The three install files are:
python-2.4.4.msi
PIL-1.1.5.win32-py2.4.exe
Numeric-24.2.win32-py2.4.exe
Wayne T. Watson (Watson Adventure
W. Watson wrote:
> For some reason Python 2.2.4 cannot find the Numeric module. It's been
> suggested that I should re-install the Numeric file. How do that? Also the
> PIL. The three install files are:
> python-2.4.4.msi
> PIL-1.1.5.win32-py2.4.exe
> Numeric-24.2.win32-py2.4.exe
The latter two
On 7 Feb 2007 11:31:32 -0800, James <[EMAIL PROTECTED]> wrote:
> I have this code:
...
> infile.close
> outfile.close
...
> 1. the outfile doesn't complete with no error message. when I check
> the last line in the python interpreter, it has read and processed the
> last line, but the output file
James a écrit :
> On Feb 7, 4:59 pm, "Shawn Milo" <[EMAIL PROTECTED]> wrote:
>
(snip)
>>I'm pretty new to Python myself, but if you'd like help with a
>>Perl/regex solution, I'm up for it. For that matter, whipping up a
>>Python/regex solution would probably be good for me. Let me know.
>>
>>Shaw
king kikapu a écrit :
>>And so what ? Once an exception got caught, what are you going to do ?
>
>
> You have absolutely right, that's the reason i rejected this.
hear hear !-)
( snip)
> All of the efforts all these years to declare everything correct, to
> fight with the compiler (and to alwa
Jens Theisen a écrit :
> Hello,
>
> I find it annoying that one has to write
>
> self.assertEqual(x, y)
>
> rather than just
>
> assert x == y
>
> when writing tests. This is a nuisance in all the programming
> languages I know of (which are not too many).
http://codespeak.net/py/current/doc/
azrael wrote:
> On Feb 7, 3:13 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>> Hi all,
>>
>> I'm interested in Parallel Python and I learned from the website of
>> Parallel Python
>> that it can run on SMP and clusters. But can it run on a our muti-CPU
>> server ?
>> We are running an origi
On Feb 6, 5:26 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am trying to write a python cgi that calls a script over ssh, the
> problem is the script takes a very long time to execute so Apache
> makes the CGI time out and I never see any output. The script is set
> to print a
I would like to add my problem in this thread.
I have a network application in Python which sends and recv using a single
socket.
There is a dictionary on which I store/read data values. I want to seperate
the send and recv functionality on two different processes so that the
parallel execution
I read about a free manual with adds,
but I can find it no-where.
you can find a tutorial here : http://www.serpia.org/spe
You can't have everything. Where would you put it? -- Steven Wright
---
please visit www.serpia.org
--
http://mail.python.org/mailman/listinfo/python-list
Robert Kern wrote:
> W. Watson wrote:
>> For some reason Python 2.2.4 cannot find the Numeric module. It's been
>> suggested that I should re-install the Numeric file. How do that? Also the
>> PIL. The three install files are:
>> python-2.4.4.msi
>> PIL-1.1.5.win32-py2.4.exe
>> Numeric-24.2.win32
On 2/8/07, Stef Mientki <[EMAIL PROTECTED]> wrote:
> limodou wrote:
> > Maybe you can try ulipad.
> >
> thanks,
> although it doesn't look bad,
> and it certainly must have been a huge job doing this with Tcl/Tk,
You are wrong, UliPad is based on wxPython, but not Tcl/Tk.
> I don't think it can c
S.Mohideen wrote:
> I would like to add my problem in this thread.
> I have a network application in Python which sends and recv using a single
> socket.
> There is a dictionary on which I store/read data values. I want to seperate
> the send and recv functionality on two different processes so t
Jerry Hill wrote:
> On 1/28/07, Scripter47 <[EMAIL PROTECTED]> wrote:
>> Can someone plz make a function for that takes a array, and then search
>> in it for duplicates, if it finds 2 or more items thats the same string
>> then delete all except 1.
>
> >>> myList = [1, 1, 2, 4, 8, 8, 8, 8, 8, 8,
On Wed, 07 Feb 2007 08:59:12 -0800, king kikapu wrote:
> I see what you mean by "duck typing". So you suggest the "do nothing
> at all" direction,
> better document my code so other can see what is expected, right ?
Generally speaking, yes, but not always.
The usual Python model is "better to as
On Wed, 07 Feb 2007 13:09:00 -0800, Don Morrison wrote:
> string.find is deprecated as per the official python documentation.
>
> take a look at the "re" module
Regular expressions are way, WAY overkill for a simple find. Just use
the string methods. Instead of this:
import string
string.find("
On Feb 8, 4:27 am, [EMAIL PROTECTED] wrote:
> First and foremost thanks for the feedback. Although I don't
> appreciate the slight dig at me.
> dummy = ldap_obj.simple_bind..
I _really_ don't think Uwe was intending any slight, 'dummy' generally
means 'dummy variable' ie it's just there to ca
> For some reason Python 2.2.4 cannot find the Numeric module. It's been
Is this a typo, or are you really using 2.2.4? If so, you are going to
have to get the versions of Numeric and PIL that work with Python 2.2.
Or, alternatively, you can install python 2.4.4 with the .msi file you
listed. You
On Feb 8, 10:42 am, "Karthik Gurusamy" <[EMAIL PROTECTED]> wrote:
> On Feb 6, 5:26 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > I am trying to write a python cgi that calls a script over ssh, the
> > problem is the script takes a very long time to execute so Apache
> > make
I'm feeling a little guilty here. I spent a lot of my free time last year
working on an x86 compiler for python. I made a reasonable amount of
progress, but my interests wandered off into other areas. I basically just
got bored and stopped working on the thing maybe 6 months ago. So today, I
we
On Feb 7, 12:36 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> There are two ways. You can use processes, or you can use IronPython.
Or you could try Parallel Python: http://www.parallelpython.com/
"a python module which provides mechanism for parallel execution of
python code on SMP and cl
Matimus wrote:
>> For some reason Python 2.2.4 cannot find the Numeric module. It's been
>
> Is this a typo, or are you really using 2.2.4? If so, you are going to
> have to get the versions of Numeric and PIL that work with Python 2.2.
> Or, alternatively, you can install python 2.4.4 with the .m
if you are new to python then this will be easier to understand. if
you change this a liitle bit (depending on syntax) it should work in
any language.
just copy and paste to a .py file
def main():
list, temp = [1, 1, 2, 4, 8, 8, 8, 8, 8, 8, 10], []
for i in range(len(list)):
if Che
Also,
MYMPI: http://peloton.sdsc.edu/~tkaiser/mympi/
PyMPI: http://sourceforge.net/projects/pympi
PyPar: http://datamining.anu.edu.au/~ole/pypar/
parallel: http://cheeseshop.python.org/pypi/parallel/0.2.3
Hopefully something here is of use to you :)
- alex23
--
http://mail.python.org/mailman/l
I want a specific packet format for packet exchange between a client
server across the network. For example frame format
as a python class could be:
class Frame:
def __init__(self, buffer=None, count=0, offset=0):
self.buffer = buffer
self.count = count
[EMAIL PROTECTED] wrote:
> I want a specific packet format for packet exchange between a
> client server across the network. For example frame format
> as a python class could be:
> class Frame:
> def __init__(self, buffer=None, count=0, offset=0):
> self.buffer = buffer
>
S.Mohideen wrote:
> There is a dictionary on which I store/read data values. I want to
> seperate the send and recv functionality on two different
> processes so that the parallel execution becomes fast.
What makes you think that'll be faster?
Remember:
- If you have one CPU, there is no paralle
hy guys
i've been googling and got several posts, but nothing that is a
satisfaction in my eyes. can someone tell me a nice uml diagram tool
with python export (if possible nice gui), or at least nice uml tool
gpl or freeware (widows) prefered
thanks
--
http://mail.python.org/mailman/listinfo/
En Wed, 07 Feb 2007 16:50:55 -0300, <[EMAIL PROTECTED]> escribió:
>> import subprocess
>> child1 = subprocess.Popen(["./TestTool"], cwd="/home")
>> child2 = subprocess.Popen(["sh","run.sh","load.xml"], cwd="/usr")
>>
>> Popen objects have a pid attribute. You don't have to use os.system to
>> kill
I'm using winsound and ossaudiodev to produce simple sounds (of set
frequency for a given duration) in a an application that is used on
Windows-based computer and Linux-based ones. Is there a similar
module for Mac OS?
André
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 8, 1:43 am, Bjoern Schliessmann wrote:
> [EMAIL PROTECTED] wrote:
> > I want a specific packet format for packet exchange between a
> > client server across the network. For example frame format
> > as a python class could be:
> > class Frame:
> > def __init__(self, buffer=None, cou
On 7 Feb 2007 19:14:13 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> struct module pack and unpack will only work for fixed size buffer :
> pack('>1024sIL', buffer, count. offset) but the buffer size can vary
> from one packet to the next :-(
Then send the size of the buffer before the buffer, s
BTW, I found a RemoveNumeric.exe and RemovePIL.exe in the C/Python24 folder,
but when I try to execute them, they produce a message about only being able
to use them at start-up.
--
http://mail.python.org/mailman/listinfo/python-list
En Thu, 08 Feb 2007 00:14:13 -0300, <[EMAIL PROTECTED]> escribió:
> On Feb 8, 1:43 am, Bjoern Schliessmann [EMAIL PROTECTED]> wrote:
>> [EMAIL PROTECTED] wrote:
>> > I want a specific packet format for packet exchange between a
>> > client server across the network. For example frame format
>> >
W. Watson wrote:
> Robert Kern wrote:
>> W. Watson wrote:
>>> For some reason Python 2.2.4 cannot find the Numeric module. It's been
>>> suggested that I should re-install the Numeric file. How do that? Also the
>>> PIL. The three install files are:
>>> python-2.4.4.msi
>>> PIL-1.1.5.win32-py2.4.
On 2007-02-08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> struct module pack and unpack will only work for fixed size buffer :
> pack('>1024sIL', buffer, count. offset) but the buffer size can vary
> from one packet to the next :-(
Oh for Pete's sake...
struct.pack('>%dsIL' % len(buffer), b
All my python books and references I find on the web have simplistic
examples of the IF conditional. A few also provide examples of multiple
conditions that are ANDed; e.g.,
if cond1:
if cond2:
do_something.
However, I cannot find, nor create by trial-and-er
azrael schrieb:
> hy guys
>
> i've been googling and got several posts, but nothing that is a
> satisfaction in my eyes. can someone tell me a nice uml diagram tool
> with python export (if possible nice gui), or at least nice uml tool
>
> gpl or freeware (widows) prefered
>
> thanks
>
Take a l
[EMAIL PROTECTED] wrote:
> However, I cannot find, nor create by trial-and-error, the syntax for
> alternative conditions that are ORed; e.g.,
>
> if cond1 OR if cond2:
> do_something.
if cond1 or cond2:
do_something()
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] writes:
> if cond1:
> if cond2:
> do_something.
You can write:
if cond1 and cond2:
do_something
> if cond1 OR if cond2:
> do_something.
if cond1 or cond2:
do_something
> I've tried using the C syntax for OR (||) but p
Grant Olson wrote:
> The basic approach I took was compiling to bytecode, and then
> transliterating python bytecode to x86 asm. And it is working a little bit.
An interesting option might be to generate the byte code used by
the SpiderMonkey engine in Mozilla. That's used to handle both
Ja
Neil Cerutti wrote:
> There's been only one (or two?) languages in history that
> attempted to provide programmers with the ability to implement
> new infix operators, including defining precedence level and
> associativity (I can't think of the name right now).
You're probably thinking of SML or
> Martin v. Löwis schrieb:
>
>>A partial class is a fragment of a class definition;
>>partial classes allow to spread the definition of
>>a class over several modules.
When I want to do this, usually I define the parts
as ordinary, separate classes, and then define the
main class as inheriting fr
Dave Benjamin wrote:
> Neil Cerutti wrote:
>
>> There's been only one (or two?) languages in history that
>> attempted to provide programmers with the ability to implement
>> new infix operators, including defining precedence level and
>> associativity (I can't think of the name right now).
>
> Y
En Thu, 08 Feb 2007 01:01:38 -0300, <[EMAIL PROTECTED]>
escribió:
> However, I cannot find, nor create by trial-and-error, the syntax for
> alternative conditions that are ORed; e.g.,
>
> if cond1 OR if cond2:
> do_something.
>
> Please pass me a pointer so I can learn how to
André wrote:
> I'm using winsound and ossaudiodev to produce simple sounds (of set
> frequency for a given duration) in a an application that is used on
> Windows-based computer and Linux-based ones. Is there a similar
> module for Mac OS?
Use SDL?
http://gna.org/projects/pysdlmixer/
I've never
On 8 Feb., 17:00, John Nagle <[EMAIL PROTECTED]> wrote:
> Grant Olson wrote:
> > The basic approach I took was compiling to bytecode, and then
> > transliterating python bytecode to x86 asm. And it is working a little bit.
>
> An interesting option might be to generate the byte code used by
>
Gosi wrote:
> On Feb 7, 3:46 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>> In <[EMAIL PROTECTED]>, Gosi wrote:
>>> I like to use J for many things and I think that combining Python and
>>> J is a hell of a good mixture.
>> I was able to follow this sentence up to and including the word
101 - 182 of 182 matches
Mail list logo