Re: Calling J from Python

2007-02-07 Thread Tina I
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

Re: Does the world need another v0.1 python compiler?

2007-02-07 Thread Kay Schluehr
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 >

Re: winsound/ossaudiodev equivalent on a mac

2007-02-07 Thread Daniel O'Connor
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

Re: 'IF' Syntax For Alternative Conditions

2007-02-07 Thread Gabriel Genellina
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

Re: Overloading the tilde operator?

2007-02-07 Thread greg
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

Re: Partial 1.0 - Partial classes for Python

2007-02-07 Thread greg
> 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

Re: Overloading the tilde operator?

2007-02-07 Thread Dave Benjamin
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

Re: Does the world need another v0.1 python compiler?

2007-02-07 Thread John Nagle
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

Re: 'IF' Syntax For Alternative Conditions

2007-02-07 Thread Paul Rubin
[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

Re: 'IF' Syntax For Alternative Conditions

2007-02-07 Thread Leif K-Brooks
[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

Re: uml and python

2007-02-07 Thread Ralf Schönian
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

'IF' Syntax For Alternative Conditions

2007-02-07 Thread rshepard
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

Re: help on packet format for tcp/ip programming

2007-02-07 Thread Grant Edwards
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

Re: Re-installing Numeric and PIL Files

2007-02-07 Thread Robert Kern
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.

Re: help on packet format for tcp/ip programming

2007-02-07 Thread Gabriel Genellina
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 >> >

Re: Re-installing Numeric and PIL Files

2007-02-07 Thread W. Watson
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

Re: help on packet format for tcp/ip programming

2007-02-07 Thread Felipe Almeida Lessa
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

Re: help on packet format for tcp/ip programming

2007-02-07 Thread rattan
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

winsound/ossaudiodev equivalent on a mac

2007-02-07 Thread André
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

Re: need help to kill a process

2007-02-07 Thread Gabriel Genellina
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

uml and python

2007-02-07 Thread azrael
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/

Re: multithreading concept

2007-02-07 Thread Bjoern Schliessmann
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

Re: help on packet format for tcp/ip programming

2007-02-07 Thread Bjoern Schliessmann
[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 >

help on packet format for tcp/ip programming

2007-02-07 Thread rattan
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

Re: Threading in Python

2007-02-07 Thread alex23
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

Re: Array delete

2007-02-07 Thread azrael
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

Re: Re-installing Numeric and PIL Files

2007-02-07 Thread W. Watson
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

Re: Threading in Python

2007-02-07 Thread alex23
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

Does the world need another v0.1 python compiler?

2007-02-07 Thread Grant Olson
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

Re: Running long script in the background

2007-02-07 Thread [EMAIL PROTECTED]
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

Re: Re-installing Numeric and PIL Files

2007-02-07 Thread Matimus
> 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

Re: Group Membership in Active Directory Query

2007-02-07 Thread alex23
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

Re: string.find for case insensitive search

2007-02-07 Thread Steven D'Aprano
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("

Re: Object type check

2007-02-07 Thread Steven D'Aprano
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

Re: Array delete

2007-02-07 Thread Steven Bethard
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,

Re: multithreading concept

2007-02-07 Thread Carl J. Van Arsdall
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

Re: Python editor

2007-02-07 Thread limodou
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

Re: Re-installing Numeric and PIL Files

2007-02-07 Thread W. Watson
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

Re: Python editor

2007-02-07 Thread dimitri pater
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

Re: multithreading concept

2007-02-07 Thread S.Mohideen
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

Re: Running long script in the background

2007-02-07 Thread Karthik Gurusamy
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

Re: Can Parallel Python run on a muti-CPU server ?

2007-02-07 Thread Martin P. Hellwig
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

Re: idea for testing tools

2007-02-07 Thread Bruno Desthuilliers
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/

Re: Object type check

2007-02-07 Thread Bruno Desthuilliers
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

Re: Python new user question - file writeline error

2007-02-07 Thread Bruno Desthuilliers
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

Re: Python new user question - file writeline error

2007-02-07 Thread Jerry Hill
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

Re: Re-installing Numeric and PIL Files

2007-02-07 Thread Robert Kern
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

Re-installing Numeric and PIL Files

2007-02-07 Thread W. Watson
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

Re: string.find for case insensitive search

2007-02-07 Thread Don Morrison
> 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

Re: Python new user question - file writeline error

2007-02-07 Thread James
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 > > >

Re: string.find for case insensitive search

2007-02-07 Thread Steve Holden
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

Re: multithreading concept

2007-02-07 Thread Carl J. Van Arsdall
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

Re: Object type check

2007-02-07 Thread king kikapu
> 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

Re: Python does not play well with others

2007-02-07 Thread azrael
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

Re: Python new user question - file writeline error

2007-02-07 Thread Shawn Milo
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

Re: string.find for case insensitive search

2007-02-07 Thread Don Morrison
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 .

Re: Array delete

2007-02-07 Thread Jerry Hill
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(

Re: string.find for case insensitive search

2007-02-07 Thread Duncan Booth
"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

Re: Can Parallel Python run on a muti-CPU server ?

2007-02-07 Thread azrael
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

Re: string.find for case insensitive search

2007-02-07 Thread Robert Kern
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

Re: mplayer bug or python bug?

2007-02-07 Thread Szabolcs Nagy
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

idea for testing tools

2007-02-07 Thread Jens Theisen
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

Re: what is wrong with my python code?

2007-02-07 Thread John Machin
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

Re: string.find for case insensitive search

2007-02-07 Thread Don Morrison
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

Re: string.find for case insensitive search

2007-02-07 Thread Larry Bates
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

Re: string.find for case insensitive search

2007-02-07 Thread Bruno Desthuilliers
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

Re: Object type check

2007-02-07 Thread Bruno Desthuilliers
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

Re: string.find for case insensitive search

2007-02-07 Thread Don Morrison
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

Re: string.find for case insensitive search

2007-02-07 Thread Duncan Booth
"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

Re: Can somebody give me a python code for this?

2007-02-07 Thread John Salerno
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

string.find for case insensitive search

2007-02-07 Thread Johny
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

Re: Question

2007-02-07 Thread Mohammad Tayseer
> 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

web programming with Python

2007-02-07 Thread JoJo
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

subway code

2007-02-07 Thread Daniel Nogradi
(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

subway code

2007-02-07 Thread Daniel Nogradi
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

Array delete

2007-02-07 Thread Andreas Lysdal
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 -- _.____ __

Array delete

2007-02-07 Thread Scripter47
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

Re: Simple SVN/CVS-like library in Python?

2007-02-07 Thread Gary Herron
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

Re: Simple SVN/CVS-like library in Python?

2007-02-07 Thread Steve Holden
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

Re: Can somebody give me a python code for this?

2007-02-07 Thread Grant Edwards
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

Re: How can I use __setitem__ method of dict object?

2007-02-07 Thread Bruno Desthuilliers
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

Re: Can somebody give me a python code for this?

2007-02-07 Thread John
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

Simple SVN/CVS-like library in Python?

2007-02-07 Thread Andrea Gavana
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. Obviously, the possible modifications

Re: Object type check

2007-02-07 Thread king kikapu
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" But this way, i would rather defeat the purpose because i have to try/ catch in *every*

Re: Can somebody give me a python code for this?

2007-02-07 Thread hg
John 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. Your teacher ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Object type check

2007-02-07 Thread Bruno Desthuilliers
king kikapu a écrit : >>Dont restrict them to particular types. You would >>not restrict them to a particular class in C#. Instead, you define the >>interfaces simply by how you use the objects. > > > Of cource i restrict them to particular types! In C# you cannot pass > something bad > this way

Re: Object type check

2007-02-07 Thread Bruno Desthuilliers
king kikapu a écrit : > Hi to all, > > in statically-types languages, let's say C# for example, we use > polymorphism through interfaces. So we define an interface I with > method M and then a class C that implements I interface and write code > for the M method. > So, if we have a function that t

Re: multithreading concept

2007-02-07 Thread sturlamolden
On Feb 7, 8:03 pm, Sergei Organov <[EMAIL PROTECTED]> wrote: > I fail to see how threads in general could perform worse than > processes. I do understand that processes are inherently more > safe/secure, but when it comes to speed I really can't imagine why it > could happen that threads perform w

Re: Python editor

2007-02-07 Thread Stef Mientki
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, I don't think it can compete with PyScripter, except on Linux ;-) succes, cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-l

Re: what is wrong with my python code?

2007-02-07 Thread Bruno Desthuilliers
Dongsheng Ruan a écrit : > 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) > The error message is quite clear when you remember that () is the call operator. Fo

Re: distutils: renaming setup.py ok?

2007-02-07 Thread Anastasios Hatzis
Hello Benjamin Niemann wrote: > Hello, > > Anastasios Hatzis wrote: > >> I want to distribute Python site-packages. Is it okay to use other setup >> file names than setup.py, which is mentioned in any place I read in the >> doc? >> >> E.g., setupMySDK.py, setupMyLib.py >> >> It seems that it wor

Re: Can somebody give me a python code for this?

2007-02-07 Thread Bruno Desthuilliers
John a écrit : > 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. > > http://www.catb.org/~esr/faqs/smart-questions.html#homework -- http://mai

Re: Python new user question - file writeline error

2007-02-07 Thread Bruno Desthuilliers
James a écrit : > 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,'AUG': > 8,'SEP':9,'OCT':10,'NOV':11,'DEC':

calling python from msc.adams

2007-02-07 Thread boris . smirnov
Hello all, i need to call python from msc.adams. the syntax is "mdi -c python exit" I have created a linux script called "run_python" with this content: mdi -c python $* exit then a call this script with a command: run_python script.py param1 param2 paramN Everything looks OK, but the prob

Re: need help to kill a process

2007-02-07 Thread elrondrules
On Feb 6, 8:24 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 06 Feb 2007 22:59:40 -0300, <[EMAIL PROTECTED]> escribió: > > > > > > > this is my code snip. > > within my python script I have the following commands.. > > > > > > import os > > ... > > os.system ("cd /home; ./TestTool &

Re: mplayer bug or python bug?

2007-02-07 Thread MRAB
On Feb 7, 11:40 am, Marco <[EMAIL PROTECTED]> 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 n

Python new user question - file writeline error

2007-02-07 Thread James
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,'AUG': 8,'SEP':9,'OCT':10,'NOV':11,'DEC':12} infile=file('TVA-0316','r') outfile=

Can somebody give me a python code for this?

2007-02-07 Thread John
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. -- http://mail.python.org/mailman/listinfo/python-list

Pyserial example program error: win32file.SetupComm reports 'Incorrect function.'

2007-02-07 Thread Ron Jackson
I am using Python 2.5 on Windows XP. I have installed Pyserial and win32all extensions. When I try to run the example program scan.py (included below), or any other program using pyserial, as soon as it hits the statement: s = serial.Serial(i) I get the error: Traceback (most recent call last)

Re: multithreading concept

2007-02-07 Thread Sergei Organov
"sturlamolden" <[EMAIL PROTECTED]> writes: > On Feb 7, 6:17 pm, John Nagle <[EMAIL PROTECTED]> wrote: [...] > MPI does not use threads on SMPs because it performs worse than using > multiple processes. I fail to see how threads in general could perform worse than processes. I do understand that pr

  1   2   >