Re: reduce to be removed?

2006-11-14 Thread Antoon Pardon
On 2006-11-15, Robert Kern <[EMAIL PROTECTED]> wrote: > Dustan wrote: > >> 2. While I haven't taken a good look at NumPy, my intuition tells me it >> won't work with complex data types, which wouldn't work for me at all. >> >> Am I correct on that second one? > > No. numpy can make arrays of Pytho

Re: Py3K idea: why not drop the colon?

2006-11-14 Thread Steven D'Aprano
On Tue, 14 Nov 2006 12:01:05 +, Antoon Pardon wrote: > On 2006-11-13, Ben Finney <[EMAIL PROTECTED]> wrote: >> Michael Hobbs <[EMAIL PROTECTED]> writes: >> >>> To be clear, this is the actual thrust of my argument. It seems >>> redundant to have *both* line continuations and colons in compound

Re: refactoring so that multiple changes can be made with one variable?

2006-11-14 Thread Paddy
John Salerno wrote: > Paddy wrote: > > > You could keep a handle on all object instances created then go through > > the objects making appropriate changes, e.g: > > > > > > class Character(object): > > instances = [] > > def __init__(self, name, strength, dexterity, intelligence): > >

Re: wxpython - wxtoolbar font size

2006-11-14 Thread Ghido
Thanks for your reply but i can't change the font of 'New' label. but it is a linux problem or is a wxpython problem? Ghido -- http://mail.python.org/mailman/listinfo/python-list

Re: multi split function taking delimiter list

2006-11-14 Thread Paddy
Paddy wrote: > [EMAIL PROTECTED] wrote: > > > Hi, I'm looking for something like: > > > > multi_split( 'a:=b+c' , [':=','+'] ) > > > > returning: > > ['a', ':=', 'b', '+', 'c'] > > > > whats the python way to achieve this, preferably without regexp? > > > > Thanks. > > > > Martin > > I resisted m

Re: Python v PHP: fair comparison?

2006-11-14 Thread Hendrik van Rooyen
Olexandr Melnyk wrote: > PHP has a lower barrier to entry I don't think so. Python has more intuitive syntax for beginners and is one of the best choices for the first programming language to pick up. I second this - before discovering Python (in a GSM module's guts) - I was being steered in t

Re: reading csv problem

2006-11-14 Thread Cameron Walsh
[EMAIL PROTECTED] wrote: > Hello, > > I use csv to take information from file. > import csv > reader = csv.reader(open('t.csv')) > > for row in reader: > print row # it is perfectly OK > > - > But If I use this code I have p

reading csv problem

2006-11-14 Thread [EMAIL PROTECTED]
Hello, I use csv to take information from file. import csv reader = csv.reader(open('t.csv')) for row in reader: print row # it is perfectly OK - But If I use this code I have problem import csv reader = csv.reader(open('t.c

Re: Py3K idea: why not drop the colon?

2006-11-14 Thread Hendrik van Rooyen
"Dan Lenski" <[EMAIL PROTECTED]> wrote: > I think part of learning to think like a computer is learning to stop > associating computer logic too strongly with the natural language > meanings of "and", "or", and "not". This is true - and you have left out "but" - Hendrik -- http://mail.p

Re: Python speed on Solaris 10

2006-11-14 Thread casevh
Chris Miles wrote: > I have found that the sunfreeware.com build of Python 2.4.3 for Solaris > 10 is faster than one I can build myself, on the same system. > sunfreeware.com doesn't bother showing the options they used to > configure and build the software, so does anyone know what the optimal >

Re: Python v PHP: fair comparison?

2006-11-14 Thread Luis M. González
>> Yes, php is only for web. > > Absolutely false. Most of my standalone, command-line scripts for > manipulating my unix users in LDAP are written in PHP, although we're > rewriting them in python. > > Although I can't think of a single app written in php that's not web- > based (other than stand

Re: Python v PHP: fair comparison?

2006-11-14 Thread Michael Torrie
On Tue, 2006-11-14 at 18:55 -0800, Luis M. González wrote: > > > - Python is more readable, and more general purpose > > Yes, php is only for web. Absolutely false. Most of my standalone, command-line scripts for manipulating my unix users in LDAP are written in PHP, although we're rewriting th

RE: Python development time is faster.

2006-11-14 Thread Delaney, Timothy (Tim)
Éric Daigneault wrote: > This being said after a bit of experience in programming, design > patterns and other marvels of the modern brains, doing bad code in > python requires a conscious effort to do. The bright side is that it > gives all the justification to reviewers to smack the offend

Re: Python development time is faster.

2006-11-14 Thread Éric Daigneault
"Chris Brat" <[EMAIL PROTECTED]> writes: > I've seen a few posts, columns and articles which state that one of the > advantages of Python is that code can be developed x times faster than > languages such as <>. > > Does anyone have any comments on that statement from personal > experience? Wel

Re: reduce to be removed?

2006-11-14 Thread Robert Kern
Dustan wrote: > 2. While I haven't taken a good look at NumPy, my intuition tells me it > won't work with complex data types, which wouldn't work for me at all. > > Am I correct on that second one? No. numpy can make arrays of Python objects in addition to arrays of double, unsigned int, etc. -

Re: Tkinter: Strange behavior using place() and changing cursors

2006-11-14 Thread John McMonagle
Mudcat wrote: > Is there something I'm supposed to do in order > to prevent this from happening? Yes. Instead of configuring the cursor on the frame, do it on the master: self.master.configure(cursor='sb_h_double_arrow') -- This message has been scanned for viruses and dangerous content by

Re: reduce to be removed?

2006-11-14 Thread Dustan
George Sakkis wrote: > Dustan wrote: > > > Alright, I can see I'm a bit outvoted here. I tried your suggestions > > and it worked fine. > > > > I'll also try to consider in the future that part of the problem might > > be lack of information conveyed on my part. > > If you insist on one-liners, it

Re: Python v PHP: fair comparison?

2006-11-14 Thread Luis M. González
> - Python is more readable, and more general purpose Yes, php is only for web. On the other hand, Python is a general purpose language and it can be used for nearly anything you may want to do. > - PHP has awful backward compatibility Yes. And it's also an ugly language to work with. > - PHP

Re: jython's future

2006-11-14 Thread Gabriel Genellina
At Tuesday 14/11/2006 21:56, Ed Jensen wrote: ??ukasz Langa <[EMAIL PROTECTED]> wrote: > Java was at 1.2 (and compiling Hello World took over 5 minutes) Bullshit. Complete and utter bullshit. That's the plain truth. Python 1.5.2 final release is of 13 April 1999

Re: jython's future

2006-11-14 Thread Ed Jensen
??ukasz Langa <[EMAIL PROTECTED]> wrote: > Java was at 1.2 (and compiling Hello World took over 5 minutes) Bullshit. Complete and utter bullshit. -- http://mail.python.org/mailman/listinfo/python-list

Re: refactoring so that multiple changes can be made with one variable?

2006-11-14 Thread James Stroud
John Salerno wrote: > My code is below. For now I'm focusing on the lines where health (and > armor) are increased in each character class. Let's say I decided to > change the amount of increase in the future. As it is now, I'd have to > go to each character class and change the number so that e

Re: __cmp__ between dissimilar objects

2006-11-14 Thread Gabriel Genellina
At Tuesday 14/11/2006 19:27, [EMAIL PROTECTED] wrote: > >Can you point me to a description of this algorithm? It doesn't seem > >to be described in the documentation for the rich comparison or __cmp__ > >methods... > > PEP 207 > http://www.python.org/dev/peps/pep-0207/ So since I implemented _

Re: multi split function taking delimiter list

2006-11-14 Thread Sam Pointon
On Nov 14, 7:56 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, I'm looking for something like: > > multi_split( 'a:=b+c' , [':=','+'] ) > > returning: > ['a', ':=', 'b', '+', 'c'] > > whats the python way to achieve this, preferably without regexp? pyparsing

Re: Python v PHP: fair comparison?

2006-11-14 Thread Olexandr Melnyk
2006/11/15, Larry Bates <[EMAIL PROTECTED]>:> For the most part you wouldn't ever thing about writing data> conversion programs, GUI applications, Windows services, COM+ objects, > Linux daemons, simple scripts, socket server/client applications,> etc. in PHP (but all can be done in Python).  Web a

Re: Python v PHP: fair comparison?

2006-11-14 Thread martdi
> I'd be surprised if there was more demand for PHP developers > than Python developers. Google lists 51 PHP jobs and 168 > Python jobs in their internal jobs database (I just did a > quick search). Yes, but Google is the company that hired Guido, and that does most of it's dev in python. Looki

Re: __cmp__ between dissimilar objects

2006-11-14 Thread [EMAIL PROTECTED]
> >Can you point me to a description of this algorithm? It doesn't seem > >to be described in the documentation for the rich comparison or __cmp__ > >methods... > > PEP 207 > http://www.python.org/dev/peps/pep-0207/ So since I implemented __cmp__ instead of the rich comparison operators, Python f

Re: Python v PHP: fair comparison?

2006-11-14 Thread Larry Bates
walterbyrd wrote: > I don't know if this is a fair comparison or not. Any comments > appreciated. > > - Python is more readable, and more general purpose > - PHP has awful backward compatibility > - PHP has a lower barrier to entry > - Most inexpensive web-hosters support PHP, but not Python > - P

Re: how to create a multicolor "font-string" in pygame??

2006-11-14 Thread Iacopo . Marmo
> Of course you can just create an equally dimensioned image for each > character and each color (cached or not, however you like it), and just > blit these one after another, offsetting them with the character width. > > Diez thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Character Encodings and display of strings

2006-11-14 Thread Martin Miller
It is possible derive your own string class from the built-in one and override what 'repr' does (and make it do whatever you want). Here's an example of what I mean: # Sample # # -*- coding: iso-8859-1 -*- # Special string class to override the default # representation method. Main purpo

Re: multi split function taking delimiter list

2006-11-14 Thread Paddy
[EMAIL PROTECTED] wrote: > Hi, I'm looking for something like: > > multi_split( 'a:=b+c' , [':=','+'] ) > > returning: > ['a', ':=', 'b', '+', 'c'] > > whats the python way to achieve this, preferably without regexp? > > Thanks. > > Martin I resisted my urge to use a regexp and came up with this:

mark lutz interview?

2006-11-14 Thread John Salerno
Does anyone know where I might find the Mark Lutz interview from TechTalk? Their website still doesn't have it yet. I didn't know if it was available elsewhere. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: refactoring so that multiple changes can be made with one variable?

2006-11-14 Thread John Salerno
Paddy wrote: > You could keep a handle on all object instances created then go through > the objects making appropriate changes, e.g: > > > class Character(object): > instances = [] > def __init__(self, name, strength, dexterity, intelligence): > instances.append(self) >

Re: BaseHTTPServer - getting POST parameters

2006-11-14 Thread Fredrik Lundh
Vlad Dogaru wrote: > After experimenting for a while, I am still not able to find where the > POST data is in the BaseHTTPRequestHandler class. I am trying to write > a very simple HTTP server for a project of mine and I need to get the > POST data. Certainly I am missing something, as it is a com

PyWin32-winxptheme and py2exe

2006-11-14 Thread Andrea Gavana
Hi all, I am having some troubles mixing py2exe and winxptheme. Basically, I am using wxPython 2.7.2.0 with Python 2.5, and painting some window background using the UxTheme via winxptheme. This is what I am doing: hwnd = MyWindow.GetHandle() self.hTheme = winxptheme.OpenThemeData(hwnd, "Windo

Re: BaseHTTPServer - getting POST parameters

2006-11-14 Thread Paul Boddie
Vlad Dogaru wrote: > > After experimenting for a while, I am still not able to find where the > POST data is in the BaseHTTPRequestHandler class. I am trying to write > a very simple HTTP server for a project of mine and I need to get the > POST data. Certainly I am missing something, as it is a co

Re: wxpython - wxtoolbar font size

2006-11-14 Thread Frank Niessink
Ghido: Hi all i want to set wx.toolbar font size and i use this code: self.tb1 = wx.ToolBar(self, -1, style=wx.TB_HORIZONTAL| wx.TB_TEXT) self.tb1.SetFont(wx.Font(9, wx.DEFAULT, wx.NORMAL,0)) self.SetToolBar(self.tb1) but i obtain nothing. Is possibile? where

BaseHTTPServer - getting POST parameters

2006-11-14 Thread Vlad Dogaru
Hello, After experimenting for a while, I am still not able to find where the POST data is in the BaseHTTPRequestHandler class. I am trying to write a very simple HTTP server for a project of mine and I need to get the POST data. Certainly I am missing something, as it is a comon task. Thanks in

Re: Py3K idea: why not drop the colon?

2006-11-14 Thread Stephen Eilert
Carl Banks escreveu: > Steve Holden wrote: > > In fact most Python doesn't use such constructs, though I'll admit the > > occasional __init__ is more or less inevitable once you start using the > > object-oriented features more than casually. > > Occasional? I don't know about you, but I use __i

Re: Python v PHP: fair comparison?

2006-11-14 Thread Bjoern Schliessmann
walterbyrd wrote: > - PHP has a lower barrier to entry Which kind of barrier do you mean -- syntax, availability, ...? Also from what I know of PHP, language and API seem more unstable and inhomogenous. CMIIW. Regards, Björn -- BOFH excuse #219: Recursivity. Call back if it happens again.

Re: multi split function taking delimiter list

2006-11-14 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Hi, I'm looking for something like: > > multi_split( 'a:=b+c' , [':=','+'] ) > > returning: > ['a', ':=', 'b', '+', 'c'] > > whats the python way to achieve this, preferably without regexp? What do you have against regexp? re.split() does exactly what you want: In [1

Re: multi split function taking delimiter list

2006-11-14 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Hi, I'm looking for something like: > > multi_split( 'a:=b+c' , [':=','+'] ) > > returning: > ['a', ':=', 'b', '+', 'c'] > > whats the python way to achieve this, preferably without regexp? I think in this case the regexp approach is the simplest, though: >>> def mu

Re: multi split function taking delimiter list

2006-11-14 Thread Raymond Hettinger
[EMAIL PROTECTED] wrote: > Hi, I'm looking for something like: > > multi_split( 'a:=b+c' , [':=','+'] ) > > returning: > ['a', ':=', 'b', '+', 'c'] > > whats the python way to achieve this, preferably without regexp? I think regexps are likely the right way to do this kind of tokenization. The s

Re: Noob | datetime question

2006-11-14 Thread [EMAIL PROTECTED]
On Nov 14, 4:22 pm, "Demel, Jeff" <[EMAIL PROTECTED]> wrote: > I'm having trouble finding exactly what I need by googling, so thought > I'd try to get a quick answer from the group. This seems like something > that should be dead simple. > > I need to generate a string value of a date in the for

multi split function taking delimiter list

2006-11-14 Thread [EMAIL PROTECTED]
Hi, I'm looking for something like: multi_split( 'a:=b+c' , [':=','+'] ) returning: ['a', ':=', 'b', '+', 'c'] whats the python way to achieve this, preferably without regexp? Thanks. Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter: Strange behavior using place() and changing cursors

2006-11-14 Thread Wojciech Muła
Mudcat wrote: > I have also determined that this is not a problem if the button is not > packed inside the frame. So somehow the interaction of the internal > button is causing this problem. Problem is really strange, and seems to be a Tk issue, not Tkinter. I've observed that if method configure

Re: Py3K idea: why not drop the colon?

2006-11-14 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >>> I confess I find myself in the position of a Yorkshire Youngster - > I >>> don't believe you! > >Robert> Okay, not often enough or annoyingly enough for me to remember >Robert> having done so. Perhaps seven years ag

Python v PHP: fair comparison?

2006-11-14 Thread walterbyrd
I don't know if this is a fair comparison or not. Any comments appreciated. - Python is more readable, and more general purpose - PHP has awful backward compatibility - PHP has a lower barrier to entry - Most inexpensive web-hosters support PHP, but not Python - PHP has far more pre-writen scripts

Re: Is python for me?

2006-11-14 Thread Tim Chase
> By large I mean an application with intensive operations, such > as a fancy GUI maybe a couple of threads, accessing a > database, etc. I can't say I've had any python related problems on such matters. I've done some modestly large-sized apps, and the bottlenecks are almost always I/O bound...

Re: __cmp__ between dissimilar objects

2006-11-14 Thread Gabriel Genellina
At Tuesday 14/11/2006 09:33, Fredrik Lundh wrote: GeneralizedTime() > datetime.now() > Traceback (most recent call last): > File "", line 1, in ? > TypeError: can't compare datetime.datetime to GeneralizedTime > > Clearly I'm misunderstanding something, here. As I understand my code, > I'

Re: __cmp__ between dissimilar objects

2006-11-14 Thread Gabriel Genellina
At Tuesday 14/11/2006 13:41, [EMAIL PROTECTED] wrote: > When the rich comparison methods raise NotImplementedError, the > comparison logic inside the interpreter tries reversing the operands. Can you point me to a description of this algorithm? It doesn't seem to be described in the documentat

Re: How to check for instances of a class

2006-11-14 Thread erokar
That did the trick, thank you! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python development time is faster.

2006-11-14 Thread Jordan
Just a little something I realized after writing the same program in C++ and python (a simple chat client and server, with one on one and chat room capabilities). I used wxwidgets and wxpython respectively for the GUIs, and they weren't extremely elaborate, just some basic functionality, a few fra

Re: How to check for instances of a class

2006-11-14 Thread Gabriel Genellina
At Tuesday 14/11/2006 16:00, [EMAIL PROTECTED] wrote: Traversing a list of variables, I need to check wheter an element in the list is an instance of a (user defined) class. What cind of comparison operator can I use? Can't seem to find this in the documentation. I anyone have an example it is m

Re: How to check for instances of a class

2006-11-14 Thread Dennis Benzinger
On 14 Nov 2006 11:00:53 -0800 [EMAIL PROTECTED] wrote: > Traversing a list of variables, I need to check wheter an element in > the list is an instance of a (user defined) class. What cind of > comparison operator can I use? Can't seem to find this in the > documentation. I anyone have an example

How to check for instances of a class

2006-11-14 Thread erokar
Traversing a list of variables, I need to check wheter an element in the list is an instance of a (user defined) class. What cind of comparison operator can I use? Can't seem to find this in the documentation. I anyone have an example it is much appreciated. -- http://mail.python.org/mailman/list

Re: Is python for me?

2006-11-14 Thread [EMAIL PROTECTED]
By large I mean an application with intensive operations, such as a fancy GUI maybe a couple of threads, accessing a database, etc. lennart wrote: > [EMAIL PROTECTED] schreef: > > > As stated above python is capable of all those things, however on > > larger applications like that it can tend to s

Re: Looking for a way to stop execution of script, in the script

2006-11-14 Thread Josh Bloom
Thanks Fredrik, yeah the while loop for single run is pretty stupid. sys.exit() thats the call I was looking for. -JoshOn 11/14/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Josh Bloom wrote:> Hi everyone, I'm looking for a way to stop execution of a script from> within the script.>> I'm familiar w

Re: Looking for a way to stop execution of script, in the script

2006-11-14 Thread Fredrik Lundh
Josh Bloom wrote: > Hi everyone, I'm looking for a way to stop execution of a script from > within the script. > > I'm familiar with this idiom: > > While 1: > doFirstThing() > doSecondThing() > if something: > break > doThirdThing() > break I'm not. why are you using a while st

Looking for a way to stop execution of script, in the script

2006-11-14 Thread Josh Bloom
Hi everyone, I'm looking for a way to stop execution of a script from within the script. I'm familiar with this idiom:While 1:  doFirstThing()  doSecondThing()  if something:    break  doThirdThing()   breakBut that seems a little kludgy to me with extra breaks involved. Is there a way to do someth

Re: Unpacking sequences and keywords in one function call

2006-11-14 Thread OKB (not okblacke)
Dennis Lee Bieber wrote: > On Tue, 14 Nov 2006 05:45:57 GMT, "OKB (not okblacke)" > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > >> >> I was just wondering about this yesterday. Is there a >> reason you >> can only unpack a sequence at the END of t

Re: Seeking assistance - string processing.

2006-11-14 Thread John Machin
[EMAIL PROTECTED] wrote: > Thanks Fredrik, Peter and John for your help. > > John, I especially enjoyed your line by line assasination of my code, > keep it up. > > I'm not a programmer, I dislike programming, I'm bad at it. I just > agreed to do this to help someone out, I didn't even know what p

Re: modules and generated code

2006-11-14 Thread Nigel Rantor
Peter Otten wrote: > Nigel Rantor wrote: > >> Peter Otten wrote: >>> Nigel Rantor wrote: > So, if I have a tool that generates python code for me (in my case, CORBA stubs/skels) in a particular package is there a way of placing my own code under the same package hierarchy without a

Re: Using signal.alarm to terminate a thread

2006-11-14 Thread Nick Craig-Wood
Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Nick Craig-Wood wrote: > > > The only sensible things you can do from a signal handler is set a > > global flag, or call sem_post on a semaphore, to record the delivery > > of the signal. The remainder of the program can then either poll the > >

Re: Seeking assistance - string processing.

2006-11-14 Thread Frederic Rentsch
[EMAIL PROTECTED] wrote: > I've been working on some code to search for specific textstrings and > act upon them insome way. I've got the conversion sorted however there > is 1 problem remaining. > > I am trying to work out how to make it find a string like this "===" > and when it has found it, I

Re: Py3K idea: why not drop the colon?

2006-11-14 Thread skip
>>> Michael Hobbs wrote: True enough. Although, I have to ask how many times you define a new function only to have Python spit a syntax error out at you saying that you forgot a colon. It happens to me all the time. >> >> I confess I find myself in the posit

Re: Decimal() instead of float?

2006-11-14 Thread Steve Holden
Michael B. Trausch wrote: > On Mon, 2006-11-13 at 03:45 -0600, Steve Holden wrote: >> Michael B. Trausch wrote: >> > Is there a way to use Decimal() by default in Python instead of float? >> >> No. You'll just have to be explicit. >> > > That's kinda what I figured. :-( > > It /would/ be nice

Re: another newbie question

2006-11-14 Thread Fredrik Lundh
Mary Jane Boholst wrote: > I am trying to upload a file to a database using a (cgi) form and am > having trouble doing this. I think that I need some way of escaping the > file contents or making it so that mysql/python (not sure which) will > ignore the files actual contents and store it in the d

Re: another newbie question

2006-11-14 Thread BartlebyScrivener
Lots of smart, patient people here, but they can't help you until you provide a lot more information and the actual error messages you are getting and whether they are spawned by Python or MySQL, if that is indeed the db you are using. Where did you get the idea that Python might be involved? Read

wxpython - wxtoolbar font size

2006-11-14 Thread Ghido
Hi all i want to set wx.toolbar font size and i use this code: self.tb1 = wx.ToolBar(self, -1, style=wx.TB_HORIZONTAL| wx.TB_TEXT) self.tb1.SetFont(wx.Font(9, wx.DEFAULT, wx.NORMAL,0)) self.SetToolBar(self.tb1) but i obtain nothing. Is possibile? where i wrong?

Re: Random image text generation?

2006-11-14 Thread skip
> "Paul" == Paul Rubin <"http://phr.cx"@NOSPAM.invalid> writes: Paul> Steven D'Aprano <[EMAIL PROTECTED]> writes: >> Instead of displaying an obfuscated image of a nonsense word, display >> six randomly chosen photos, where five are of the same thing but not >> the same image.

another newbie question

2006-11-14 Thread Mary Jane Boholst
Hello everyone, I have a question that google couldnt answer for me and thought that the brains on here might be able to help. I am trying to upload a file to a database using a (cgi) form and am having trouble doing this. I think that I need some way of escaping the file contents or making it so t

Re: Py3K idea: why not drop the colon?

2006-11-14 Thread Robert Kern
Hendrik van Rooyen wrote: > "Robert Kern" <[EMAIL PROTECTED]> wrote: > > >> Michael Hobbs wrote: >>> True enough. Although, I have to ask how many times you define a new >>> function only to have Python spit a syntax error out at you saying that >>> you forgot a colon. It happens to me all the t

Noob | datetime question

2006-11-14 Thread Demel, Jeff
I'm having trouble finding exactly what I need by googling, so thought I'd try to get a quick answer from the group. This seems like something that should be dead simple. I need to generate a string value of a date in the format MMDD that is 97 days in the future. The datetime module is bran

Re: Py3K idea: why not drop the colon?

2006-11-14 Thread Dan Lenski
Hendrik van Rooyen wrote: > This is true - and it is actually also an intractable problem - if you look at > what your daughter wrote, you get the feeling that you should be able to write > an interpreter that can implement what she meant, because it is quite clear to > you - until you try to write

Re: sqlite3 views, if not exists clause

2006-11-14 Thread Roberto Bonvallet
Fredrik Lundh wrote: > "Josh" wrote: > >> THIS DOES NOT WORK, but it should! > > Python 2.5 was released on September 19th, 2006, and support for CREATE > VIEW IF NOT EXISTS was added to sqlite on October 9th, 2006: So? "from __future__ import ..." should have supported this! <:o) -- Roberto

Re: A question on Encoding and Decoding.

2006-11-14 Thread Fredrik Lundh
"kath" wrote: > Also python IDLE is able to output the same character corretly when I > say print and why not I? probably because IDLE's interactive window is Unicode-aware, but your terminal is not. -- http://mail.python.org/mailman/listinfo/python-list

modules and generated code

2006-11-14 Thread Nigel Rantor
Hi all, Python newbie here with what I hope is a blindingly obvious question that I simply can't find the answer for in the documentation. So, if I have a tool that generates python code for me (in my case, CORBA stubs/skels) in a particular package is there a way of placing my own code under

Re: CORBA: Fnorb Problems

2006-11-14 Thread Eric Brunel
On Tue, 14 Nov 2006 13:13:42 +0100, rodmc <[EMAIL PROTECTED]> wrote: >> > >> > Traceback (most recent call last): >> > File "C:\Python24\Lib\site-packages\Fnorb\script\cpp.py", line 53, >> in >> > -toplevel- >> > raise "No C/C++ pre-processor found in your PATH!" >> > No C/C++ pre-proces

matplotlib and zope

2006-11-14 Thread markacy
Hello All, I've been using zope and matplotlib for some time now, and I want to connect them. I'am using the example code from page: http://www.scipy.org/Cookbook/Matplotlib/Matplotlib_and_Zope , but whenever I try to import matplotlib, and/or pylab packages i get this error from zope: Error Ty

Re: refactoring so that multiple changes can be made with one variable?

2006-11-14 Thread Paddy
John Salerno wrote: > My code is below. For now I'm focusing on the lines where health (and > armor) are increased in each character class. Let's say I decided to > change the amount of increase in the future. As it is now, I'd have to > go to each character class and change the number so that ea

Re: Programmatically finding "significant" data points

2006-11-14 Thread Peter Otten
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 d

Re: Programmatically finding "significant" data points

2006-11-14 Thread Roy Smith
"erikcw" <[EMAIL PROTECTED]> wrote: > 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. I think you want

Re: modules and generated code

2006-11-14 Thread Peter Otten
Nigel Rantor wrote: > So, if I have a tool that generates python code for me (in my case, > CORBA stubs/skels) in a particular package is there a way of placing my > own code under the same package hierarchy without all the code living in > the same directory structure. http://docs.python.org/lib

Re: Programmatically finding "significant" data points

2006-11-14 Thread Jeremy Sanders
erikcw wrote: > 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. > ... > > How do I sort through this

Programmatically finding "significant" data points

2006-11-14 Thread erikcw
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 data: data = [0.10, 0.50, 0.60,

Re: Programmatically finding "significant" data points

2006-11-14 Thread Roberto Bonvallet
erikcw wrote: > 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. In calculus, you identify high and low

Re: PyFAQ: anyone seen aahz' thread tutorial ?

2006-11-14 Thread Aahz
In article <[EMAIL PROTECTED]>, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > >and yes, has anyone seen Aahz or his OSCON2001 thread tutorial slides >lately ? as noticed here: > > http://effbot.org/pyfaq/how-do-i-program-using-threads.htm > >they have disappeared from the starship? any ideas w

refactoring so that multiple changes can be made with one variable?

2006-11-14 Thread John Salerno
My code is below. For now I'm focusing on the lines where health (and armor) are increased in each character class. Let's say I decided to change the amount of increase in the future. As it is now, I'd have to go to each character class and change the number so that each is still in a good rela

Re: Noob | datetime question

2006-11-14 Thread Carsten Haese
On Tue, 2006-11-14 at 09:33 -0600, Kevin Kelley wrote: > import time > FORMAT='%Y%m%d' > > time.strftime(FORMAT,time.gmtime(time.time()+8380800)) > output = '20070219' While the above works, the following variation using datetime is more readable: >>> import datetime >>> someday = datetime.date.

Re: modules and generated code

2006-11-14 Thread Nigel Rantor
Peter Otten wrote: > Nigel Rantor wrote: > >> So, if I have a tool that generates python code for me (in my case, >> CORBA stubs/skels) in a particular package is there a way of placing my >> own code under the same package hierarchy without all the code living in >> the same directory structure.

Re: __init__.py

2006-11-14 Thread km
Hi, wow ! i tried it and it works like charm! could access  variables  declared at root module dir  in submodules. also i would like to know if i can have an abstract class declared in __init__.py  with common variables ? regards, KMOn 11/14/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: "km" wrote

Re: __init__.py

2006-11-14 Thread Fredrik Lundh
"km" wrote: > wow ! i tried it and it works like charm! > could access variables declared at root module dir in submodules. > also i would like to know if i can have an abstract class declared in > __init__.py with common variables ? you don't really need our permission to try things out, you

PYTHON + EXCEL

2006-11-14 Thread dan84
I write my code : #inizializzazioni varie che tralascio #mi connetto al mio db mysql e recupero i dati che volgio inserire nel file excel conn = MySQLdb.connect(host = "XXX", port = XXX, user = "XXX", passwd = "XXX", db= "XXX") cursor = conn.cursor() cursor.execute("SELECT * FROM

Re: CORBA: Fnorb Problems

2006-11-14 Thread rodmc
> > > > Traceback (most recent call last): > > File "C:\Python24\Lib\site-packages\Fnorb\script\cpp.py", line 53, in > > -toplevel- > > raise "No C/C++ pre-processor found in your PATH!" > > No C/C++ pre-processor found in your PATH! > > You don't say *when* this error occurs, i.e. what is th

Re: Py3K idea: why not drop the colon?

2006-11-14 Thread Antoon Pardon
On 2006-11-13, Ben Finney <[EMAIL PROTECTED]> wrote: > Michael Hobbs <[EMAIL PROTECTED]> writes: > >> To be clear, this is the actual thrust of my argument. It seems >> redundant to have *both* line continuations and colons in compound >> statements. > > Why are you trying to remove redundancy? Wh

Re: Py3K idea: why not drop the colon?

2006-11-14 Thread Antoon Pardon
On 2006-11-13, Steve Holden <[EMAIL PROTECTED]> wrote: > John Salerno wrote: >> Fredrik Lundh wrote: >>> John Salerno wrote: >>> > Anyway, the FAQ answer seems to be a weak argument to me. I agree. I was expecting something more technical to justify the colon, not just that it looks

Re: __cmp__ between dissimilar objects

2006-11-14 Thread [EMAIL PROTECTED]
> why not just inherit from datetime instead? I'll probably do that in the next iteration. > or read footnote 4 under "supported operations" on this page for info on how > to > implement mixed-type comparisions: > > http://docs.python.org/lib/datetime-datetime.html OK. I added a 'timetuple

Re: Python 2.5 Core Dump on Solaris 8

2006-11-14 Thread Anthon
You can set an environment variable MALLOC_CHECK_ to influence the behaviour of glibc 0 -> no error message program continues 1 -> error message, program continues 2 -> no error message, kills program 3 -> error message, kills program Since the message only occured with my two programs at exit tim

Re: __cmp__ between dissimilar objects

2006-11-14 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: >I have a class that has, as an attribute, an instance of > datetime.datetime(). I would like to be able to compare my class > directly to instances of datetime.datetime in addition to other > instances of my class. The value used for the comparison in either > case shou

Re: Using signal.alarm to terminate a thread

2006-11-14 Thread Fredrik Lundh
Nick Craig-Wood wrote: > The only sensible things you can do from a signal handler is set a > global flag, or call sem_post on a semaphore, to record the delivery > of the signal. The remainder of the program can then either poll the > global flag, or use sem_wait() and sem_trywait() on th

  1   2   >