Re: How to link foreign keys & primary keys using python?

2006-06-11 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hi Mr. George, > > Let me try it again... > > I am not using any relational database to store the required tables > with primary keys & foreign keys > None the less, you are using relational database terminology. If you want people to understand you then you shou

Re: How to link foreign keys & primary keys using python?

2006-06-11 Thread sonal
MTD wrote: > Your post is confusing. Here is my advice: investigate the use of > dictionaries. Dictionaries can allow you to define data in the form { > key:data }, e.g. > > { area_code : area_data } > > { (area_code,school_code) : school_data } > > { (school_code,student_code) : student_data } T

Re: How to link foreign keys & primary keys using python?

2006-06-11 Thread sonal
Hi Mr. George, Sorry for confusing u so much... Let me try it again... I am not using any relational database to store the required tables with primary keys & foreign keys When I say PRIMARY KEY => 1. It means an index is created on the specified fields (Out of various fields given in th

Re: wxPython: Keyboard events and TreeCtrl

2006-06-11 Thread jean-michel bain-cornu
> Am I supposed to connect the method to the Frame somehow? Or does it > automatically get called when the user hits Ctrl-I, regardless of the > fact that no other methods call OnKeyDown? I think it must be connected to the treectrl. One line or a combination of : self.Bind(wx.EVT_KEY_DOWN

Re: wxPython: Should you use a master sizer object?

2006-06-11 Thread Morpheus
IIRC the wx dox contain stuff about sizers too. It's definitly worth to get into this stuff. Once you are used to sizers, you don't want to miss them anymore. HTH Morpheus "John Salerno" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Steve Holden wrote: > > > There doesn't seem to

Re: An error ?

2006-06-11 Thread Rene Pijlman
Bo Yang: >[Fri Jun 16 14:06:45 2006] [error] [client 10.10.110.17] malformed >header from script. Bad header=Hello World!: a.py "The output of a CGI script should consist of two sections, separated by a blank line. The first section contains a number of headers, telling the client what kind of dat

Re: PIL problem after installation

2006-06-11 Thread Lad
Fredrik Lundh wrote: > Lad wrote: > > > I installed PIL under Linux but now when I try it I get the error: > > > > decoder jpeg not available > > How can I correct that problem? > > if you built PIL yourself, the setup script told you how to fix this. > > - make sure you have right libraries

Re: Screen Scraping for Modern Applications?

2006-06-11 Thread Daniel Nogradi
> > Scrape means simply scraping pixel colors from locations on the screen. > > I'll worry about assembling it into meaningful information. > > import ImageGrab > im = ImageGrab.grab() > v = im.getpixel((x, y)) > > requires: > > http://www.pythonware.com/products/pil/ > > ## #

Re: How to link foreign keys & primary keys using python?

2006-06-11 Thread sonal . patankar
MTD wrote: > Your post is confusing. Here is my advice: investigate the use of > dictionaries. Dictionaries can allow you to define data in the form { > key:data }, e.g. > > { area_code : area_data } > > { (area_code,school_code) : school_data } > > { (school_code,student_code) : student_data } T

An error ?

2006-06-11 Thread Bo Yang
Hi , I am confronted with an odd question in the python cgi module ! Below is my code : import cgitb ; cgitb.enable() import cgi print "Hello World !" How easy the script is , and the url is 202.113.239.51/vote/cgi/a.py but apache give me a 'Server internal error !' and the error log is : [Fr

Re: How to link foreign keys & primary keys using python?

2006-06-11 Thread sonal . patankar
Hi Mr. George, Let me try it again... I am not using any relational database to store the required tables with primary keys & foreign keys When I say PRIMARY KEY => 1. It means an index is created on the specified fields (Out of various fields given in the comma separated txt file) File

Re: Screen Scraping for Modern Applications?

2006-06-11 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Scrape means simply scraping pixel colors from locations on the screen. > I'll worry about assembling it into meaningful information. import ImageGrab im = ImageGrab.grab() v = im.getpixel((x, y)) requires: http://www.pythonware.com/products/pil/

Re: Screen Scraping for Modern Applications?

2006-06-11 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > Scrape means simply scraping pixel colors from locations on the screen. > I'll worry about assembling it into meaningful information. > I've used pywinauto to interact with a Flash animation panel, running within an Internet Explore

Re: Screen Scraping for Modern Applications?

2006-06-11 Thread ljr2600
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > <[EMAIL PROTECTED]> wrote: > . > . > . > >For a side project I'm working on I need to be able to scrape a modern > >computer desktop. Is there any basic material already avai

Re: Most elegant way to generate 3-char sequence

2006-06-11 Thread Petr Jakes
sam wrote: > I have found that the more elegant the code is, the harder it is for me > to understand what it is trying to accomplish. It is my opinion that > "Keep It Simple" wins over elegance. When I have had the urge to get > elegant, I make sure I comment the elegance so my less elegant > co-wo

Re: First question on extending Python...

2006-06-11 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Larry Bates <[EMAIL PROTECTED]> wrote: >Redefined Horizons wrote: . . . >> There is a third-party application that I need to work with. It is >> closed-source, but it exposes a C API. I want to

Re: how to get the length of a number

2006-06-11 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Felipe Almeida Lessa <[EMAIL PROTECTED]> wrote: . . . >math.floor(math.log(x, 10)) + 1 > >-- >Felipe. > ... and you're restricting to the positive integers, I take it? I still have rounding pr

Re: Screen Scraping for Modern Applications?

2006-06-11 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: . . . >For a side project I'm working on I need to be able to scrape a modern >computer desktop. Is there any basic material already available to do >this? I'd rather

Re: Evaluating a Function After X Seconds: Python Equivalent to JavaScript's SetTimeout() Function

2006-06-11 Thread KenAggie
Yea -- the "sched" class is exactly what you need. Just import sched and then use it to schedule a function call in the future, either using relative time or an absolute time. The python help file tells you how in detail. - Ken [EMAIL PROTECTED] wrote: > Hi all, > > Not exactly new to Python, ju

Re: Screen Scraping for Modern Applications?

2006-06-11 Thread KenAggie
I just learned about a python library called BeautifulSoup in a thread responding to my Southwest Airlines script that I wrote and posted on the Python cookbook web site. I wrote my script using the provided HTMLParser class. BeautifulSoup could have saved me some time perhaps. Take a look. Feel fr

Re: Get my airlines boarding pass

2006-06-11 Thread KenAggie
Okay, so too bad I didn't know about this before I wrote the 75 lines of code based on HTMLParser. That said, it still wasn't that hard and most of all it is done and it works so I won't be rewriting it. I did check it out and it seems quite powerful. I'll add it to my library of tools to use for t

Re: direct initialization of class attributes vs. declarations w/in __init__

2006-06-11 Thread digitalorganics
Diez B. Roggisch wrote: > > No need to be obnoxious. I do appreciate your efforts to help, but you > > must admit, your last statement is a bit snide and certainly not > > useful. > > I'm telling you that the code runs differently on my laptop. > > It certainly doesn't. There is absolutely no ima

Re: direct initialization of class attributes vs. declarations w/in __init__

2006-06-11 Thread digitalorganics
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > Output from laptop comp.: > > > > 1 > > 10 > > 2 > > 10 > > 3 > > 10 > > so how are you entering and running the code on your laptop ? > > what happens if you set the class attribute to 100 instead of 10 ? > > You can see my other post which

Re: direct initialization of class attributes vs. declarations w/in __init__

2006-06-11 Thread digitalorganics
Oh wow, I wasn't expecting so much help. I really appreciate it. My problem, however, has been solved. I uninstalled my ActiveState Python distro on my laptop and installed the distro from python.org along with Stan's Python Editor. I ran the same code I'd run before and guess what? The behavior no

Evaluating a Function After X Seconds: Python Equivalent to JavaScript's SetTimeout() Function

2006-06-11 Thread ycoci0
Hi all, Not exactly new to Python, just have not programmed a time dependent function using it before. I imagine that many of you may also program some JavaScript and may be familiar with JavaScript's SetTimeout( expression, after time interval in milliseconds) function. Does Python have an equi

Screen Scraping for Modern Applications?

2006-06-11 Thread ljr2600
Hello, I'm very new to python and still familiarizing myself with the language, sorry if the post seems moronic or simple. For a side project I'm working on I need to be able to scrape a modern computer desktop. Is there any basic material already available to do this? I'd rather not need to writ

Re: ANN: PyQt v4.0 Released - Python Bindings for Qt v4

2006-06-11 Thread Butternut Squash
Phil Thompson wrote: > Riverbank Computing is pleased to announce the release of PyQt v4.0 > available from http://www.riverbankcomputing.co.uk/pyqt/. > > The main change from v4.0beta1 is the inclusion of comprehensive HTML > documentation based on the Qt documentation. > > PyQt is a comprehens

Re: Thread specific singleton

2006-06-11 Thread Aahz
In article <[EMAIL PROTECTED]>, Gabriele Farina <[EMAIL PROTECTED]> wrote: > >I'm tring to implement a Singleton object that should be specific for >every thread who create it, not global. >I tried a solution that seems to work, but I have a very poor knowledge >of concurrent programming, so I'd

Re: @func call syntax

2006-06-11 Thread Schüle Daniel
this is decorator, this is how it's may be implented >>> def returns(t): ... def dec(f): ... def wrapped(*args, **kwargs): ... ret = f(*args, **kwargs) ... assert type(ret) is t ... return ret ... return wrapp

Z39.50 and tyrannioware website seems to be down

2006-06-11 Thread bussiere
Title: Z39.50 and tyrannioware website seems to be down sorry to disturb you but from here : http://lists.indexdata.dk/pipermail/zoom/2005-October/000806.html if yes i cannot take this three files : asn1.py z3950_2001.py zdefs.py the website seems to be down : http://cvs.sourceforge.net/v

Re: @func call syntax

2006-06-11 Thread casevh
[EMAIL PROTECTED] wrote: > Hi, > > I am new to Python, here I'd like to have a question: I noticed a > special way to call a function in a program: > > @function_name > > No argv is passed, even though the function_name asks for one. Any idea > what this @something syntax is trying to achieve.

Re: Xah Lee network abuse

2006-06-11 Thread Robert Hicks
Erik Max Francis wrote: > Mallor wrote: > > > I know I'm coming late to the barbeque. In passing, I ask: do you have > > an objective, impartial perspective on the subject of committing > > crimes? Because libel is a crime. > > No, it is a tort. > Can I have whipped cream and strawberries on th

@func call syntax

2006-06-11 Thread teekaysoh
Hi, I am new to Python, here I'd like to have a question: I noticed a special way to call a function in a program: @function_name No argv is passed, even though the function_name asks for one. Any idea what this @something syntax is trying to achieve. I haven't been able to find any answer o

Re: math.pow(x,y)

2006-06-11 Thread casevh
K.S.Sreeram wrote: > Raymond L. Buvel wrote: > > I just tried this and it is taking an extremely long time even on a fast > > machine with 4 Gb of RAM. Killed it after a couple of minutes. > > You probably tried printing the value. > > a = 34564323**456356 (takes just 28 seconds) > whereas > b =

Re: Get my airlines boarding pass

2006-06-11 Thread Jonathan Ellis
KenAggie wrote: > I posted it on activestate already ... sorry. I would like for the > geniuses here to use it and improve upon it so here is the activestate > post URL: > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496790 Whoa. Check out BeautifulSoup -- you will never write HTMLPa

Re: Xah Lee network abuse

2006-06-11 Thread George Neuner
On Sun, 11 Jun 2006 06:05:22 GMT, "Mike Schilling" <[EMAIL PROTECTED]> wrote: > >"Philippa Cowderoy" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >> On Sun, 11 Jun 2006, Mike Schilling wrote: >> >>> I'm not aware of any definition of libel that includes "making statements >>> that

Re: direct initialization of class attributes vs. declarations w/in __init__

2006-06-11 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Output from laptop comp.: > > 1 > 10 > 2 > 10 > 3 > 10 so how are you entering and running the code on your laptop ? what happens if you set the class attribute to 100 instead of 10 ? -- http://mail.python.org/mailman/listinfo/python-list

Re: direct initialization of class attributes vs. declarations w/in __init__

2006-06-11 Thread Diez B. Roggisch
> No need to be obnoxious. I do appreciate your efforts to help, but you > must admit, your last statement is a bit snide and certainly not > useful. > I'm telling you that the code runs differently on my laptop. It certainly doesn't. There is absolutely no imaginable way how this behavior could

Re: direct initialization of class attributes vs. declarations w/in __init__

2006-06-11 Thread digitalorganics
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > Any clue what's behind this behavior? > > a missing plus sign. > > Thanks for the guess but not possible given the following: class Boo: jerk = 10 def killjerk(self): counter = 3 while counter !=0: counte

Re: direct initialization of class attributes vs. declarations w/in __init__

2006-06-11 Thread Fredrik Lundh
Fredrik Lundh wrote: > a missing plus sign. or a misplaced one... (=+ 1 is not the same thing as += 1) -- http://mail.python.org/mailman/listinfo/python-list

Re: direct initialization of class attributes vs. declarations w/in __init__

2006-06-11 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Any clue what's behind this behavior? a missing plus sign. -- http://mail.python.org/mailman/listinfo/python-list

Re: direct initialization of class attributes vs. declarations w/in __init__

2006-06-11 Thread digitalorganics
Thank you Dennis, this makes the behavior so much clearer to me. I see now that when self.jerk = self.jerk + 1 is executed that even though the names are identical, at this point I'm referring to two different values (one which is being created in part from the other). As for my laptop, I'm not r

Re: Most elegant way to generate 3-char sequence

2006-06-11 Thread sam
I have found that the more elegant the code is, the harder it is for me to understand what it is trying to accomplish. It is my opinion that "Keep It Simple" wins over elegance. When I have had the urge to get elegant, I make sure I comment the elegance so my less elegant co-workers can figure out

Re: math.pow(x,y)

2006-06-11 Thread Raymond L. Buvel
K.S.Sreeram wrote: > Raymond L. Buvel wrote: >> I just tried this and it is taking an extremely long time even on a fast >> machine with 4 Gb of RAM. Killed it after a couple of minutes. > > Thats odd. > 34564323**456356 completed on my laptop in 28 seconds. > [Python 2.4.3, Celeron-M 1.3GHz, Win

Re: direct initialization of class attributes vs. declarations w/in __init__

2006-06-11 Thread digitalorganics
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > At first, I thought that self.jerk was resolving to the class attribute > > instead of creating a new variable (w/ a differing scope). > > When you access an instance attribute, Python first looks in the > instance object, and then in the class

Re: learning python idioms

2006-06-11 Thread James Stroud
[EMAIL PROTECTED] wrote: > After several years developing in Java, I've begun to switch to Python > for several of my new projects as I have found the language quite > interesting. I've read several tutorials and implemented a few sample > programs and I've found that Python enables one to program

Re: Most elegant way to generate 3-char sequence

2006-06-11 Thread James Stroud
Fredrik Lundh wrote: > James Stroud wrote: > >> See the actual question: >> >> >How would you construct a generator to acheive this? > > > if you don't think the context provided by the subject line and the > sentence before the question is important, how come you're so sure what > "this" ref

Re: how to get the length of a number

2006-06-11 Thread Fredrik Lundh
Felipe Almeida Lessa wrote: > Hmmm, you're right. > > math.floor(math.log(x, 10)) + 1 x = 0 -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get the length of a number

2006-06-11 Thread Claudio Grondi
Stan Cook wrote: > Can anyone tell me how to get the length of a number. I know > len(string) will get the length of a string, but it doesn't like > len(int). I seem to remember something like %s string. I tried to set > a variable = to %s int, but that doesn't work. Is there a function I've

Re: Killing a thread

2006-06-11 Thread Fredrik Lundh
MacDonald wrote: >> I'm not sure using a non-portable API to run the code under a "custom >> debugger" qualifies as a "portable implementation", though... > > Everything used is a part of the standard library, which is portable, > AFAICT. Could you say specifically what is non-portable? from the

Re: how to get the length of a number

2006-06-11 Thread Felipe Almeida Lessa
Em Dom, 2006-06-11 às 22:33 +0200, Sybren Stuvel escreveu: > Felipe Almeida Lessa enlightened us with: > > To see how many decimal digits it has: > > > > import math > > math.ceil(math.log(i, 10)) > > That doesn't work properly. > > >>> import math > >>> math.ceil(math.log(1, 10)) > 4

Re: Killing a thread

2006-06-11 Thread MacDonald
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > >> it cannot be done in a portable way, so that's not very likely. > > > def __run(self): > > """Hacked run function, which installs the trace.""" > > sys.settrace(self.globaltrace) > > self.__run_backup() > > self.run = self.__r

Re: how to get the length of a number

2006-06-11 Thread Felipe Almeida Lessa
Em Dom, 2006-06-11 às 13:17 -0700, Saketh escreveu: > Stan Cook wrote: > > Can anyone tell me how to get the length of a number. I > > know len(string) will get the length of a string, but it > > doesn't like len(int). I seem to remember something like %s > > string. I tried to set a variable =

Re: how to get the length of a number

2006-06-11 Thread Stan Cook
Saketh wrote: > Stan Cook wrote: >> Can anyone tell me how to get the length of a number. I >> know len(string) will get the length of a string, but it >> doesn't like len(int). I seem to remember something like %s >> string. I tried to set a variable = to %s int, but that >> doesn't work. Is t

Re: how to get the length of a number

2006-06-11 Thread Felipe Almeida Lessa
Em Dom, 2006-06-11 às 20:10 +, Stan Cook escreveu: > Can anyone tell me how to get the length of a number. I > know len(string) will get the length of a string, but it > doesn't like len(int). I seem to remember something like %s > string. I tried to set a variable = to %s int, but that

Re: how to get the length of a number

2006-06-11 Thread Saketh
Stan Cook wrote: > Can anyone tell me how to get the length of a number. I > know len(string) will get the length of a string, but it > doesn't like len(int). I seem to remember something like %s > string. I tried to set a variable = to %s int, but that > doesn't work. Is there a function I've

Re: how to get the length of a number

2006-06-11 Thread Fredrik Lundh
Stan Cook wrote: > Is there a function I've forgotten about to convert an > integer to a string? str(value) -- http://mail.python.org/mailman/listinfo/python-list

Re: Get my airlines boarding pass

2006-06-11 Thread KenAggie
I posted it on activestate already ... sorry. I would like for the geniuses here to use it and improve upon it so here is the activestate post URL: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496790 Enjoy. Ken BartlebyScrivener wrote: > >> SW air script > > Post it here, first, and

how to get the length of a number

2006-06-11 Thread Stan Cook
Can anyone tell me how to get the length of a number. I know len(string) will get the length of a string, but it doesn't like len(int). I seem to remember something like %s string. I tried to set a variable = to %s int, but that doesn't work. Is there a function I've forgotten about to con

Re: math.pow(x,y)

2006-06-11 Thread Tim Peters
[Wojciech Muła] >> You have to use operator **, i.e. 34564323**456356 Or the builtin pow() instead of math.pow(). [Gary Herron] > That's not very practical. That computation will produce a value with > more than 3.4 million digits. Yes. > (That is, log10(34564323)*456356 = 3440298.) Python will

Re: math.pow(x,y)

2006-06-11 Thread K.S.Sreeram
Raymond L. Buvel wrote: > I just tried this and it is taking an extremely long time even on a fast > machine with 4 Gb of RAM. Killed it after a couple of minutes. You probably tried printing the value. a = 34564323**456356 (takes just 28 seconds) whereas b = str(a) takes forever! Regards Sreer

wxPython: Keyboard events and TreeCtrl

2006-06-11 Thread Saketh
Hello, everyone. I am a writing an application that I want to make a stripped-down framework of Leo for Cornell note-taking. I have one TreeCtrl, a menu, and a status bar. There are two classes currently - the Application class and the Frame class. The Frame class contains all of the event handl

Re: math.pow(x,y)

2006-06-11 Thread K.S.Sreeram
Raymond L. Buvel wrote: > I just tried this and it is taking an extremely long time even on a fast > machine with 4 Gb of RAM. Killed it after a couple of minutes. Thats odd. 34564323**456356 completed on my laptop in 28 seconds. [Python 2.4.3, Celeron-M 1.3GHz, WinXP], and max memory consumption

Re: math.pow(x,y)

2006-06-11 Thread Raymond L. Buvel
Felipe Almeida Lessa wrote: > Em Dom, 2006-06-11 às 11:19 -0700, fl1p-fl0p escreveu: >> import math >> math.pow(34564323, 456356) >> >> will give math range error. >> >> how can i force python to process huge integers without math range >> error? Any modules i can use possibly? > > 34564323**45635

Re: math.pow(x,y)

2006-06-11 Thread Gary Herron
Wojciech Muła wrote: > fl1p-fl0p wrote: > >> import math >> math.pow(34564323, 456356) >> >> will give math range error. >> >> how can i force python to process huge integers without math range >> error? Any modules i can use possibly? >> > > You have to use operator **, i.e. 34564323**4563

Re: direct initialization of class attributes vs. declarations w/in __init__

2006-06-11 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > At first, I thought that self.jerk was resolving to the class attribute > instead of creating a new variable (w/ a differing scope). When you access an instance attribute, Python first looks in the instance object, and then in the class object. When you assign to an i

Re: math.pow(x,y)

2006-06-11 Thread Wojciech Muła
fl1p-fl0p wrote: > import math > math.pow(34564323, 456356) > > will give math range error. > > how can i force python to process huge integers without math range > error? Any modules i can use possibly? You have to use operator **, i.e. 34564323**456356 -- http://mail.python.org/mailman/listinfo

Re: math.pow(x,y)

2006-06-11 Thread Felipe Almeida Lessa
Em Dom, 2006-06-11 às 11:19 -0700, fl1p-fl0p escreveu: > import math > math.pow(34564323, 456356) > > will give math range error. > > how can i force python to process huge integers without math range > error? Any modules i can use possibly? 34564323**456356 ? -- Felipe. -- http://mail.pytho

math.pow(x,y)

2006-06-11 Thread fl1p-fl0p
import math math.pow(34564323, 456356) will give math range error. how can i force python to process huge integers without math range error? Any modules i can use possibly? -- http://mail.python.org/mailman/listinfo/python-list

Re: direct initialization of class attributes vs. declarations w/in __init__

2006-06-11 Thread digitalorganics
Wait a minute! It doesn't explain my bugs. I've got "class variables" acting like instance variables. What's weirder is that this behavior occurs on my computer (in both of my installed WinXP copies) but not on my laptop (WinXP Pro). See the following test: class Boo: jerk = "yes" def ki

Re: import hook

2006-06-11 Thread Thomas Heller
Alex Martelli wrote: > Jeremy Sanders <[EMAIL PROTECTED]> wrote: > >> Hi - Is it possible to override the import process so that if in my program >> I do >> >> import foo.bar >> >> Python will look for bar in a directory which isn't called foo? >> >> I want my module/program to be able to be ru

Re: direct initialization of class attributes vs. declarations w/in __init__

2006-06-11 Thread digitalorganics
Ah, you've brought me much clarity Diez, thank you. That would explain some "bugs" I've been having... Diez B. Roggisch wrote: > [EMAIL PROTECTED] schrieb: > > What's the difference between initializing class variables within the > > class definition directly versus initializing them within the c

ANN: Dao 1.0.0-alpha is released

2006-06-11 Thread [EMAIL PROTECTED]
Hello, It is a pleasure to announce in this mailing list the newly released Dao. This is the first release after the Dao interpreter being re-designed and re-implemented as a virtual register machine since the beginning of this year. There have been many great improvements on both the language and

Re: direct initialization of class attributes vs. declarations w/in __init__

2006-06-11 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > What's the difference between initializing class variables within the > class definition directly versus initializing them within the class's > __init__ method? Is there a reason, perhaps in certain situations, to > choose one over the other? You are confusing class va

direct initialization of class attributes vs. declarations w/in __init__

2006-06-11 Thread digitalorganics
What's the difference between initializing class variables within the class definition directly versus initializing them within the class's __init__ method? Is there a reason, perhaps in certain situations, to choose one over the other? Thank you. -- http://mail.python.org/mailman/listinfo/pytho

Re: [ANN] Cerealizer 0.4 -- a secure Pickle-like module

2006-06-11 Thread Aahz
In article <[EMAIL PROTECTED]>, Jiba wrote: > >Cerealizer is now available under the Python license (and was >previously GPL'ed). Nothing except for Python itself should be released under the Python license. See http://wiki.python.org/moin/PythonSoftwareFoundationLicenseFaq -- Aahz ([EMAIL PRO

Re: Very newbie programming

2006-06-11 Thread TheSaint
George Sakkis wrote: > > If by 'rooted' you mean old enough, so is 'goto'... I was meaning a sort of (very) old style of programming. In fact I wrote some few hundreds lines on my own, but probably memory was much better the :) > will > thank yourself for doing so if you have to go back at th

ANN: PyQt v4.0 Released - Python Bindings for Qt v4

2006-06-11 Thread Phil Thompson
Riverbank Computing is pleased to announce the release of PyQt v4.0 available from http://www.riverbankcomputing.co.uk/pyqt/. The main change from v4.0beta1 is the inclusion of comprehensive HTML documentation based on the Qt documentation. PyQt is a comprehensive set of Qt bindings for the Pyt

Re: import hook

2006-06-11 Thread Alex Martelli
Jeremy Sanders <[EMAIL PROTECTED]> wrote: > Hi - Is it possible to override the import process so that if in my program > I do > > import foo.bar > > Python will look for bar in a directory which isn't called foo? > > I want my module/program to be able to be run without being installed in > si

Re: import hook

2006-06-11 Thread Rune Strand
Jeremy Sanders wrote: > Hi - Is it possible to override the import process so that if in my program > I do (...) > > Any ideas? Why not handle the foo.bar/version string separately and just append the resulting path to sys.path? -- http://mail.python.org/mailman/listinfo/python-list

Re: Very newbie programming

2006-06-11 Thread TheSaint
Maric Michaud wrote: > Le Samedi 10 Juin 2006 17:44, TheSaint a écrit : > devices = [ e for e in devices if e.split('/')[-1] in partitions ] This is _not_ the expected result :) is missing a not as : devices = [ e for e in devices if e.split('/')[-1] *not* in partitions ] >> if len(c) != 1: >>

Re: Xah Lee network abuse

2006-06-11 Thread Mike Schilling
"Erik Max Francis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Mike Schilling wrote: > >> If I were to write, say, that Tony Blair's tax policy will lead to higher >> deficits, I could be convicted of libel? Even if that's true, it's not a >> priori provable. > > I think what

Re: 10GB XML Blows out Memory, Suggestions?

2006-06-11 Thread uche . ogbuji
K.S.Sreeram wrote: > Fredrik Lundh wrote: > > both ElementTree and cElementTree support "sax-style" event generation > > (through XMLTreeBuilder/XMLParser) and incremental parsing (through > > iterparse). the cElementTree versions of these are even faster than > > pyexpat. > > > > the iterparse in

import hook

2006-06-11 Thread Jeremy Sanders
Hi - Is it possible to override the import process so that if in my program I do import foo.bar Python will look for bar in a directory which isn't called foo? I want my module/program to be able to be run without being installed in site-packages, so by doing "import foo.bar", it should start lo

Re: TypeError: unsubscriptable object

2006-06-11 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Can anybody tell me why am I getting this error message while trying to > print a part of a string. Is there a better approach for this... Because you don't use a string? The error message is pretty clear: TypeError: unsubscriptable object So - what are Function[:10]

Re: Very newbie programming

2006-06-11 Thread George Sakkis
TheSaint wrote: > Maric Michaud wrote: > > > Le Samedi 10 Juin 2006 17:44, TheSaint a écrit : > > >> > > begin using more explicit variable names. > > Frankly it's a very rooted way of programming, since C64 basic :-) If by 'rooted' you mean old enough, so is 'goto'... Except perhaps for iteratio

Re: TKinter

2006-06-11 Thread Chris Lambacher
I would try looking at Django or Turbogears. http://www.djangoproject.com/ http://www.turbogears.org/ Also have a look at: How to write a browser-based desktop app using CherryPy 2.0: http://www.cherrypy.org/wiki/SingleClickAndRun How to write a a browser-based desktop app using CherryPy 2.1: http

Re: package search

2006-06-11 Thread imho
boris ha scritto: > > COOL! You just saved me an awful lot of work. > > Thanks, Diego! > > Boris > ;-) Bye -- http://mail.python.org/mailman/listinfo/python-list

Re: Intermittent Failure on Serial Port

2006-06-11 Thread Serge Orlov
H J van Rooyen wrote: > Serge Orloff wrote: > > | H J van Rooyen wrote: > | > Traceback (most recent call last): > | > File "portofile.py", line 232, in ? > | > ret_val = main_routine(port, pollstruct, pfifo) > | > File "portofile.py", line 108, in main_routine > | > send_nak(port, time

Re: Algorithm for Labels like in Gmail

2006-06-11 Thread Rodolfo
Thanks to you all. I'll start trying the buzhug solution, which seems more pythonic. But I feel like I gotta learn how to use databases... once I studied SQL a litle bit, but don't remember much. I'll play around with Python and then I show what I got. Bye Rodolfo P.S: Is there a way to do a "

Re: package search

2006-06-11 Thread boris
imho wrote: > > You just have to put in "__init__.py" in "lib2" (the package directory > you are "extending"), the following lines: > > from pkgutil import extend_path > __path__ = extend_path(__path__, __name__) > > "__path__", in each __init__ module, is a list initialized with the > module's pa

Re: package search

2006-06-11 Thread imho
boris ha scritto: > I have two directories, lib1 and lib2, that both contain the package > foo, one with the submodule mod1 > and the other with the submodule mod2: > [...] > Now this script: > > import sys > sys.path.append("lib1") > sys.path.append("lib2") > import foo.mod1 > > will find the mo

Re: Import elfclass32 issue

2006-06-11 Thread DarkBlue
Fredrik Lundh wrote: > if you do, it's a SuSE problem (this wouldn't be the first time SuSE > ships broken Python software) Thanks for the input . Following your message I reinstalled python2.4 and the modules I want to use and now everything is fine. -- http://mail.python.org/mailman/list

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

2006-06-11 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

[mod_python] using nested blocks in psp

2006-06-11 Thread cloc3
I'm a newbie in python, and I'm fighting against nested blocks in psp. Thats a little example with a funny behaviour: [code] <% for i in range(50, 350, 50): if 'List' in form and int(form['List'])==i: sel="selected" else: sel="pippo" %> ><%=i%> <% %> [/code] In my intention, the f

Re: learning python idioms

2006-06-11 Thread bayerj
> yup, you could spend weeks reading the Language Wars: Actually, that link is not about language wars. It's about making the switch from java to python. Nothing more, nothing less. -- http://mail.python.org/mailman/listinfo/python-list

Re: regexp questoin

2006-06-11 Thread Simon Brunning
On 9 Jun 2006 17:44:42 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > actually, i am doing an application that allows user to delete files by > entering an input pattern. If you are looking to match filenames, you might want to have a look at the fnmatch and glob modules. The patterns that

Re: Algorithm for Labels like in Gmail

2006-06-11 Thread Gerard Flanagan
[EMAIL PROTECTED] wrote: > Hello there! > > I'm trying to make a simple Contact Manager using python (console > only), however i'm having trouble implementing a division by "Groups" > or "Labels" just like in Gmail. I don't have any real code to post > because all i got now is a raw TXT file holdin

Re: Import elfclass32 issue

2006-06-11 Thread Fredrik Lundh
DarkBlue wrote: > and that's all I did. The suse10.1 installation is pristine > only auto updated with the latest patches of the day. if you're using a SuSE-provided python interpreter, you should make to use the right development files (python-dev, or whatever that's called over in SuSE land).

Re: package search

2006-06-11 Thread boris
Sybren Stuvel wrote: > Simplicity and explicitness. You have two packages 'foo', and it > simply loads the first one it finds. Yes, here you are right. It is indeed simple. Boris -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >