Re: Killing a thread

2006-06-10 Thread Fredrik Lundh
Carl J. Van Arsdall wrote: > Are there any plans in the future to add the capability to kill threads > from the outside? it cannot be done in a portable way, so that's not very likely. > I noticed that each python thread spawns a new interpreter are you sure? what Python version and OS is th

Re: Error in Chain of Function calls (Code Attached)

2006-06-10 Thread Fredrik Lundh
Girish Sahani wrote: > Thanks for the help borisi'll try using sets instead of lists > But i dont understand the point below...full traceback means what :-? see: http://tinyurl.com/qwpsf -- http://mail.python.org/mailman/listinfo/python-list

Re: regexp questoin

2006-06-10 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > actually, i am doing an application that allows user to delete files by > entering an input pattern. so if he has files that have special > characters such as [-] or others, then i want to filter them off I think you will have to define what "pattern" means here.

Re: Allowing zero-dimensional subscripts

2006-06-10 Thread Fredrik Lundh
Carl Banks wrote: > How would you index a 2-D array? With a 2-tuple. > How would you index a 1-D array? With a 1-tuple. > How would you index a 0-D array? ... array dimensions don't exist at the Python level. you're confusing behaviour that a custom class may provide with Python's view of th

Re: __getattr__ question

2006-06-10 Thread Laszlo Nagy
> > Either way is a few more characters to type, but it's far saner than > trying to distinguish between "real" and "fake" attributes. > I think you are right. I'll make up my mind. -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding extra frames to traceback in C module

2006-06-10 Thread John Machin
On 10/06/2006 1:24 PM, Roger Binns wrote: > One thing I would like to do in my extension module is > add extra frames to the traceback when an extension > occurs. At the moment C code is invisible to tracebacks. > This is relevant when the C code makes a Python callback. [snip] > I couldn't find

Re: os.link makes a copy, not a link

2006-06-10 Thread Nick Craig-Wood
Dan M <[EMAIL PROTECTED]> wrote: > I'm a little bit confused. According to the sources I've looked at on the > net, > os.link('file1', 'file2') > should make a hard link from file1 to file2. But what I'm finding is that > it's actually making a copy. Am I forgetting a step or something? >

Re: os.link makes a copy, not a link

2006-06-10 Thread Nick Craig-Wood
Carl Banks <[EMAIL PROTECTED]> wrote: > Dan M wrote: > > I'm a little bit confused. According to the sources I've looked at on the > > net, > > os.link('file1', 'file2') > > should make a hard link from file1 to file2. But what I'm finding is that > > it's actually making a copy. Am I forgetti

Re: __getattr__ question

2006-06-10 Thread [EMAIL PROTECTED]
Hello! > How can I determine if an attribute can be found in the usual places? print "item1" in dir(root) # False print "item3" in dir(root) # True Is it the behavior you wanted? -- http://mail.python.org/mailman/listinfo/python-list

Re: __getattr__ question

2006-06-10 Thread [EMAIL PROTECTED]
And yes, it is more to type ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Allowing zero-dimensional subscripts

2006-06-10 Thread greg
Carl Banks wrote: > Think of it this way: an array with n-dimensions of length 3 would have > 3**n total entries. How many entries would a 0-dimensional array have? > 3**0 == 1. Er, hang on a minute. Along which dimension of this 0-dimensional array does it have a length of 3? :-) -- Greg --

Re: Most elegant way to generate 3-char sequence

2006-06-10 Thread Rob Cowie
John Machin wrote: > On 10/06/2006 7:49 AM, Rob Cowie wrote: > > Hi all, > > > > I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba', > > 'abb', 'abc' etc. all the way to 'zzz'. > > > > How would you construct a generator to acheive this? > > > > A simple, working but somewhat in

Re: Allowing zero-dimensional subscripts

2006-06-10 Thread Tim N. van der Leeuw
greg wrote: > Carl Banks wrote: > > > Think of it this way: an array with n-dimensions of length 3 would have > > 3**n total entries. How many entries would a 0-dimensional array have? > > 3**0 == 1. > > Er, hang on a minute. Along which dimension of this > 0-dimensional array does it have a len

Re: Most elegant way to generate 3-char sequence

2006-06-10 Thread Fredrik Lundh
Rob Cowie wrote: >> Why type all that punctuation? > > What punctuation? ['','','','']['','','','']['','','',''] (also see david isaac's post) -- http://mail.python.org/mailman/listinfo/python-list

Can I set timeout for the sys.stdin.readline() ?

2006-06-10 Thread ywzhan
Hi, I am new here. When I use sys.stdin.readline() to get input string from user, how can I set a timeout value for this operation? thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: what is often before a pattern ?

2006-06-10 Thread joh12005
thanks, i 've checked, it may fit. i also find something about a longest common sequence which may be of interest, but i was unable to adapt it for list (words) rather than characters :( -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding extra frames to traceback in C module

2006-06-10 Thread greg
Roger Binns wrote: > One thing I would like to do in my extension module is > add extra frames to the traceback when an extension > occurs. > > I did find snippets of code > doing things like PyTraceback_Here but they use a real > Python frame which I don't have and don't know how to > synthesize.

Intermittent Failure on Serial Port

2006-06-10 Thread H J van Rooyen
Hi All, I am writing a polling controller for an RS-485 line that has several addressable devices connected. It is a small access control system. All is well- the code runs for anything from three hours to three days, then sometimes when I get a comms error and have to send out a nak character, it

Re: os.link makes a copy, not a link

2006-06-10 Thread [EMAIL PROTECTED]
I had good results with os.symlink on Solaris, see http://docs.python.org/lib/os-file-dir.html Dan M wrote: > I'm a little bit confused. According to the sources I've looked at on the > net, > os.link('file1', 'file2') > should make a hard link from file1 to file2. But what I'm finding is that

Re: Killing a thread

2006-06-10 Thread Diez B. Roggisch
> Are there any plans in the future to add the capability to kill threads > from the outside? Better yet, an interruptable thread so instead of > using a polling loop you could send a DIE_THREAD_DIE signal or > something. I think at present its not possible (or a really bad idea) > to put sig

Re: Intermittent Failure on Serial Port

2006-06-10 Thread Serge Orlov
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, timeout) # so bad luck - comms error > File "/home/hvr/Polling/lib/

Re: CONSTRUCT - Python's way of Ruby's "alias_method"

2006-06-10 Thread Maric Michaud
Le Vendredi 09 Juin 2006 20:06, Ilias Lazaridis a écrit : > the code below works, but has the limitation that I cannot import the > syncdb_hook within "django.core.management". In [4]: from b import CONS In [5]: import b In [6]: b.CONS = 3 In [7]: CONS Out[7]: 5 In [8]: from b import CONS In

Class browser

2006-06-10 Thread bfrost
Hi, Is there a easy way to start a standalone IDLE class-path- browser or 'else' recommended standalone classbrowser. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Most elegant way to generate 3-char sequence

2006-06-10 Thread John Machin
On 10/06/2006 7:01 PM, Rob Cowie wrote: > John Machin wrote: >> On 10/06/2006 7:49 AM, Rob Cowie wrote: >>> Hi all, >>> >>> I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba', >>> 'abb', 'abc' etc. all the way to 'zzz'. >>> >>> How would you construct a generator to acheive this

Re: Most elegant way to generate 3-char sequence

2006-06-10 Thread SuperHik
James Stroud wrote: > SuperHik wrote: >> and the winner is... :D >> David Isaac wrote: >> >>> alpha = string.lowercase >>> x=(a+b+c for a in alpha for b in alpha for c in alpha) >> >> >> > > Not necessarily vying for winner, but David's solution is highly > specific as it doesn't do so well for s

Re: __getattr__ question

2006-06-10 Thread Laszlo Nagy
> print "item1" in dir(root) # False > print "item3" in dir(root) # True > > Is it the behavior you wanted? > Exactly. :-) Why I did not think of this? I'm always amazed when I see that Python can do anything we want. :-) -- http://mail.python.org/mailman/listinfo/python-list

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

2006-06-10 Thread Steve Holden
John Salerno wrote: > Sorry for posting here again. I tried the wxPython list but I'm not sure > I'm sending to the right email address! It bounced back. Besides, your > opinions are too good to pass up. ;) > > My question was: > > I was wondering, is it recommended to always have a top-level s

Re: Most elegant way to generate 3-char sequence

2006-06-10 Thread Steve Holden
James Stroud wrote: > Rob Cowie wrote: > >>Hi all, >> >>I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba', >>'abb', 'abc' etc. all the way to 'zzz'. >> >>How would you construct a generator to acheive this? >> >>A simple, working but somewhat inelegant solution is... >> >>alph

ANN: PyGUI 1.7.2

2006-06-10 Thread greg
PyGUI 1.7.2 is now available: http://www.cosc.canterbury.ac.nz/~greg/python_gui/ This version adds support for multiple mouse buttons, mouse enter and leave events, enhancements to the BlobEdit example application, and a big pile of other enhancements and bug fixes. See the CHANGES.txt file in

Re: Most elegant way to generate 3-char sequence

2006-06-10 Thread Steve Holden
James Stroud wrote: > SuperHik wrote: > >>and the winner is... :D >>David Isaac wrote: >> >> >>>alpha = string.lowercase >>>x=(a+b+c for a in alpha for b in alpha for c in alpha) >> >> >> > > Not necessarily vying for winner, but David's solution is highly > specific as it doesn't do so well for

convert .pdf files to .txt files

2006-06-10 Thread Davor
Hi, my name is david. I need to read information from .pdf files and convert to .txt files, and I have to do this on python, I have been looking for libraries on python and the pdftools seems to be the solution, but I do not know how to use them well, this is the example that I found on the interne

Re: convert .pdf files to .txt files

2006-06-10 Thread Baiju M
Davor wrote: > Hi, my name is david. > I need to read information from .pdf files and convert to .txt files, > and I have to do this on python, If you have 'xpdf' installed in your system, 'pdftotext' command will be available in your system. Now to convert a pdf to text from Python use system ca

Re: TKinter

2006-06-10 Thread Chris Lambacher
GTK+ + Glade http://pygtk.org/ WxPython has several GUI editors http://wxpython.org PyQt has the ability to generate code from the Qt GUI designer http://www.riverbankcomputing.co.uk/pyqt/ I personally have used GTK+ and Glade with great success. I found WxPython to be lacking in polish. I h

Very newbie programming

2006-06-10 Thread TheSaint
Hello! Is there a more pythonic way to implement the following program: 8<--8<--8<--8<-- #! /usr/bin/env python import os import sys a = os.listdir('/media') # no mount dirs were found, exit nicely if len(a) == 0: sys.exit(0) # Maybe co

PIL problem after installation

2006-06-10 Thread Lad
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? Thank you for help L. -- http://mail.python.org/mailman/listinfo/python-list

"parent" in a class __init__ def?

2006-06-10 Thread Ray Schumacher
What is the feeling on using "parent" in a class definition that class methods can refer to, vs. some other organization ? Should all relevant objects/vars just be passed into the method as needed? It seems like including "parent" in the class def is just like a class variable, which most do not

Re: Get my airlines boarding pass

2006-06-10 Thread KenAggie
Good idea - I just bought the 2nd edition of the book and it is very good. Will check it out. Ken Alex Martelli wrote: > Ken <[EMAIL PROTECTED]> wrote: > > > rh0dium wrote: > > > Hi all, > > > > > > Has any of you fine geniuses figured out a nice python script to go to > > > the Southwest airlin

Re: "parent" in a class __init__ def?

2006-06-10 Thread Larry Bates
Ray Schumacher wrote: > What is the feeling on using "parent" in a class definition that class > methods can refer to, vs. some other organization ? > Should all relevant objects/vars just be passed into the method as needed? > It seems like including "parent" in the class def is just like a class

Re: PIL problem after installation

2006-06-10 Thread Fredrik Lundh
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 installed (see the "prerequisit

from foo imprt * in package __init__ ?

2006-06-10 Thread Ray Schumacher
What is the Pythonic-ness of using from foo imprt * in a package's __init__.py? I import my own (~8) module files in the package this way, and import standard modules with "import bar". Ray -- http://mail.python.org/mailman/listinfo/python-list

Re: convert .pdf files to .txt files

2006-06-10 Thread vasudevram
If you don't already have xpdf, you can get it here: http://glyphandcog.com/Xpdf.html Install it and then try what Baiju said, should work. I've used it, its good, that's why I say it should work. If any problems, post here again.

Re: PIL problem after installation

2006-06-10 Thread vasudevram
Probably the jpeg library - libjpeg is not present on your system. Search Google for it, then download and install it. Try http://rpmfind.net also to find it: http://rpmfind.net/linux/rpm2html/search.php?query=libjpeg&submit=Search+... But Fredrik's advice is very good - whenever installing a so

Re: Very newbie programming

2006-06-10 Thread Alexander Schmolck
TheSaint <[EMAIL PROTECTED]> writes: > # Filling the c with the list of devices which are recorded to be mounted > > d = filter((lambda a: a[:2] =='/d'),mnt.readlines()) # non /dev-mounts are > off > d = map((lambda a: a.split()[:1]),d) # only the first info column is used Just focusing one one

Re: Python-list Digest, Vol 33, Issue 159

2006-06-10 Thread Ray Schumacher
Thanks Larry, My depth can really only get to ~3: package module module error_module an usually not that. It is shallow, with >hundred methods (mainly serial protocol defs for LX* telescopes), but it could grow I suppose. I mainly see its use as an import for other, large apps. Spe

Re: Very newbie programming

2006-06-10 Thread Maric Michaud
Le Samedi 10 Juin 2006 17:44, TheSaint a écrit : > Hello! > Hi, > Is there a more pythonic way to implement the following program: I'll try to make some suggestions. > > 8<--8<--8<--8<-- > > #! /usr/bin/env python > > import os > import sys > a = os.l

Getting backtrace on an axception

2006-06-10 Thread Paolo Pantaleo
So I have this code try: do something except: do something else In the except block I need to print detailed output about the error occured, and in particular I need to read the backtrace for the line that raised the exception [then modify and print it]. I know about the exception.extrac

Re: Getting backtrace on an axception

2006-06-10 Thread Fredrik Lundh
Paolo Pantaleo wrote: > In the except block I need to print detailed output about the error > occured, and in particular I need to read the backtrace for the line > that raised the exception [then modify and print it]. >>> import traceback >>> help(traceback) -- http://mail.python.org/mail

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

2006-06-10 Thread John Salerno
Steve Holden wrote: > John Salerno wrote: >> Sorry for posting here again. I tried the wxPython list but I'm not sure >> I'm sending to the right email address! It bounced back. Besides, your >> opinions are too good to pass up. ;) >> >> My question was: >> >> I was wondering, is it recommended t

Re: Get my airlines boarding pass

2006-06-10 Thread Alex Martelli
KenAggie <[EMAIL PROTECTED]> wrote: > Good idea - I just bought the 2nd edition of the book and it is very > good. Will check it out. I'm happy that you liked the book, but I meant the online site, sorry if that wasn't clear!-) Alex -- http://mail.python.org/mailman/listinfo/python-list

USA UK CANADA AUSTRALIA Jobs With VISA Sponsorship

2006-06-10 Thread faisjobs
USA UK CANADA AUSTRALIA Jobs IT Jobs, Medical Jobs, Marketing Jobs, Engineering Jobs, Call Center Jobs, HRM Jobs, Administrative Jobs, Customer-related Jobs, Non Customer-related Jobs, and many more. Career Opportunities, Vacancies, Hiring, Job Fairs, Recruitment Agency, Employer, Manpower Pooli

Re: CONSTRUCT - Python's way of Ruby's "alias_method"

2006-06-10 Thread Ilias Lazaridis
Maric Michaud wrote: > Le Vendredi 09 Juin 2006 20:06, Ilias Lazaridis a écrit : >> the code below works, but has the limitation that I cannot import the >> syncdb_hook within "django.core.management". > > In [4]: from b import CONS > > In [5]: import b > > In [6]: b.CONS = 3 > > In [7]: CONS >

Re: Killing a thread

2006-06-10 Thread crazymykl
Fredrik Lundh wrote: > Carl J. Van Arsdall wrote: > > > Are there any plans in the future to add the capability to kill threads > > from the outside? > > it cannot be done in a portable way, so that's not very likely. > import sys, trace, threading class KThread(threading.Thread): """A subclas

Re: Killing a thread

2006-06-10 Thread Fredrik Lundh
[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.__run_backup I'm not sure using a non-p

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

2006-06-10 Thread Steve Holden
John Salerno wrote: > Steve Holden wrote: > >>John Salerno wrote: >> >>>Sorry for posting here again. I tried the wxPython list but I'm not sure >>>I'm sending to the right email address! It bounced back. Besides, your >>>opinions are too good to pass up. ;) >>> >>>My question was: >>> >>>I was

Re: Questions about extending Python...

2006-06-10 Thread malv
Redefined Horizons wrote: > I've got a third-part application that exposes a C API. I'd like to > wrap it in Python. Is there a specific forum that covers extending and > embedding Python, or are those type of questions O.K. on this list? > > Scott Huey Over the years, many posts (and questions) h

Re: Get my airlines boarding pass

2006-06-10 Thread BartlebyScrivener
>> SW air script Post it here, first, and these geniuses will improve it; then post it on ActiveState. Besides, if you post it here first, I can use it. That would be handy! Thanks, rpd -- http://mail.python.org/mailman/listinfo/python-list

Re: Allowing zero-dimensional subscripts

2006-06-10 Thread spam . noam
George Sakkis wrote: > [EMAIL PROTECTED] wrote: > > > However, I'm designing another library for > > managing multi-dimensional arrays of data. Its purpose is similiar to > > that of a spreadsheet - analyze data and preserve the relations between > > a source of a calculation and its destination. >

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

2006-06-10 Thread John Salerno
Steve Holden wrote: > There doesn't seem to be any really usable material to help beginners. A > recursive design approach seems best, breaking down each grouping, but I > have sometimes found it difficult to adapt a design to changes. > > Although I'm a big fan of open source I must confess th

Re: Questions about extending Python...

2006-06-10 Thread Fredrik Lundh
malv wrote: > Over the years, many posts (and questions) have come up on dynamically > importing and reloading modules and the inadequacy of the now available > import and reload() features. and this is related to extending Python with code from existing C libraries in exactly what way ? > Rea

Re: Killing a thread

2006-06-10 Thread Diez B. Roggisch
> Python uses the underlying OS thread implementation. It does _not_ spawn > new threads. Obviously that was meant to be "spawn processes" Diez -- http://mail.python.org/mailman/listinfo/python-list

autocomplete

2006-06-10 Thread walterigo
hello. I have been working all too hard trying to figure out how to get TextCtrlAutoComplete.py to start another word after it finishes the last word. I want it to start the autocomplete process all over again after it finishes the autocomplete process. I have striped down the program to a sma

infinite loop executed in emacs

2006-06-10 Thread yaru22
Hi. I'm using python-mode in emacs. I happened to execute the code that contains an infinite loop. The system is hung and it doesn't stop at all. lol How do I manually stop it in emacs? For Eclipse, in java programming, if i happen to fall into an infinite loop, i could juse press ctrl+c to st

Re: convert .pdf files to .txt files

2006-06-10 Thread David Boddie
Davor wrote: > Hi, my name is david. > I need to read information from .pdf files and convert to .txt files, > and I have to do this on python, > I have been looking for libraries on python and the pdftools seems to > be the solution, but I do not know how to use them well, > this is the example th

Re: infinite loop executed in emacs

2006-06-10 Thread BartlebyScrivener
Try Ctrl + Break http://tinyurl.com/qc8np -- http://mail.python.org/mailman/listinfo/python-list

NCrypt 0.6.4 - wrapper for OpenSSL

2006-06-10 Thread K.S.Sreeram
NCrypt 0.6.4 (http://tachyon.in/ncrypt/) NCrypt is a wrapper for OpenSSL built using Pyrex. Although this is the first public release, NCrypt has been under development for the last one year, and is being used in production software. The following OpenSSL features have been wrapped: - hash algori

Re: Most elegant way to generate 3-char sequence

2006-06-10 Thread James Stroud
SuperHik wrote: > James Stroud wrote: > >> SuperHik wrote: >> >>> and the winner is... :D >>> David Isaac wrote: >>> alpha = string.lowercase x=(a+b+c for a in alpha for b in alpha for c in alpha) >>> >>> >>> >>> >> >> Not necessarily vying for winner, but David's solution is highly >>

Re: Most elegant way to generate 3-char sequence

2006-06-10 Thread James Stroud
Steve Holden wrote: > James Stroud wrote: > >> Rob Cowie wrote: >> >>> Hi all, >>> >>> I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba', >>> 'abb', 'abc' etc. all the way to 'zzz'. >>> >>> How would you construct a generator to acheive this? >>> >>> A simple, working but some

Re: Most elegant way to generate 3-char sequence

2006-06-10 Thread James Stroud
Steve Holden wrote: > James Stroud wrote: > >> SuperHik wrote: >> >>> and the winner is... :D >>> David Isaac wrote: >>> >>> alpha = string.lowercase x=(a+b+c for a in alpha for b in alpha for c in alpha) >>> >>> >>> >>> >> >> Not necessarily vying for winner, but David's solution is hig

Re: Most elegant way to generate 3-char sequence

2006-06-10 Thread James Stroud
James Stroud wrote: > SuperHik wrote: > >> James Stroud wrote: >> >>> SuperHik wrote: >>> and the winner is... :D David Isaac wrote: > alpha = string.lowercase > x=(a+b+c for a in alpha for b in alpha for c in alpha) >>> >>> Not necessarily vying for

Re: Most elegant way to generate 3-char sequence

2006-06-10 Thread James Stroud
Steve Holden wrote: > James Stroud wrote: > >> SuperHik wrote: >> >>> and the winner is... :D >>> David Isaac wrote: >>> >>> alpha = string.lowercase x=(a+b+c for a in alpha for b in alpha for c in alpha) >>> >>> >>> >>> >> >> Not necessarily vying for winner, but David's solution is hig

Re: Allowing zero-dimensional subscripts

2006-06-10 Thread George Sakkis
[EMAIL PROTECTED] wrote: > George Sakkis wrote: > > [EMAIL PROTECTED] wrote: > > > > > However, I'm designing another library for > > > managing multi-dimensional arrays of data. Its purpose is similiar to > > > that of a spreadsheet - analyze data and preserve the relations between > > > a source

Algorithm for Labels like in Gmail

2006-06-10 Thread rhcarvalho
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 holding the names and phones of my contact

"parent" in a class __init__ def?

2006-06-10 Thread Ray Schumacher
Thanks Larry, My depth really only gets to ~3: package module module error_module and usually not that. It is shallow, with >hundred methods (mainly serial protocol defs for LX* telescopes), but it could grow modules, I suppose. I mainly see its use as an import for other, large ap

Re: Algorithm for Labels like in Gmail

2006-06-10 Thread Jerry
I would probably go with an SQLite database to store your information. You can have the contacts listed in a table with unique ids, then a table of labels. Finally, create a table that links one or more labels with each contact. Then you can just keep adding more labels. -- http://mail.python

Re: Algorithm for Labels like in Gmail

2006-06-10 Thread George Sakkis
[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 holdi

Re: how not to run out of memory in cursor.execute

2006-06-10 Thread mjp
[EMAIL PROTECTED] wrote: > I am using cx_Oracle and MySQLdb to pull a lot of data from some tables > and I find that the cursor.execute method uses a lot of memory that > never gets garbage collected. Using fetchmany instead of fetchall does > not seem to make any difference, since it's the execute

Re: Algorithm for Labels like in Gmail

2006-06-10 Thread Rodolfo
Hi George, George Sakkis wrote: > Google for "many-to-many relationships". In short, you have two entity > classes (say emails and labels) where each instance of one entity may > be associated to zero or more instances of the other entity. In > databases you implement this by having three tables,

Re: Algorithm for Labels like in Gmail

2006-06-10 Thread T Väntänen
Rodolfo wrote: [...] > Ok, but how can I keep my Relationship Table out of bugs, bad data?! > I wonder how i'll control the following: > 1st) Given an generic email, in which group(s) is it contained? > 2nd) Given a group, which Emails/contacts does it contain? To none perhaps? > I don't have muc

Re: More pythonic shell sort?

2006-06-10 Thread [EMAIL PROTECTED]
Thanks for the critique. John Machin wrote: > On 10/06/2006 7:00 AM, [EMAIL PROTECTED] wrote: > > Disclaimer - I recognize this is not a practical exercise. There are > > many implementations around that would do the job better, more > > efficiently (Meaning in C) or whatever. > > > > I caught so

Re: Most elegant way to generate 3-char sequence

2006-06-10 Thread [EMAIL PROTECTED]
I'm not sure if you ever got a good answer. I for one am too lazy to look up the pages I found... but - check out http://aspn.activestate.com/ASPN/search?query=combinations§ion=PYTHONCKBK&type=Subsection Tons of nice recipes... Personally I liked the one that dynamically generated a nested functi

Re: Xah Lee network abuse

2006-06-10 Thread Mallor
PofN wrote: > > Liar. You were never sorry when you troubled us with your posting > excrements in the past, you are not sorry now. > > Liar. You are a net abuser, a kook and a troll. It has nothing to do > with your writings and style. It has everything to do with your > vialoation of netiquette,

Re: Can I set timeout for the sys.stdin.readline() ?

2006-06-10 Thread Jay Parlar
On Jun 10, 2006, at 5:14 AM, ywzhan wrote: > Hi, I am new here. > When I use sys.stdin.readline() to get input string from user, > how can I set a timeout value for this operation? > thank you. > > You can do a select() on sys.stdin, and put a timeout on the select, ie: rfds, wfds, efds = selec

Re: Most elegant way to generate 3-char sequence

2006-06-10 Thread Roberto Bonvallet
2006/6/10, SuperHik <[EMAIL PROTECTED]>: > > Not necessarily vying for winner, but David's solution is highly > > specific as it doesn't do so well for something like > > > > aaa > >

learning python idioms

2006-06-10 Thread conkerll
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 in a variety of different styles

Re: Xah Lee network abuse

2006-06-10 Thread Erik Max Francis
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. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA,

Re: Xah Lee network abuse

2006-06-10 Thread Philippa Cowderoy
On Sat, 10 Jun 2006, 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. > Rather a lot depends on

Re: "parent" in a class __init__ def?

2006-06-10 Thread [EMAIL PROTECTED]
I'm not sure how it's a comparison to class variables. So I wouldn't worry about that. I think there are some advantages to having the parent as an instance member. Intuitively, the name lookup on self.parent.foo would be faster than if you passed in the object in question - although I haven't t

Re: Xah Lee network abuse

2006-06-10 Thread Erik Max Francis
Philippa Cowderoy wrote: > Rather a lot depends on which legal system you're in, for a start. > Including the standards of proof and who the onus is on. Oh, no doubt. But I don't think there's any modern legal system in which it's a crime, rather than a tort. Is there? Anyway, it's certainly

Re: Xah Lee network abuse

2006-06-10 Thread Philippa Cowderoy
On Sat, 10 Jun 2006, Erik Max Francis wrote: > Philippa Cowderoy wrote: > > > Rather a lot depends on which legal system you're in, for a start. Including > > the standards of proof and who the onus is on. > > Oh, no doubt. But I don't think there's any modern legal system in which it's > a cri

Re: Xah Lee network abuse

2006-06-10 Thread Mike Schilling
"Mallor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > 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. It all depends on whether what you > state abou

Re: Xah Lee network abuse

2006-06-10 Thread Philippa Cowderoy
On Sun, 11 Jun 2006, Mike Schilling wrote: > I'm not aware of any definition of libel that includes "making statements > that are not provably true". > I believe UK law uses one that's close to it. -- [EMAIL PROTECTED] Society does not owe people jobs. Society owes it to itself to find pe

Re: Xah Lee network abuse

2006-06-10 Thread J�rgen Exner
Mallor wrote: > I know I'm coming late to the barbeque. That's why you are missing the history > In passing, I ask: do you > have an objective, impartial perspective on the subject of committing > crimes? Because libel is a crime. It all depends on whether what you > state about Xah is provably

Re: Intermittent Failure on Serial Port

2006-06-10 Thread H J van Rooyen
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, timeout) # so bad luck - comms erro

Re: Xah Lee network abuse

2006-06-10 Thread Mike Schilling
"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 are not provably true". >> > > I believe UK law uses one that's close to it. If I we

Re: Very newbie programming

2006-06-10 Thread TheSaint
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 :-) A part of this, how python catch variables, the longer the slower, isn't it? Even supposing to use a set of s

Re: learning python idioms

2006-06-10 Thread vbgunz
> 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 in a variety > of differ

Re: Xah Lee network abuse

2006-06-10 Thread Erik Max Francis
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 he was getting at is that, unlike many jurisdictions, writing something factually true

ANN: PyGUI 1.7.2-1

2006-06-10 Thread greg
I have uploaded a new PyGUI 1.7.2 package to correct a couple of errors in the setup.py file. http://www.cosc.canterbury.ac.nz/~greg/python_gui/ - What is PyGUI? -- PyGUI is an experimental highly-Pythonic cross-platform GUI API. I

Re: Xah Lee network abuse

2006-06-10 Thread EJP
Philippa Cowderoy wrote: > I'm not aware of a current legal system where it's the case, but I don't > know the details of many of them. Many states have criminal as well as civil libel. http://en.wikipedia.org/wiki/Slander_and_libel -- http://mail.python.org/mailman/listinfo/python-list