Re: WebScraping

2006-11-19 Thread Graham Feeley
Well I would like to publicly thank Bernard Chhun for actually writing this script and "pretting " it up for me. He is truly a talented guy. He used Beautifull Soup and Regex which i am still coming to terms trying to understand them any way Thanks again Bernard. Regards graham "Graham Feeley" <

Re: basic python questions

2006-11-19 Thread Paul McGuire
"Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote: > > >> I am currently going to school at Utah Valley State College, the course >> that I am taking is analysis of programming languages. It's an upper >> division course but our teacher wa

Re: Finding skilled pythonistas for micro-jobs?

2006-11-19 Thread Nick Vatamaniuc
If you are agile it means that the developer is in constant communication with the user/client often changing and updating the requirements. The typical work that you specify though is not of that nature because it a list of specifications and then the coder implements it, and when done gets back

Why isn't SPLIT splitting my strings

2006-11-19 Thread ronrsr
I'm trying to break up the result tuple into keyword phrases. The keyword phrases are separated by a ; -- the split function is not working the way I believe it should be. Can anyone see what I"m doing wrong? bests, -rsr- print "newstring =", str(result[i][0]) print "just split", st

Re: Why isn't SPLIT splitting my strings

2006-11-19 Thread Nick Vatamaniuc
The regular string split does not take a _class_ of characters as the separator, it only takes one separator. Your example suggests that you expect that _any_ of the characters "; ()[]" could be a separator. If you want to use a regular expression as a list of separators, then you need to use the s

Re: Why isn't SPLIT splitting my strings

2006-11-19 Thread Fredrik Lundh
ronrsr wrote: > I'm trying to break up the result tuple into keyword phrases. The > keyword phrases are separated by a ; -- the split function is not > working the way I believe it should be. >>> help(str.split) split(...) S.split([sep [,maxsplit]]) -> list of strings Return a lis

Re: Why isn't SPLIT splitting my strings

2006-11-19 Thread Duncan Booth
"ronrsr" <[EMAIL PROTECTED]> wrote: > I'm trying to break up the result tuple into keyword phrases. The > keyword phrases are separated by a ; -- the split function is not > working the way I believe it should be. Can anyone see what I"m doing > wrong? I think your example boils down to: >>> h

need help?

2006-11-19 Thread JFletcher
Get Python help at TheScripts [dot] com -- http://mail.python.org/mailman/listinfo/python-list

Re: Why isn't SPLIT splitting my strings

2006-11-19 Thread Paul McGuire
"ronrsr" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm trying to break up the result tuple into keyword phrases. The > keyword phrases are separated by a ; -- the split function is not > working the way I believe it should be. Can anyone see what I"m doing > wrong? > > bests,

Re: basic python questions

2006-11-19 Thread John Machin
Paddy wrote: > John Machin wrote: > > > > [Aside] How are you going to explain all this to your instructor, who > > may be reading all this right now? > > > > The instructor should be proud! > He has managed to do his very first post to a this newsgroup, about a > homework question, and do it in t

Re: Programmatically finding "significant" data points

2006-11-19 Thread robert
erikcw wrote: > Hi all, > > I have a collection of ordered numerical data in a list. The numbers > when plotted on a line chart make a low-high-low-high-high-low (random) > pattern. I need an algorithm to extract the "significant" high and low > points from this data. > > Here is some sample da

Re: A python IDE for teaching that supports cyrillic i/o

2006-11-19 Thread Leo Kislov
Kirill Simonov wrote: > Hi, > > Could anyone suggest me a simple IDE suitable for teaching Python as a > first programming language to high school students? It is necessary > that it has a good support for input/output in Cyrillic. > > Unfortunately, most IDEs I tried failed miserably in this resp

Re: A python IDE for teaching that supports cyrillic i/o

2006-11-19 Thread Alan Franzoni
Kirill Simonov si è divertito a scrivere: > Unfortunately, most IDEs I tried failed miserably in this respect. My > test was simple: I've run the code > name = raw_input("What's your name? ") # written in Russian > print "Hello, %s!" % name # in Russian as well > both from

Re: Finding skilled pythonistas for micro-jobs?

2006-11-19 Thread John Machin
darran wrote: > I'm a partner in a design and technology studio that creates > large-scale interactive exhibits for museums. We are agile - by > choice. For big 6-12 month projects, we try and secure exceptional > python talent on contract. The python job board addresses this need. > > Every fe

Re: [Zopyrus] A python IDE for teaching that supports cyrillic i/o

2006-11-19 Thread Alexey Wasilyev
Здравствуйте, Kirill. Вы писали 18 ноября 2006 г., 22:22:48: >> > Could anyone suggest me a simple IDE suitable for teaching Python as a >> > first programming language to high school students? >> >>Does it have to be an IDE? Wouldn't it be better to use a simple text >> editor + command line

tempfile.NamedTemporaryFile wont work

2006-11-19 Thread Imbaud Pierre
On suse 9.3, tempfile.NamedTemporaryFile() doesnt work as expected. (I found a permanent workaround, so I dont ask for help) I expected to write to a file, and access it thru a shell command. This code, in a loop: tf = tempfile.NamedTemporaryFile() tfName = tf.name

Re: tempfile.NamedTemporaryFile wont work

2006-11-19 Thread Bjoern Schliessmann
Imbaud Pierre wrote: > tf = tempfile.NamedTemporaryFile() > tfName = tf.name > [...] > print >> sys.stderr, '%s: %s' % (tfName, ['no', > 'yes'][os.path.exists(tfName)]) > subprocess.Popen(['strings', tfName]) Just out of curiosity: Why did you a

Re: syntax error in sum(). Please explicate.

2006-11-19 Thread Bjoern Schliessmann
Paul Rubin wrote: > Generator comprehensions Are generator comprehensions and generator expressions the same? Regards, Björn -- BOFH excuse #35: working as designed -- http://mail.python.org/mailman/listinfo/python-list

Re: decompiler

2006-11-19 Thread Bjoern Schliessmann
Fuzzyman wrote: > That's terrible. You read comp.lang.perl.misc *as well* ? > > ;-) You have to know your enemy ;) Regards, Björn -- BOFH excuse #343: The ATM board has run out of 10 pound notes. We are having a whip round to refill it, care to contribute ? -- http://mail.python.org/mai

ElementTree: namespace declaration in each element?

2006-11-19 Thread cyberco
The (excellent) ElementLibrary ads namespaces to each element when writing the tree back to a file. Say I do: tree = ET.parse('playlist.xml') tree.write(outFile) with the following XML: = http://xspf.org/ns/0/";> Kick off! = Writ

Re: syntax error in sum(). Please explicate.

2006-11-19 Thread Fredrik Lundh
Bjoern Schliessmann wrote: > Are generator comprehensions and generator expressions the same? the documentation uses the word "expression", not comprehension. -- http://mail.python.org/mailman/listinfo/python-list

Re: ElementTree: namespace declaration in each element?

2006-11-19 Thread Fredrik Lundh
cyberco wrote: > Unfortunately the client that needs to consume this XML can't handle > the 'ns0:' part of each tag. > Is there a way to output XML similar to the input? written by a "it's the bytes, not the data" guy, obviously ;-) the standard serializer in 1.2 doesn't support default namesp

Re: lxml/ElementTree and .tail

2006-11-19 Thread Uche Ogbuji
Fredrik Lundh wrote: > Uche Ogbuji wrote: > > > I certainly have never liked the aspects of the ElementTree API under > > present discussion. But that's not as important as the fact that I > > think the above statement is misleading. There has always been a > > battle in XML between the people w

Re: tempfile.NamedTemporaryFile wont work

2006-11-19 Thread Steven D'Aprano
On Sun, 19 Nov 2006 13:11:13 +0100, Imbaud Pierre wrote: > On suse 9.3, tempfile.NamedTemporaryFile() doesnt work as expected. [snip] > Symptom: the file does not always exist, after the call to > NamedTemporaryFile(). Or at least its not seen by the strings command, > or by os.path.exists. > >

Re: [Zopyrus] A python IDE for teaching that supports cyrillic i/o

2006-11-19 Thread tool69
Sorry, but did someone knows if Pida works under Windows ? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: A python IDE for teaching that supports cyrillic i/o

2006-11-19 Thread Kirill Simonov
On Sun, Nov 19, 2006 at 12:33:39PM +0100, Alan Franzoni wrote: > Kirill Simonov si è divertito a scrivere: > > > Unfortunately, most IDEs I tried failed miserably in this respect. My > > test was simple: I've run the code > > name = raw_input("What's your name? ") # written in Russian > >

Re: tempfile.NamedTemporaryFile wont work

2006-11-19 Thread Steven D'Aprano
On Sun, 19 Nov 2006 13:18:39 +0100, Bjoern Schliessmann wrote: > Imbaud Pierre wrote: > >> tf = tempfile.NamedTemporaryFile() >> tfName = tf.name >> [...] >> print >> sys.stderr, '%s: %s' % (tfName, ['no', >> 'yes'][os.path.exists(tfName)]) >> s

Re: lxml/ElementTree and .tail

2006-11-19 Thread Uche Ogbuji
Paul McGuire wrote: > Thankfully, I'm largely on the periphery of that universe (except for being > a sometimes victim). But it is certainly frustrating to see many of the OMG > concepts of the 90's reimplemented in Java services, and then again in > XML/SOAP, with no detectable awareness that the

Re: A python IDE for teaching that supports cyrillic i/o

2006-11-19 Thread Alan Franzoni
Kirill Simonov si è divertito a scrivere: > On Sun, Nov 19, 2006 at 12:33:39PM +0100, Alan Franzoni wrote: > No, I would prefer the editor to save the .py files with non-ASCII > characters in UTF-8 encoding adding the BOM at the beginning of the > file. This will allow the interpreted to detect

Re: A python IDE for teaching that supports cyrillic i/o

2006-11-19 Thread Kirill Simonov
On Sun, Nov 19, 2006 at 03:27:32AM -0800, Leo Kislov wrote: > IDLE on Windows works fine for your example in interactive console: > > >>> name = raw_input("What's your name? ") Have you tried to use cyrillic characters in a Python string in interactive console? When I do it, I get the "Unsupporte

Re: How do I stop Python IDLE (GUI) from immediately exiting when I enter it?

2006-11-19 Thread BartlebyScrivener
John (Z R) L wrote: > But after clicking "run module" Being new is never problem, but do learn to provide concise, complete descriptions of exactly what happened and what you were doing at the time. Are you in IDLE? Or are you in PythonWin? OR did you make a script file and try to run it by dou

Re: tempfile.NamedTemporaryFile wont work

2006-11-19 Thread Peter Otten
Steven D'Aprano wrote: > On Sun, 19 Nov 2006 13:11:13 +0100, Imbaud Pierre wrote: > >> On suse 9.3, tempfile.NamedTemporaryFile() doesnt work as expected. > [snip] > >> Symptom: the file does not always exist, after the call to >> NamedTemporaryFile(). Or at least its not seen by the strings com

Re: lxml/ElementTree and .tail

2006-11-19 Thread Diez B. Roggisch
> You'll be surprised at how many XMLers agree that Web services are a > pretty inept reinvention of CORBA. I was pretty much slain by this > take: > > http://wanderingbarque.com/nonintersecting/2006/11/15/the-s-stands-for-simple Thanks for that! Sums up nicely my experiences, and gave me a good

Re: A python IDE for teaching that supports cyrillic i/o

2006-11-19 Thread Kirill Simonov
On Sun, Nov 19, 2006 at 03:13:30PM +0100, Alan Franzoni wrote: > Kirill Simonov si è divertito a scrivere: > > > On Sun, Nov 19, 2006 at 12:33:39PM +0100, Alan Franzoni wrote: > > > No, I would prefer the editor to save the .py files with non-ASCII > > characters in UTF-8 encoding adding the BO

failure building python 2.5 on mac os x 10.3.9

2006-11-19 Thread Thomas Ploch
Hello, I followed the instructions in the Mac/README file. I ran ./configure --enable-framework But when I try to build from source with gcc 4.0.2, following happens: [snip] libtool: can't locate file for: -lSystemStubs libtool: file: -lSystemStubs is not an object file (not allowed in a libra

Re: lxml/ElementTree and .tail

2006-11-19 Thread Fredrik Lundh
Uche Ogbuji wrote: > The fact that the XML Infoset is hardly used outside W3C XML Schema, > and that the XPath data model is far more common, and that focus on > the serialization is even more common than that is a matter of > everyday practicality. everyday interoperability problems, that is

Re: lxml/ElementTree and .tail

2006-11-19 Thread Chas Emerick
On Nov 19, 2006, at 9:55 AM, Fredrik Lundh wrote: >> And oh by the way, this thread is all about *your* customer's >> complaining. > > from what I can tell, it was *your* customer posting FUD about a > different library, not my customer asking for help with a specific > problem. this is free soft

Re: Re:A python IDE for teaching that supports cyrillic i/o

2006-11-19 Thread Kirill Simonov
On Sat, Nov 18, 2006 at 06:11:48PM -0800, PyScripter wrote: > Kirill Simonov wrote: > > PyScripter does, indeed, look nice, but unfortunately it appeared to > > have similar issues with cyrillic support. Thank you anyway for the > > suggestion. > > > What are the issues? PyScripter offers full s

Re: lxml/ElementTree and .tail

2006-11-19 Thread Fredrik Lundh
Uche Ogbuji wrote: > The fact that the XML Infoset is hardly used outside W3C XML Schema, > and that the XPath data model is far more common, and for the bystanders, it should be noted that the Infoset is pretty much the same thing as the XPath data model; it's mostly just that the specificatio

A little confuse

2006-11-19 Thread [EMAIL PROTECTED]
When I run this code in the pdb it works. accountNbr = 1 for testLine in ftest.readlines(): acct = testLine[1:2] #there account number if accountNbr == int(acct): accountNbr = accountNbr + 1 When I run without the debugger I get this error. File "./casco

Re: how to print pdf with python on a inkjet printer.

2006-11-19 Thread Thomas Heller
Gabriel Genellina schrieb: > At Friday 17/11/2006 17:40, Tim Roberts wrote: > >> > double wow! as it is my customer wants me to print to the default >> > printer. >> > can you please help me with the command for rendering the pdf to the >> > printer with acrobat using python? >> >>You'll have to

Re: Why isn't SPLIT splitting my strings

2006-11-19 Thread John Henry
Meaning: import re newString= re.split('[; ()\[\]", result) Nick Vatamaniuc wrote: > The regular string split does not take a _class_ of characters as the > separator, it only takes one separator. Your example suggests that you > expect that _any_ of the characters "; ()[]" could be a separato

Re: Why isn't SPLIT splitting my strings

2006-11-19 Thread John Henry
Oops! newString= re.split("[; ()\[\]", result) John Henry wrote: > Meaning: > > import re > > newString= re.split('[; ()\[\]", result) > > > > Nick Vatamaniuc wrote: > > The regular string split does not take a _class_ of characters as the > > separator, it only takes one separator. Your example

Re: A little confuse

2006-11-19 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > When I run this code in the pdb it works. > accountNbr = 1 > for testLine in ftest.readlines(): > acct = testLine[1:2] #there account number > if accountNbr == int(acct): > accountNbr = accountNbr + 1 > > When I run without the

Re: how to print pdf with python on a inkjet printer.

2006-11-19 Thread km
i dont see os.startfile in python2.5 installation on my system :-( KM On 11/19/06, Thomas Heller <[EMAIL PROTECTED]> wrote: Gabriel Genellina schrieb: > At Friday 17/11/2006 17:40, Tim Roberts wrote: > >> > double wow! as it is my customer wants me to print to the default >> > printer. >> > ca

Re: Why isn't SPLIT splitting my strings

2006-11-19 Thread Fredrik Lundh
John Henry wrote: > Oops! for cases like this, writing "[" + re.escape(charset) + "]" is usually a good way to avoid repeated oops:ing. > newString= re.split("[; ()\[\]", result) >>> newString= re.split("[; ()\[\]", result) Traceback (most recent call last): ... sre_constants.er

Re: Reloading after from adder import * ????

2006-11-19 Thread Seymour
John, Thanks for the reply. Just as a little further background, I am using Windows XP and Komodo and just trying to learn about classes - how they work, what they are used for, etc. I have been studying "Learning Python (2nd Ed)" by Mark Lutz and Davis Ascher and have been typing in some of the

Re: lxml/ElementTree and .tail

2006-11-19 Thread Damjan
> sure, the computing world is and has always been full of people who want > the simplest thing to look a lot harder than it actually is. after all, > *they* spent lots of time reading all the specifications, they've bought > all the books, and went to all the seminars, and have been sold all th

Re: Reloading after from adder import * ????

2006-11-19 Thread Fredrik Lundh
Seymour wrote: > I just made some typos and was wondering if there was an easier > way to clear the Python namespace at the interactive prompt rather than > shutting Komodo down and restarting (really brute force). most IDE's have a "reset interactive mode" command (it's ctrl-F6 in IDLE, for ex

Re: How do I stop Python IDLE (GUI) from immediately exiting when I enter it?

2006-11-19 Thread Hertha Steck
Am Sat, 18 Nov 2006 23:24:08 -0800 schrieb John (Z R) L: > Hi all, I am very new to programming, and I chose to study the Python > language before C++. I am currently using the Wikibooks > "Non-Programmer's Tutorial for Python", and am up to the section "Who > goes there"? > > http://en.wikibooks

Re: About alternatives to Matlab

2006-11-19 Thread sturlamolden
sturlamolden wrote: > def D4_Transform(x, s1=None, d1=None, d2=None): >""" >D4 Wavelet transform in NumPy >(C) Sturla Molden >""" >C1 = 1.7320508075688772 >C2 = 0.4330127018922193 >C3 = -0.066987298107780702 >C4 = 0.51763809020504137 >C5 = 1.9318516525781364 >

Re: basic python questions

2006-11-19 Thread [EMAIL PROTECTED]
I normaly try to be as resourceful as I can. I find that newgroups give a wide range of answers and solutions to problems and you get a lot responses to what is the right way to do things and different point of views about the language that you can't find in help manuals. I also want to thank every

Re: decompiler

2006-11-19 Thread John Bokma
Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > Fuzzyman wrote: > >> That's terrible. You read comp.lang.perl.misc *as well* ? >> >> ;-) > > You have to know your enemy ;) LOL :-) I am a Perl programmer who wants to keep up his Perl skills, and to study Python. -- John

Re: Why isn't SPLIT splitting my strings

2006-11-19 Thread John Henry
Fredrik Lundh wrote: > John Henry wrote: > > > Oops! > > for cases like this, writing > > "[" + re.escape(charset) + "]" > So, like this? newString= re.split("[" + re.escape("; ()[]") + "]", result) > is usually a good way to avoid repeated oops:ing. > > > newString= re.split("[; ()\[\]"

[ANN] clnum-1.4 Class Library For Numbers Python Binding

2006-11-19 Thread Raymond L. Buvel
The clnum package adds rational numbers and arbitrary precision floating point numbers in real and complex form to Python. Also provides arbitrary precision floating point replacements for the functions in the math and cmath standard library modules. Home page: http://calcrpnpy.sourceforge.net/cln

[ANN] ratfun-2.4 Polynomials and Rational Functions

2006-11-19 Thread Raymond L. Buvel
The ratfun module provides classes for defining polynomial and rational function (ratio of two polynomials) objects. These objects can be used in arithmetic expressions and evaluated at a particular point. Home page: http://calcrpnpy.sourceforge.net/ratfun.html Note: If you are using rpncalc-1.2

[ANN] rpncalc-2.5 RPN Calculator for Python

2006-11-19 Thread Raymond L. Buvel
The rpncalc package adds an interactive Reverse Polish Notation (RPN) interpreter to Python. This interpreter allows the use of Python as an RPN calculator. You can easily switch between the RPN interpreter and the standard Python interpreter. Home page: http://calcrpnpy.sourceforge.net/ Chang

Re: Re: decompiler

2006-11-19 Thread Skip Montanaro
> You have to know your enemy ;) We have met the enemy and they are us. http://www.igopogo.com/we_have_met.htm ;-) Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: tempfile.NamedTemporaryFile wont work

2006-11-19 Thread Imbaud Pierre
Steven D'Aprano a écrit : > On Sun, 19 Nov 2006 13:18:39 +0100, Bjoern Schliessmann wrote: > > >>Imbaud Pierre wrote: >> >> >>> tf = tempfile.NamedTemporaryFile() >>> tfName = tf.name >>>[...] >>> print >> sys.stderr, '%s: %s' % (tfName, ['no', >>>'yes'][os.pat

Re: tempfile.NamedTemporaryFile wont work

2006-11-19 Thread Imbaud Pierre
Peter Otten a écrit : > Steven D'Aprano wrote: > > >>On Sun, 19 Nov 2006 13:11:13 +0100, Imbaud Pierre wrote: >> >> >>>On suse 9.3, tempfile.NamedTemporaryFile() doesnt work as expected. >> >>[snip] >> >> >>>Symptom: the file does not always exist, after the call to >>>NamedTemporaryFile(). Or at

Re: ElementTree: namespace declaration in each element?

2006-11-19 Thread cyberco
> written by a "it's the bytes, not the data" guy, obviously ;-) hehehe...I figured it was. Wonder 'who' it was... ;) > the standard serializer in 1.2 doesn't support default namespaces, so > the quickest way to do this is to loop over all tags (use getiterator), > strip off the "{http://xspf.org

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-19 Thread gabor
Martin v. Löwis wrote: > gabor schrieb: >> depends on the application. in the one where it happened i would just >> display an error message, and tell the admins to check the >> filesystem-encoding. >> >> (in other ones, where it's not critical to get the correct name, i would >> probably just conv

Re: ElementTree: namespace declaration in each element?

2006-11-19 Thread Fredrik Lundh
cyberco wrote: > OK, that's what I was already doing. Thanks. > Will the standard serializer in 1.3 support default namespaces? that's the plan. I've been working on a more modular XML writer, which will make it easier to tweak the output in various ways, without having to write everything fro

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-19 Thread Fredrik Lundh
gabor wrote: > yes, sure... but then.. it's possible to implement it also on top of an > raise-when-error version :) not necessarily if raise-when-error means raise-error-in-os-listdir. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-19 Thread gabor
Fredrik Lundh wrote: > gabor wrote: > >> yes, sure... but then.. it's possible to implement it also on top of >> an raise-when-error version :) > > not necessarily if raise-when-error means raise-error-in-os-listdir. > could you please clarify? currently i see 2 approaches how to do it on the

Re: About alternatives to Matlab

2006-11-19 Thread Filip Wasilewski
sturlamolden wrote: [...] > Here is the correct explanation: > > The factorization of the polyphase matrix is not unique. There are > several valid factorizations. Our implementations corresponds to > different factorizations of the analysis and synthesis poyphase > matrices, and both are in a senc

Problem with icon on menubar

2006-11-19 Thread Vyz
I have given icon like this to main frame of my program ib=wx.IconBundle() ib.AddIconFromFile("SriPadma.ico",wx.BITMAP_TYPE_ANY) self.SetIcons(ib and then I have made binary with py2exe and in setup file mentioned it as icon resource. windows = [ {

Re: About alternatives to Matlab

2006-11-19 Thread Filip Wasilewski
sturlamolden wrote: > > Actually, there was a typo in the original code. I used d1[l-1] where I > should have used d1[l+1]. Arrgh. Here is the corrected version, the > Matlab code must be changed similarly. It has no relevance for the > performance timings though. > > > def D4_Transform(x, s1=None,

a few extensions for the itertools

2006-11-19 Thread Mathias Panzenboeck
I wrote a few functions which IMHO are missing in python(s itertools). You can download them here: http://sourceforge.net/project/showfiles.php?group_id=165721&package_id=212104 A short description to all the functions: icmp(iterable1, iterable2) -> integer Return negative if iterable1 <

Re: Programmatically finding "significant" data points

2006-11-19 Thread Paul McGuire
"robert" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > erikcw wrote: >> Hi all, >> >> I have a collection of ordered numerical data in a list. The numbers >> when plotted on a line chart make a low-high-low-high-high-low (random) >> pattern. I need an algorithm to extract the "si

Re: Programmatically finding "significant" data points

2006-11-19 Thread Paul McGuire
... dang touchy keyboard! > Here is some sample data: > data = [0.10, 0.50, 0.60, 0.40, 0.39, 0.50, 1.00, 0.80, 0.60, 1.20, > 1.10, 1.30, 1.40, 1.50, 1.05, 1.20, 0.90, 0.70, 0.80, 0.40, 0.45, 0.35, > 0.10] > > In this data, some of the significant points include: > data[0] > data[2] > data[4] > da

Re: a few extensions for the itertools

2006-11-19 Thread Paul McGuire
"Mathias Panzenboeck" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I wrote a few functions which IMHO are missing in python(s itertools). > > You can download them here: > http://sourceforge.net/project/showfiles.php?group_id=165721&package_id=212104 > > A short description to all

Re: a few extensions for the itertools

2006-11-19 Thread Steven D'Aprano
On Sun, 19 Nov 2006 21:35:24 +0100, Mathias Panzenboeck wrote: > I wrote a few functions which IMHO are missing in python(s itertools). > > You can download them here: > http://sourceforge.net/project/showfiles.php?group_id=165721&package_id=212104 > > A short description to all the functions: >

Re: Overwrite only one function with property()

2006-11-19 Thread Bruno Desthuilliers
Kai Kuehne a écrit : > Hi list! > It is possible to overwrite only one function with the property-function? property is not function, it's a class. And it doesn't "overwrite" anything. > x = property(getx, setx, delx, 'doc') > > I just want to overwrite setx, but when I set the others to None, >

Re: How do I stop Python IDLE (GUI) from immediately exiting when I enter it?

2006-11-19 Thread John (Z R) L
Thanks for the replies so far. I do exactly what that website says, and on the old computer (Windows 98), I click run module and nothing happens. No text gets displayed on my IDLE. It contained that firewall message at the top. Back on the new computer, I deleted all of my .py files and I could go

Re: basic python questions

2006-11-19 Thread Bruno Desthuilliers
Diez B. Roggisch a écrit : > [EMAIL PROTECTED] schrieb: > >> I have taken the coments and think I have implemented most. My only > > > Unfortunately, no. > >> question is how to use the enumerator. Here is what I did, I have tried >> a couple of things but was unable to figure out how to get th

Re: String Replace only if whole word?

2006-11-19 Thread Leonhard Vogt
Michael Yanowitz schrieb: > Yeah, I am operating this on a Python script. However, I am working off > a requirement that the script be pre-processed and the strings replaced > before executing the script and that if there are any remaining (not > replaced) > names that I don't execute the script

Re: Python v PHP for web, and restarting Apache?

2006-11-19 Thread Bruno Desthuilliers
walterbyrd a écrit : > Fredrik Lundh wrote: > > >>modularity, modularity, and modularity. >> > > > Can't PHP be made to be just as modular? PHP has no notion of modules. > As a matter of popular practise, I suppose that is not done. I would > think that it could be. Certainly not the way Pyt

Re: A python IDE for teaching that supports cyrillic i/o

2006-11-19 Thread Leo Kislov
Kirill Simonov wrote: > On Sun, Nov 19, 2006 at 03:27:32AM -0800, Leo Kislov wrote: > > IDLE on Windows works fine for your example in interactive console: > > > > >>> name = raw_input("What's your name? ") > > Have you tried to use cyrillic characters in a Python string in > interactive console?

edit text in a file and save it again

2006-11-19 Thread cyberco
I must be overlooking something here... I'm trying to edit a line in a text file. I thought this was easy with fileinput, but all examples do not write the line back to the file but simply 'print' it. I want to open the file, edit the line and save it again. Is fileinput the right module for that?

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-19 Thread Martin v. Löwis
gabor schrieb: > 1. simply fix the documentation, and state that if the file-name cannot > be decoded into unicode, then it's returned as byte-string. For 2.5, this should be done. Contributions are welcome. [...then] > [os.path.join(path,n) for n in os.listdir(path)] > > will not work. > > 2.

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-19 Thread gabor
Martin v. Löwis wrote: > gabor schrieb: >> 1. simply fix the documentation, and state that if the file-name cannot >> be decoded into unicode, then it's returned as byte-string. > > For 2.5, this should be done. Contributions are welcome. > > [...then] >> [os.path.join(path,n) for n in os.listdi

re.match -- not greedy?

2006-11-19 Thread EXI-Andrews, Jack
the '*' and '+' don't seem to be greedy.. they will consume less in order to match a string: >>> import re;re.match('(a+)(ab)','aaab').groups() ('aa', 'ab') this is the sort of behaviour i'd expect from '(a+?)(ab)' a+ should greedily consume a's at the expense of the string not matching in

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-19 Thread Martin v. Löwis
gabor schrieb: >> I may have missed something, but did you present a solution that would >> make the case above work? > > if we use the same decoding flags as binary-string.decode(), > then we could do: > > [os.path.join(path,n) for n in os.listdir(path,'ignore')] That wouldn't work. The charact

Re: os.lisdir, gets unicode, returns unicode... USUALLY?!?!?

2006-11-19 Thread gabor
Martin v. Löwis wrote: > gabor schrieb: >>> I may have missed something, but did you present a solution that would >>> make the case above work? >> if we use the same decoding flags as binary-string.decode(), >> then we could do: >> >> [os.path.join(path,n) for n in os.listdir(path,'ignore')] > >

Re: re.match -- not greedy?

2006-11-19 Thread Carl Banks
EXI-Andrews, Jack wrote: > the '*' and '+' don't seem to be greedy.. they will consume less in > order to match a string: > > >>> import re;re.match('(a+)(ab)','aaab').groups() > ('aa', 'ab') > > this is the sort of behaviour i'd expect from >'(a+?)(ab)' > > a+ should greedily consume a's at th

Re: a few extensions for the itertools

2006-11-19 Thread Carl Banks
Paul McGuire wrote: > "Mathias Panzenboeck" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >I wrote a few functions which IMHO are missing in python(s itertools). > > > > You can download them here: > > http://sourceforge.net/project/showfiles.php?group_id=165721&package_id=212104

Re: re.match -- not greedy?

2006-11-19 Thread André Malo
* Carl Banks wrote: > I'm suddenly curious if there are any cases at all where > greediness changes whether it finds a match. nope, per definitionem ;-) greedy := longest leftmost match nd -- die (eval q-qq[Just Another Perl Hacker ] ;-) # André Malo, # -- http://mail.

RE: syntax error in sum(). Please explicate.

2006-11-19 Thread Delaney, Timothy (Tim)
John Machin wrote: > Michael Press wrote: >> I have not written python codes nor run any. I saw this >> code posted and decided to try it. It fails. I read the >> tutorial and the entry for the built in function sum, >> but still do not see the problem. The code was cut and >> paste. > > I doubt

Re: re.match -- not greedy?

2006-11-19 Thread Noah Rawlins
Carl Banks wrote: > EXI-Andrews, Jack wrote: >> the '*' and '+' don't seem to be greedy.. they will consume less in >> order to match a string: >> > import re;re.match('(a+)(ab)','aaab').groups() >> ('aa', 'ab') >> >> this is the sort of behaviour i'd expect from >>'(a+?)(ab)' >> >> a+ shou

Looking for a graph (as in network, nodes) package

2006-11-19 Thread John Henry
I am looking for a ready made simple graph package. I found an extensive one in the piana package but when I try to use just the graph portion, it fails to load because of the line: class Graph(object): ... It seems that their Graph is subclassed from "object" but I couldn't find a "object" cl