Re: Data structure for ordered sequence

2006-11-14 Thread Hendrik van Rooyen
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > unless this is homework because the pil people will not let > > you distribute pils. > > I'm not sure I can parse this sentence fragment. What do you mean? oh come on! - you of all people should know that "pils" mean

Re: Python development time is faster.

2006-11-14 Thread Hendrik van Rooyen
"Chris Brat" <[EMAIL PROTECTED]> wrote: > 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? > How

Re: Py3K idea: why not drop the colon?

2006-11-14 Thread Hendrik van Rooyen
"Simon Brunning" <[EMAIL PROTECTED]> Wrote: > On 11/11/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > Hendrik van Rooyen wrote: > > > > >> blue is red or green or yellow > > > > > > *grin* - this can be construed as a weakness in Python - > > > > it's boolean logic, and it's incompatible with hu

Re: Py3K idea: why not drop the colon?

2006-11-14 Thread Hendrik van Rooyen
"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 time. (Usually after an > > "else"

Re: handling many default values

2006-11-14 Thread Michele Simionato
Gabriel Genellina wrote: > At Monday 13/11/2006 13:33, Michele Simionato wrote: > > >Alan Isaac wrote: > > > Also, as an aside, no one objected to using > > > self.__dict__.update(kwargs) > > > in the __init__ function of the parameter holding class. > > > >It is a common trick, also shown in t

deleteing item from a copy of a list

2006-11-14 Thread timmy
i make a copy of a list, and delete an item from it and it deletes it from the orginal as well, what the hell is going on?!?!?! #create the staff copy of the roster Roster2 = [] for ShiftLine in Roster: #delete phone number from staff copy Roster2.a

Re: deleteing item from a copy of a list

2006-11-14 Thread Fredrik Lundh
timmy wrote: > i make a copy of a list, and delete an item from it and it deletes it > from the orginal as well, what the hell is going on?!?!?! > > #create the staff copy of the roster > Roster2 = [] > for ShiftLine in Roster: > #delete phone number from staff copy >

Re: __cmp__ between dissimilar objects

2006-11-14 Thread [EMAIL PROTECTED]
> 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 documentation for the rich comparison or __cmp__ methods... -Ben

Re: Is python for me?

2006-11-14 Thread Mark Woodward
On Mon, 13 Nov 2006 09:11:13 -0800, lennart wrote: > Hi, > > I'm planning to learn a language for 'client' software. Until now, i > 'speak' only some web based languages, like php. As a kid i programmed > in Basic (CP/M, good old days :'-) ) Now i want to start to learn a > (for me) new computer

Re: deleteing item from a copy of a list

2006-11-14 Thread Peter Otten
timmy <"timothy at open-networks.net"> wrote: > i make a copy of a list, and delete an item from it and it deletes it > from the orginal as well, what the hell is going on?!?!?! > > #create the staff copy of the roster > Roster2 = [] > for ShiftLine in Roster: > #

Seeking assistance - string processing.

2006-11-14 Thread billpaterson2006
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 want it to add "===" to the end of t

Re: Data structure for ordered sequence

2006-11-14 Thread Steve Holden
Hendrik van Rooyen wrote: > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > >> [EMAIL PROTECTED] wrote: >> >> > unless this is homework because the pil people will not let >>> you distribute pils. >> I'm not sure I can parse this sentence fragment. What do you mean? > > oh come on! - you of all

Re: Seeking assistance - string processing.

2006-11-14 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Thanks so much, a really elegant solution indeed. > > I have another question actually which I'm praying you can help me > with: > > with regards to the .jpg conversion to .jpg]] and .gif -> .gif]] > > this works, but only when .jpg/.gif is on it's own line. > > i.e:

Re: Seeking assistance - string processing.

2006-11-14 Thread billpaterson2006
Cheers for the reply. But I'm still having a spot of bother with the === addition it would seem that if there is no whitespace after the ===test then the new === gets added to the next line e.g file contains: ===test (and then no whitesapace/carriage returns or anything) and the result is: ==

Re: Using signal.alarm to terminate a thread

2006-11-14 Thread Adrian Casey
Nick Craig-Wood wrote: > Adrian Casey <[EMAIL PROTECTED]> wrote: >> I have a multi-threaded python application which uses pexpect to connect >> to >> multiple systems concurrently. Each thread within my application is a >> connection to a remote system. The problem is when one of the child >

Re: Py3K idea: why not drop the colon?

2006-11-14 Thread Fredrik Lundh
Antoon Pardon wrote: > Why not? My impression is that removing redundancy is considered > a positive thing here in c.p.l. so why are you still here? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.5 Core Dump on Solaris 8

2006-11-14 Thread Anthon
Hi Melissa, I run into similar problems after compiling python-ldap 2.2.0 for Python 2.5 on SuSE Linux 9.3 and running a small commandline application *** glibc detected *** double free or corruption (out): 0x40180788 *** I realy suspect the _ldap.so file. I have not found a solution yet, but will

Re: Seeking assistance - string processing.

2006-11-14 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I am trying to work out how to make it find a string like this "===" > and when it has found it, I want it to add "===" to the end of the > line. how about if line.startswith("==="): line = line + "===" or if "===" in line: # anywhere line

Re: Is python for me?

2006-11-14 Thread Steve Holden
Mark Woodward wrote: > On Mon, 13 Nov 2006 09:11:13 -0800, lennart wrote: > >> Hi, >> >> I'm planning to learn a language for 'client' software. Until now, i >> 'speak' only some web based languages, like php. As a kid i programmed >> in Basic (CP/M, good old days :'-) ) Now i want to start to lea

Re: deleteing item from a copy of a list

2006-11-14 Thread Mikael Olofsson
timmy wrote: > i make a copy of a list, and delete an item from it and it deletes it > from the orginal as well, what the hell is going on?!?!?! > > #create the staff copy of the roster > Roster2 = [] > for ShiftLine in Roster: > #delete phone number from staff copy >

Re: Multithreaded C API Python questions

2006-11-14 Thread Svein Seldal
Hi! I think I've found the bug, but I need to confirm this behavior. My findings is that if you use PyEval_InitThreads(), it is crucial to release the GIL with PyEval_ReleaseThread() afterwards. The API docs states that you can release the GIL with PyEval_ReleaseLock() or PyEval_ReleaseThread(

Re: to setattr or def setProp()

2006-11-14 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: > I have a class for rectangle and it has two points in its __slots__ . > However, we can derive a number of properties like width, height, > centerPoint etc from these two points. Now, I want to be able to set > and get these properties directly from the instances. I can e

Re: Py3K idea: why not drop the colon?

2006-11-14 Thread Antoon Pardon
On 2006-11-14, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: > >> Why not? My impression is that removing redundancy is considered >> a positive thing here in c.p.l. > > so why are you still here? Because I have a different opinion and I don't need your permission. -- Antoon Pa

PyFAQ: help wanted with thread article

2006-11-14 Thread Fredrik Lundh
this FAQ item talks about using sleep to make sure that threads run properly: http://effbot.org/pyfaq/none-of-my-threads-seem-to-run-why.htm I suspect it was originally written for the "thread" module, but as far as I know, the "threading" module takes care of the issues described here all by it

RE: sqlite3 views, if not exists clause

2006-11-14 Thread Tim Golden
[Josh] | I'm running into a problem when trying to create a view in my sqlite | database in python. I think its a bug in the sqlite3 api that | comes with python 2.5. | THIS DOES NOT WORK, but it should! | conn = sqlite3.connect(':memory:') | conn.execute("create table foo (a int,b int)") |

sqlite3 views, if not exists clause

2006-11-14 Thread Josh
Hi, I'm running into a problem when trying to create a view in my sqlite database in python. I think its a bug in the sqlite3 api that comes with python 2.5. This works as expected: conn = sqlite3.connect(':memory:') conn.execute("create table foo (a int,b int)") conn.execute('create view

Re: sqlite3 views, if not exists clause

2006-11-14 Thread Fredrik Lundh
"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: http://www.sqlite.org/changes.html -- http://mail.python.org/mailman/listinfo/python-list

Using ctypes with Windows API to get FileVersion of a file

2006-11-14 Thread looping
Hi, I need to get the FileVersion of some files on Windows. The best way look like to use function GetFileVersionInfo from the Windows API. I first try with pywin32 and it work well, but with ctypes now included in Python 2.5, use it look like a good idea. So I write the code below that work fine,

Re: Programmatically finding "significant" data points

2006-11-14 Thread Fredrik Lundh
"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. > > Here is some sample data: > data

Re: Programmatically finding "significant" data points

2006-11-14 Thread Philipp Pagel
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 am not sure, what

graphical class diagram tool?

2006-11-14 Thread nic
Hi all Some years ago I saw a graphical class diagram generated by examining a python program. I *thought* that this was done with Boa Constructor, but I may be wrong. I've download a recent version of BC and can't find reference to this feature. Can anyone point me at other tools to do this?

Re: __init__.py

2006-11-14 Thread Fredrik Lundh
km wrote: > what is the use of __init__.py file in a module dir ? it tells Python that the directory is a package directory. if you have mydir/foo/__init__.py mydir/foo/module.py and mydir is on the path, you can do "import foo.module" or "from foo import module". if you remove the

Re: Programmatically finding "significant" data points

2006-11-14 Thread Ganesan Rajagopal
> Jeremy Sanders <[EMAIL PROTECTED]> writes: >> How do I sort through this data and pull out these points of >> significance? > Get a book on statistics. One idea is as follows. If you expect the points > to be centred around a single value, you can calculate the median or mean > of the point

Re: Using signal.alarm to terminate a thread

2006-11-14 Thread Nick Craig-Wood
Adrian Casey <[EMAIL PROTECTED]> wrote: > > Adrian Casey <[EMAIL PROTECTED]> wrote: > > import os, pexpect, threading > > > > def runyes(): > > print "Running yes command..." > > pexpect.run('yes', timeout=5) > > > > t = threading.Thread(target=runyes) > > t.start() > > t.join() >

Re: Programmatically finding "significant" data points

2006-11-14 Thread Alan J. Salmoni
If the order doesn't matter, you can sort the data and remove x * 0.5 * n where x is the proportion of numbers you want. If you have too many similar values though, this falls down. I suggest you check out quantiles in a good statistics book. Alan. Peter Otten wrote: > erikcw wrote: > > > Hi all

Re: Seeking assistance - string processing.

2006-11-14 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Cheers for the reply. > > But I'm still having a spot of bother with the === addition > > it would seem that if there is no whitespace after the ===test > then the new === gets added to the next line > > e.g file contains: > > ===test (and then no whitesapace/carriag

Re: PyFAQ: help wanted with thread article

2006-11-14 Thread Laurent Pointal
Fredrik Lundh a écrit : > this FAQ item talks about using sleep to make sure that threads run > properly: > > http://effbot.org/pyfaq/none-of-my-threads-seem-to-run-why.htm > > I suspect it was originally written for the "thread" module, but as > far as I know, the "threading" module takes care o

Re: __init__.py

2006-11-14 Thread km
Hi, I have a structure like this : foo/__init__.py foo/bar/__init__.py foo/bar/firstmodule.py foo/abc/__init__.py foo/abc/secondmodule.py now i have some variables (paths to data files) common, to be used in first module and second modules respectively. can i set those variables in foo/

Re: Seeking assistance - string processing.

2006-11-14 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > But I'm still having a spot of bother with the === addition > > it would seem that if there is no whitespace after the ===test > then the new === gets added to the next line > > e.g file contains: > > ===test (and then no whitesapace/carriage returns or anything) > >

Re: Seeking assistance - string processing.

2006-11-14 Thread John Machin
[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 What does that mean? There is no sort in the computer sense, and if you mean as in "done" ... > however there > is 1 problem remaining. > > I

Re: graphical class diagram tool?

2006-11-14 Thread Laurent Pointal
nic a écrit : > Hi all > Some years ago I saw a graphical class diagram generated by > examining a python program. I *thought* that this was done with Boa > Constructor, but I may be wrong. I've download a recent version of BC > and can't find reference to this feature. Can anyone point me at o

Re: Research Master 0.1 (GPL/Python)

2006-11-14 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: > ResearchMaster has been designed to simplify management of research > literature. It is a GUI interface to a system of folders and records. > Each record contains notes, meta info and BibTex info about an > associated file. Instances of the single copy of a record can oc

Re: Seeking assistance - string processing.

2006-11-14 Thread billpaterson2006
Thanks so much, a really elegant solution indeed. I have another question actually which I'm praying you can help me with: with regards to the .jpg conversion to .jpg]] and .gif -> .gif]] this works, but only when .jpg/.gif is on it's own line. i.e: .jpg will get converted to: .jpg]] but I

Re: PyFAQ: anyone seen aahz' thread tutorial ?

2006-11-14 Thread Fredrik Lundh
Paul Boddie wrote: >> they have disappeared from the starship? any ideas where to look for them ? > > The Internet Archive (the rewind button of the Internet): > > http://web.archive.org/web/20050729075144/http://starship.python.net/crew/aahz/OSCON2001/ but of course. I didn't even bother to

Re: mod_python installation problem ..severity High

2006-11-14 Thread Graham Dumpleton
boney wrote: > On doing this and duly following the installation and testing > instructions at www.modpython.org and then pointing the url as > http://localhost/test/mptest.py, i get the following error on the > server log file: > > [Tue Nov 14 15:17:47 2006] [error] make_obcallback: could not impo

Re: Programmatically finding "significant" data points

2006-11-14 Thread Beliavsky
erikcw wrote: > Hi all, > > I have a collection of ordered numerical data in a list. Called a "time series" in statistics. > 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 fr

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

2006-11-14 Thread Mudcat
Wojciech Mula wrote: > Mudcat wrote: > > [...] > > You have to set cursor once, Tk change it automatically: > > > def buildFrame(self): > > self.f = Frame(self.master, height=32, width=32, relief=RIDGE, > > borderwidth=2) > > self.f.place(relx=.5,rely=.5) >

RE: Noob | datetime question

2006-11-14 Thread Demel, Jeff
Perfect. Thanks a million. .strftime was the method I was looking for. -Jeff -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kevin Kelley Sent: Tuesday, November 14, 2006 9:34 AM To: python-list@python.org Subject: Re: Noob | datetime question import

Re: Noob | datetime question

2006-11-14 Thread Kevin Kelley
import timeFORMAT='%Y%m%d'time.strftime(FORMAT,time.gmtime(time.time()+8380800))output = '20070219'--Kevin KelleyOn 11/14/06, Demel, Jeff <[EMAIL PROTECTED]> wrote: I'm having trouble finding exactly what I need by googling, so thoughtI'd try to get a quick answer from the group.  This seems like

Python speed on Solaris 10

2006-11-14 Thread Chris Miles
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 build options are for Sola

VLC-python bindings

2006-11-14 Thread LaundroMat
Hi, Has anyone succeeded in compiling the vlc-python bindings on Windows? (as discussed in the vlc development wiki). I have found several compiled bindings, but none were updated for Python 2.4 (or 2.5 for that matter). As I am a complete layman for everything that is C compilation on any platfo

Re: PyFAQ: anyone seen aahz' thread tutorial ?

2006-11-14 Thread Paul Boddie
Fredrik Lundh 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 where to look for them ? The Internet Archive (the r

Re: Seeking assistance - string processing.

2006-11-14 Thread billpaterson2006
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 python was 3 days ago. In case you wer

Re: __init__.py

2006-11-14 Thread Fredrik Lundh
"km" wrote: > I have a structure like this : > foo/__init__.py > foo/bar/__init__.py > foo/bar/firstmodule.py > foo/abc/__init__.py > foo/abc/secondmodule.py > > now i have some variables (paths to data files) common, to be used in > first module and second modules respectively. > can i set those

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

Re: modules and generated code

2006-11-14 Thread Peter Otten
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 all the code living in >>> the

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: 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: 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: 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

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: __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

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: 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: 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: 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: 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

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 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

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 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: 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

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: 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

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

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

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: 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

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 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

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: 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.

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: 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

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: 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

mod_python installation problem ..severity High

2006-11-14 Thread boney
hello All, I am totally unknown to python language.. i need to install mod_python to embed python interpreter with the Apache server, in order to use Trac with Apache Web Server i am using : Python 2.4.3, apache 2.0.50 for windows, mod_python-3.2.10.win32-py2.4-apache2.0 (windows installer) af

Re: Random image text generation?

2006-11-14 Thread Paul Rubin
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. E.g. you might show five different kittens and a horse. The user > has to click on the image t

__init__.py

2006-11-14 Thread km
Hi all, what is the use of __init__.py file in a module dir ? Is it used to initialize variables  that could be shared across sub modules  if set in __init__.py at root dir  of module ? regards, KM -- 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: > [...] You have to set cursor once, Tk change it automatically: > def buildFrame(self): > self.f = Frame(self.master, height=32, width=32, relief=RIDGE, > borderwidth=2) > self.f.place(relx=.5,rely=.5) #self.f.bind( '', self.enterFr

PyFAQ: anyone seen aahz' thread tutorial ?

2006-11-14 Thread Fredrik Lundh
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 where to look for them ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Seeking assistance - string processing.

2006-11-14 Thread John Machin
John Machin wrote: >new = line[:-1] + "===\n" To allow for cases where the last line in the file is not terminated [can happen], this should be: new = line.rstrip("\n") + "===\n" # assuming you want to fix the unterminated problem. Cheers, John -- http://mail.python.org/mailman/l

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: 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: 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: 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: 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

  1   2   >