Re: invert or reverse a string... warning this is a rant

2006-10-20 Thread Hendrik van Rooyen
"Brad" <[EMAIL PROTECTED]> wrote: > Steven D'Aprano wrote: > > > Gah!!! That's *awful* in so many ways. > > Thanks... I'm used to hearing encouragement like that. After a while you > begin to believe that everything you do will be awful, so why even > bother trying? > > > > It has been my exper

Re: invert or reverse a string... warning this is a rant

2006-10-20 Thread Simon Forman
rick wrote: ... > see that the sequence is reversed. Backwards is pure, simple and easy. > This is not so in Python and it should be. foo[::-1] isn't "pure, simple and easy"? It derives cleanly from the slice notation, it does exactly what you want, and it even works with lists and tuples and any

Re: invert or reverse a string... warning this is a rant

2006-10-20 Thread I V
On Fri, 20 Oct 2006 09:04:07 +1000, Steven D'Aprano wrote: > I agree -- the reversed() function appears to be an obvious case of purity > overriding practicality :( > str(reversed("some string")) > '' repr(reversed("some string")) > '' This doesn't seem particularly "pure" to me, either

Downloading images with python

2006-10-20 Thread Hans Olav Hygen
On 23. of October last year a the follwing was posted to this group: > htmlSource=urllib.urlopen("http://www.godandscience.org/images/nebula.jpg";) > # Read from the object, storing the page's contents in 's'. > s = htmlSource.read() > htmlSource.close() > myfile = open("myfile.jpg", "w") > myfile

RE: invert or reverse a string... warning this is a rant

2006-10-20 Thread Demel, Jeff
Paul wrote: >"".join(sum(map(list,zip(s,s[len(s)/2:])),[])) > >perhaps? Not quite as elegant as a "string.shuffle" would be, am I right? -Jeff This email is intended only for the individual or entity to which it is addressed. This email may contain information that is privileged, confidential

Re: Downloading images with python

2006-10-20 Thread Fredrik Lundh
Hans Olav Hygen wrote: > myfile = open("P:\Jobb\Prosjekt\Maanedsoversikt\myfile.jpg", "wb") > myfile.write(s) > myfile.close make that "myfile.close()" > But the images get cropped at the bottom. files are closed when the program exits (unless it does so in an uncontrolled way), so I assume yo

Convert binary image to JPEG with 72 dpi

2006-10-20 Thread Nico Grubert
Dear list members,I have the binary content of an image file and it's filename.I neither know the resolution nor the dpi of the image.No I need to convert this binary content into a 72 dpi jpeg image. Furthermore I have to resize the image so neither the width nor the height is bigger than 250 pixe

Re: invert or reverse a string... warning this is a rant

2006-10-20 Thread Kay Schluehr
> The Ruby approach makes sense to me as a human being. http://happyfuncog.blogspot.com/2006/09/confessions-of-pseudo-misanthrope.html > The Python approach is not easy for me (as a human being) to remember. I always thought we Pythonistas are already idiots but whenever I meet a Rubist it ( the

BeautifulSoup problem

2006-10-20 Thread placid
Hi all, Just wondering if anyone knows how to get the text between the tags of the following Tag object? Hello Cheers -- http://mail.python.org/mailman/listinfo/python-list

Re: invert or reverse a string... warning this is a rant

2006-10-20 Thread Fredrik Lundh
"Brad" <[EMAIL PROTECTED]> wrote: > Do you have children? How would your child feel if he brought you > something he had made and you then told him it was awful in *sooo* many > ways. If you're arguing that everything a child does and says should be rewarded, I seriously doubt that you have any.

Re: invert or reverse a string... warning this is a rant

2006-10-20 Thread Fredrik Lundh
Hendrik van Rooyen wrote: >> 'a man a plan a canal panama' is not a palindrome > > not if spaces count - which they do if you rely on a single reverse operation (my point was that it takes a bit more work than that to check for a palindrome). -- http://mail.python.org/mailman/listinfo/pyth

Re: a little about regex

2006-10-20 Thread Fulvio
On Wednesday 18 October 2006 23:05, Ant wrote: >     allow = re.compile(r'.*(?|$)')  # negative lookbehind >     if allow.search(adr): >         return True >     return False I'd point out that : allow = re.search(r'.*(?|$)',adr) Will do as yours, since the call to 're' class will do the compil

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-20 Thread Alexander Burger
Paul Rubin wrote: > There's a language called Picolisp in which this is the standard way > to do a gui. Picolisp includes a java applet that can do some stuff > that standard html widgets can't. These days I suppose it should use > AJAX. Yes, in fact it does. The curr

Re: Lead Software Engineer

2006-10-20 Thread Nicola Musatti
James Stroud wrote: > alex23 wrote: > > Emma wrote: > > > >>5. Please provide us with a comparison of the following music discovery > >> > >>sites: > >> > >>http://www.blogmusik.net > >>http://www.seeqpod.com/music > >>http://www.finetune.com > >>http://www.webjay.com > >> > >>For each of these we

I like python.

2006-10-20 Thread Fidel
I'm not a coder.. I'm just a person that trys to do things with languages he likes. Sometimes I'm successful, mostly not. I do know that before I bother a list with a silly question I should do my best to research for an answer myself. ala RTFM. That said my searches haven't found me what I am look

Re: I like python.

2006-10-20 Thread Fredrik Lundh
"Fidel" wrote: > Could someone please tell me what I need to put into a python script > to not have a window come up however briefly? assuming Windows, and assuming that you have a standard Python install for Windows: use "pyw" instead of "py" as the script's extension. (Windows applications com

new multiplayer game (made with pygame) platform

2006-10-20 Thread maxime_phan
hello we would like to make you discover a new and free multiplayer game platform: GameLAN. All game are made with pygame, we have 3 multiplayer games now (Tetris like game, Heroic fantaisy tactic game and gomoku game). We invite you on the 22th of October at 4pm (Paris Time) to discover this platf

Re: BeautifulSoup problem

2006-10-20 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, placid wrote: > Hi all, > > Just wondering if anyone knows how to get the text between the tags of > the following Tag object? > > Hello Are you looking for a way to search for tag *and* attributes? What about this:: In [12]: soup.find('span', {'class': 'nametext'})

Re: Can I use decorators to manipulate return type or create methods?

2006-10-20 Thread Diez B. Roggisch
WakeBdr schrieb: > Diez, > I get what that accomplishes now, but I'm having problems in my > implementation. I was able to write a standalone class that worked > correctly. However, in my code the class that I need to exhibit this > functionality inherits from another class. This seems to cause

Unicode support in python

2006-10-20 Thread sonald
Hi, I am using python2.4.1 I need to pass russian text into python and validate the same. Can u plz guide me on how to make my existing code support the russian text. Is there any module that can be used for unicode support in python? Incase of decimal numbers, how to handle "comma as a decimal

Re: Unicode support in python

2006-10-20 Thread Fredrik Lundh
"sonald" wrote: > I need to pass russian text into python and validate the same. > Can u plz guide me on how to make my existing code support the > russian text. > > Is there any module that can be used for unicode support in python? Python has built-in Unicode support (which you would probably

Re: Unicode support in python

2006-10-20 Thread Fredrik Lundh
>http://www.google.com/search?q=python+unicode (and before anyone starts screaming about how they hate RTFM replies, look at the search result) -- http://mail.python.org/mailman/listinfo/python-list

Why the result

2006-10-20 Thread HYRY
Why the third print stement output "'comments': [(1, 2, 3)]", I think it should be []. I am using Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32. # program class PicInfo: def __init__(self, intro="", tags="", comments=[]): self.picintro = intro s

Re: help with my first use of a class

2006-10-20 Thread Bruno Desthuilliers
BartlebyScrivener wrote: > I am a mere hobbyist. Spent several hours trying to make a class, > because I think this is an occasion where I need one. But I can't make > it work. > > This code "works" (only because of the global c, which I know I'm > supposed to avoid, by using a Class). I edited th

Re: help with my first use of a class

2006-10-20 Thread Bruno Desthuilliers
BartlebyScrivener wrote: > Whoah. At least I got the connection. I think. Maybe I can figure more > on my own. Any help appreciated. > > Thanks > > - > > class Connection: > def __init__(self, aDatasource): > self.db = aDatasource > self.conn = odbc.DriverConnect(self

Re: Why the result

2006-10-20 Thread Fredrik Lundh
"HYRY" <[EMAIL PROTECTED]> wrote: > Why the third print stement output "'comments': [(1, 2, 3)]", I think > it should be []. default arguments are calculated once. for details, see the tutorial http://docs.python.org/tut/node6.html#SECTION00671 and the FAQ: http://pyfaq.in

Re: help with my first use of a class

2006-10-20 Thread Fredrik Lundh
Bruno Desthuilliers wrote: > First, notice that you *don't* need a class here to avoid globals. > Learning to use function as *functions* (ie: taking arguments and > returning values) instead of procedure would help: > > def random_quote(cursor): > c.execute ("SELECT COUNT(Quote) FROM PythonQuote

Re: Why the result

2006-10-20 Thread Bruno Desthuilliers
HYRY wrote: > Why the third print stement output "'comments': [(1, 2, 3)]", I think > it should be []. > I am using > Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] > on win32. > > # program > class PicInfo: > def __init__(self, intro="", tags="", comments=[]): This is

Re: Flexible Collating (feedback please)

2006-10-20 Thread Leo Kislov
Ron Adam wrote: > Leo Kislov wrote: > > Ron Adam wrote: > > > >> locale.setlocale(locale.LC_ALL, '') # use current locale settings > > > > It's not current locale settings, it's user's locale settings. > > Application can actually use something else and you will overwrite > > that. You can also af

Webprogr: Link with automatic submit

2006-10-20 Thread Gregor Horvath
Hi, As I am no expert web programmer I thought I'd better ask the experts if there is a simpler or better solution to my problem than the one I am thinking of. (using TurboGears) The problem --- I have a form. Ok. you can submit, validate it etc. Now I have a link on that form to another

Re: comparing Unicode and string

2006-10-20 Thread Leo Kislov
[EMAIL PROTECTED] wrote: > Thanks, John and Neil, for your explanations. > > Still I find it rather difficult to explain to a Python beginner why > this error occurs. > > Suggestion: shouldn't an error raise already when I try to assign s2? A > normal string should never be allowed to contain char

Re: comparing Unicode and string

2006-10-20 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Suggestion: shouldn't an error raise already when I try to assign s2? variables are not typed in Python. plain assignment will never raise an exception. -- http://mail.python.org/mailman/listinfo/python-list

Re: right curly quote and unicode

2006-10-20 Thread Leo Kislov
On 10/19/06, TiNo <[EMAIL PROTECTED]> wrote: > Now I know where the problem lies. The character in the actual file path is > u+00B4 (Acute accent) and in the Itunes library it is u+2019 (a right curly > quote). Somehow Itunes manages to make these two the same...? > > As it is the only file that ga

list2str and performance

2006-10-20 Thread spr
Hi, I'm trying to learn Python and I'd appreciate any comments about my small snippets of code. I read an old anecdote about performance here: http://www.python.org/doc/essays/list2str/ First, I tried to figure out what would be the most pythonic approach by today's standards: def ListToStr(l)

Re: list2str and performance

2006-10-20 Thread Fredrik Lundh
"spr" wrote: > When performance matters and you have to develop a CPU-bound > application, do you think it is possible to eventually achieve nearly > the best performance by extending Python with C or C++ modules, or is it > better to take the embedding approach, that is, use a C or C++ core that

RE: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-20 Thread Matthew Warren
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > rg] On Behalf Of Fredrik Lundh > Sent: 20 October 2006 06:43 > To: python-list@python.org > Subject: Re: Tkinter--does anyone use it for sophisticated > GUI development? > > Kevin Walzer wrote: > > > Comi

Re: BeautifulSoup problem

2006-10-20 Thread placid
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, placid wrote: > > > Hi all, > > > > Just wondering if anyone knows how to get the text between the tags of > > the following Tag object? > > > > Hello > > Are you looking for a way to search for tag *and* attributes? What about > this:: >

Re: Webprogr: Link with automatic submit

2006-10-20 Thread Bruno Desthuilliers
Gregor Horvath wrote: > Hi, > > As I am no expert web programmer I thought I'd better ask the experts if > there is a simpler or better solution to my problem than the one I am > thinking of. (using TurboGears) > > The problem > --- > > I have a form. Ok. you can submit, validate it etc.

Re: help with my first use of a class

2006-10-20 Thread Bruno Desthuilliers
Fredrik Lundh wrote: > Bruno Desthuilliers wrote: > >> First, notice that you *don't* need a class here to avoid globals. >> Learning to use function as *functions* (ie: taking arguments and >> returning values) instead of procedure would help: >> >> def random_quote(cursor): >> c.execute ("SELEC

RE: [Tutor] How to get the width of teh button widget..??

2006-10-20 Thread Matthew Warren
    Folks,   Sorry for asking you such a trivial question.!!! But i want to size up all the buttons with the same size as the largest one in the interface.. And thats why I am asking this question..   Regards, Asrarahmed      Hi Asrarahmed.  I think, from yo

python under the hood

2006-10-20 Thread tpochep
Hello. Is there any good information about python's internals and semantic? I mean "under the hood". For example, I want to understant what do these strings x = 10 y = 10 x = 20 mean (memory allocation for object? ctors? etc.) Unfortynatly, I'm too lazy to read python's source code :) (and I gue

Logging with Logger hierarchies

2006-10-20 Thread Robert
Hi all I have been trying to set up a framework with logging implemented using the built in Python logging module. For better or worse, I have decided to base the logger names on the module names. This means that I am using multiple layers of name, eg logging.getLogger("a.b.c"). I am also using lo

Re: python under the hood

2006-10-20 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Is there any good information about python's internals and semantic? I > mean "under the hood". > For example, I want to understant what do these strings > > x = 10 > y = 10 > x = 20 > > mean (memory allocation for object? ctors? etc.) reading this might help: http

Re: invert or reverse a string... warning this is a rant

2006-10-20 Thread rick
Fredrik Lundh wrote: > "Brad" <[EMAIL PROTECTED]> wrote: > >> Do you have children? How would your child feel if he brought you >> something he had made and you then told him it was awful in *sooo* many >> ways. > > If you're arguing that everything a child does and says should be rewarded... I

Re: wxPython and PIL

2006-10-20 Thread Odalrick
Thanks for the answer. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode support in python

2006-10-20 Thread sonald
Fredrik Lundh wrote: > >http://www.google.com/search?q=python+unicode > > (and before anyone starts screaming about how they hate RTFM replies, look > at the search result) > > Thanks!! but i have already tried this... and let me tell you what i am trying now... I have added the following li

Re: Book about database application development?

2006-10-20 Thread Wolfgang Keller
>> does anyone know of a good book that about development of database >> applications? > > Scott Ambler's "Agile Database Techniques" Thanks for the hint, the summaries indicate that this one could be very useful indeed. Sincerely, Wolfgang Keller -- My email-address is correct. Do NOT remo

list comprehension (searching for onliners)

2006-10-20 Thread Gerardo Herzig
Hi all: I have this list thing as a result of a db.query: (short version) result = [{'service_id' : 1, 'value': 10}, {'service_id': 2, 'value': 5}, {'service_id': 1, 'value': 15}, {'service_id': 2, 'value': 15}, ] and so on...what i need

Re: python under the hood

2006-10-20 Thread A.T.Hofkamp
On 2006-10-20, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello. > > Is there any good information about python's internals and semantic? I > mean "under the hood". Not exactly 'under the hood', but very close is the Python/C API. You can learn a great deal by reading the Extending&Embedding m

RE: invert or reverse a string... warning this is a rant

2006-10-20 Thread Duncan Booth
"Demel, Jeff" <[EMAIL PROTECTED]> wrote: > I've been programming professionally for over 10 years, and have never > once needed to reverse a string. Maybe it's a lack of imagination on my > part, but I can't think of a single instance this might be necessary. I did want to reverse some strings o

Re: help with my first use of a class

2006-10-20 Thread BartlebyScrivener
Thanks, Bruno. Very educational. rd Bruno Desthuilliers wrote: > Think of a class as both a "blueprint" for objects and a factory > creating these objects. The class lets you define the attributes and > behaviors of it's instances. > > First, notice that you *don't* need a class here to avoid gl

Re: help with my first use of a class

2006-10-20 Thread BartlebyScrivener
Thank you all! My main problem is going away from Python and programming for weeks or months at a time, then picking up where I left off. But Python is much better in this regard than Perl. I appreciate the help. rd - Dennis Lee Bieber wrote: > If using a db-api compliant ada

Re: list comprehension (searching for onliners)

2006-10-20 Thread Max Erickson
Gerardo Herzig <[EMAIL PROTECTED]> wrote: > Hi all: I have this list thing as a result of a db.query: (short > version) result = [{'service_id' : 1, 'value': 10}, > {'service_id': 2, 'value': 5}, > {'service_id': 1, 'value': 15}, > {'service_id': 2,

Re: Integration of globalization data in Python web frameworks

2006-10-20 Thread GinTon
The project web is activated http://webda.python-hosting.com/ GinTon wrote: > I have created several tables in CSV format with globalization data > (G11n). There are tables for countries, areas, languages, countries & > languages, time zones, phones. And they are licensed under a Creative > Common

Re: list comprehension (searching for onliners)

2006-10-20 Thread Tim Chase
> result = [{'service_id' : 1, 'value': 10}, > {'service_id': 2, 'value': 5}, > {'service_id': 1, 'value': 15}, > {'service_id': 2, 'value': 15}, > ] > > and so on...what i need to do is some list comprehension that returns me > somethi

Re: Unicode support in python

2006-10-20 Thread Diez B. Roggisch
sonald schrieb: > Fredrik Lundh wrote: >>>http://www.google.com/search?q=python+unicode >> (and before anyone starts screaming about how they hate RTFM replies, look >> at the search result) >> >> > Thanks!! but i have already tried this... Tried - might be. But you certainly didn't understan

Re: Unicode support in python

2006-10-20 Thread Fredrik Lundh
"sonald" wrote: > I have added the following line in the script > > # -*- coding: utf-8 -*- that's good. > I have also modified the site.py that's bad, because this means that your code won't work on standard Python installations. > Now when I try to validate the data in the text file > say ab

Re: advice for web-based image annotation

2006-10-20 Thread Brian Blais
Paul Rubin wrote: > Brian Blais <[EMAIL PROTECTED]> writes: >> I want to set up a system where I can have my family members write >> comments about a number of pictures, as part of a family tree project. >> ...Any suggestions would be greatly appreciated! > > How about a wiki? So I thought about

Re: list comprehension (searching for onliners)

2006-10-20 Thread Jon Clements
Gerardo Herzig wrote: > Hi all: I have this list thing as a result of a db.query: (short version) > result = [{'service_id' : 1, 'value': 10}, > {'service_id': 2, 'value': 5}, > {'service_id': 1, 'value': 15}, > {'service_id': 2, 'value': 15}, >

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-20 Thread Kevin Walzer
James Stroud wrote: > Also, look at my modest program at passerby.sf.net. > Not so sophisticated, but not completely simple either. > I did look at passerby--a nice app, and in a native Mac OS X version also! (I'm a Mac developer.) Thanks for the pointer. -- Kevin Walzer Poetic Code http://www

Re: advice for web-based image annotation

2006-10-20 Thread Paul Rubin
Brian Blais <[EMAIL PROTECTED]> writes: > > How about a wiki? > > So I thought about a wiki (again having no experience there > either...sigh). You can put images in a wiki? I had a quick look > at pytw, but haven't had the time to really dive into it to see if I > could get it going, and if it

Re: python module for finite element program

2006-10-20 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Hello, > > Is there any add on python modules suitable for finite element 3D mesh > such as to create (beam, plate, etc) ? > > Best Regards, > ajikoe > Google is your friend: http://www.python.org/pycon/papers/pysparse.html http://sourceforge.net/projects/feval/ http

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-20 Thread Kevin Walzer
Fredrik Lundh wrote: > > on the other hand, such wrappers are usually extremely simple, and the > mapping between Python and Tk is trivial. there's simply not much to > add to the existing Tk module docs. I think I might simply have to bite the bullet, actually use some of these documented wrap

Re: Can I use decorators to manipulate return type or create methods?

2006-10-20 Thread WakeBdr
OK, I think I'm close now. I just can't get past this one error. Here is my code, followed by the output produced when I run it. class Magic(type): def __new__(cls, name, bases, d): for name, function in d.items(): try:

FTP over SSL

2006-10-20 Thread Tor Erik Soenvisen
Hi, Anyone know about existing code supporting FTP over SSL? I guess pycurl http://pycurl.sourceforge.net/ could be used, but that requires knowledge of libcurl, which I haven't. regards -- http://mail.python.org/mailman/listinfo/python-list

Re: Logging with Logger hierarchies

2006-10-20 Thread Vinay Sajip
> I delved in the code and found that when my logger "a.b.c" is created, > it doesn't create Loggers for "a.b" or "a" but rather instances of a > PlaceHolder class. If I actually call logging.getLogger("a.b") and > logging.getLogger("a") then the PlaceHolders get converted to Loggers > and the hie

Re: invert or reverse a string... warning this is a rant

2006-10-20 Thread Tim N. van der Leeuw
I V wrote: > On Fri, 20 Oct 2006 09:04:07 +1000, Steven D'Aprano wrote: > > I agree -- the reversed() function appears to be an obvious case of purity > > overriding practicality :( > > > str(reversed("some string")) > > '' > repr(reversed("some string")) > > '' > > This doesn't seem par

Re: Can I use decorators to manipulate return type or create methods?

2006-10-20 Thread Diez B. Roggisch
WakeBdr schrieb: OK, I think I'm close now. I just can't get past this one error. Here is my code, followed by the output produced when I run it. Stupid mistake of me - I didn't properly create a closure for the functions to set. See the corrected version in the attachment. Diez test2.py

Re: invert or reverse a string... warning this is a rant

2006-10-20 Thread Fredrik Lundh
Tim N. van der Leeuw wrote: > In practice, the short-term fix would be to add a __str__ method to the > 'reversed' object so what should str(reversed(range(10))) do ? > and perhaps to all iterators too (so that trying to build a string from an > iterator would do the obvious thing). all i

User Access to the docstring of a property

2006-10-20 Thread Colin J. Williams
Is there some way that the user can access the docstring specified for a property? Please see the example below: # propDocTest class A(object): def __init__(self, value): self.value= value def vGet(self): return self.value V= property (fget= vGet, doc="Get Value.") a= A(22) p

Re: [OT] a little about regex

2006-10-20 Thread Fulvio
On Friday 20 October 2006 02:40, Ron Adam wrote: > I see, is this a cleanup script to remove the least wanted items? Yes. Probably will remain in this mode for a while. I'm not prepaired to bring out a new algorithm > Or is it a bit of both?  Why the score? As exposed on another post. There shou

Re: I would like write some data recovery software

2006-10-20 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** On Friday 20 October 2006 07:29, gel wrote: > > Once you get a way to access the bytes to recover... the Hachoir library > > can be interresting as a model to map structures on these data. > > > >   h

Re: help with my first use of a class

2006-10-20 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** On Friday 20 October 2006 14:34, James Stroud wrote: > You really don't need classes for this I'm in that matter too. Doesn't classes make the main program neater? Fundamentally OOP is the way to assembl

Use I the classes?

2006-10-20 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** Hello, I'm used to put up programs (small right now), but I could find the only way to define some functions. I'm interested to split some function into class, but I don't have know-how for these beast

Re: User Access to the docstring of a property

2006-10-20 Thread Diez B. Roggisch
Colin J. Williams schrieb: > Is there some way that the user can access the docstring specified for a > property? You need to access it using the class, not an instance of it. class Foo(object): @apply def prop(): def fget(self): return 10 def fset(self,

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-20 Thread Christophe
Kevin Walzer a écrit : > Am I better off biting the bullet and learning wxPython--a different GUI > paradigm to go with the new language I'm trying to learn? I had hoped to > reduce my learning curve, but I'm very concerned that I simply can't do > what I want to do with Tkinter. What do other Tkin

Re: Logging with Logger hierarchies

2006-10-20 Thread Robert
Hi again I have seen my error! I was mistakenly occasionally creating the logger using logger = logging.Logger("a.b.c") instead of logger = logging.getLogger("a.b.c") Doh. I miss my private constructors to save me from such embarrasment ;^) Cheers Robert -- http://mail.python.org/mailman/li

FOR statement

2006-10-20 Thread Lad
If I have a list Mylist=[1,2,3,4,5] I can print it for i in Mylist: print i and results is 1 2 3 4 5 But how can I print it in a reverse order so that I get 5 4 3 2 1 ? Thanks. L -- http://mail.python.org/mailman/listinfo/python-list

Re: Use I the classes?

2006-10-20 Thread BartlebyScrivener
Fulvio wrote: > Looking for documents (free download) which clearly explain the way of > programming python classes and lots of examples as a bonus. http://www.freenetpages.co.uk/hp/alan.gauld/ On the frames page, go down to "Advanced Topics" and "Object Oriented Programming" And from the other

Re: FOR statement

2006-10-20 Thread Christophe
Lad a écrit : > If I have a list > > Mylist=[1,2,3,4,5] > I can print it > > for i in Mylist: >print i > > and results is > 1 > 2 > 3 > 4 > 5 > > > But how can I print it in a reverse order so that I get > 5 > 4 > 3 > 2 > 1 > > > > ? > > > Thanks. > L > for i in reversed(Mylist):

Re: list comprehension (searching for onliners)

2006-10-20 Thread Gerardo Herzig
You are the man, you are the man!! Yes, i need those dicts in order to assign them to a nested for the htmltmpl templating engine. Thats why i cant use the solution provided by Max, and thanks to Jon too!! Thanks a lot dudes, i hope someday ill turn myself into some of you guys who can actually

Re: list comprehension (searching for onliners)

2006-10-20 Thread Paul Rubin
Gerardo Herzig <[EMAIL PROTECTED]> writes: > You are the man, you are the man!! Yes, i need those dicts in order to > assign them to a nested for the htmltmpl templating > engine. Thats why i cant use the solution provided by Max, and thanks > to Jon too!! I'm confused, can't you write a multi-li

Re: FOR statement

2006-10-20 Thread [EMAIL PROTECTED]
Lad wrote: > If I have a list > > Mylist=[1,2,3,4,5] > I can print it > > for i in Mylist: >print i > > and results is > 1 > 2 > 3 > 4 > 5 > > > But how can I print it in a reverse order so that I get > 5 > 4 > 3 > 2 > 1 > > > > ? > > > Thanks. > L reverse the list in place with reverse meth

Re: list comprehension (searching for onliners)

2006-10-20 Thread Fredrik Lundh
Gerardo Herzig wrote: > Thanks a lot dudes, i hope someday ill turn myself into some of you guys > who can actually answer questions ;) if you want to become a good Python programmer, you really need to get over that "I need a oneliner" idea. -- http://mail.python.org/mailman/listinfo/pyth

Re: list comprehension (searching for onliners)

2006-10-20 Thread Roberto Bonvallet
Gerardo Herzig wrote: [...] > and so on...what i need to do is some list comprehension that returns me > something like [...] You don't _need_ a list comprehension, you just _want_ one :) [...] > Ill keeping blew off my hair and drinking more cofee while searching for > this damn onliner im loo

Re: proper format for this database table

2006-10-20 Thread John Salerno
[EMAIL PROTECTED] wrote: > you should rethink it as > > [id] [university] [yearStart] [yearEnd] [degreeEarned] > 1 U of I 19711975 BS > 1 U of I 19751976 MS > 1 U of I 19761977 PhD > Thanks guys. I do plan to have an id entry

Re: proper format for this database table

2006-10-20 Thread John Salerno
Bruno Desthuilliers wrote: > John Salerno a écrit : >> Hi guys. I was wondering if someone could suggest some possible >> structures for an "Education" table in a database. > > Wrong newsgroup, then. comp.database.* is right next door... > I know, I'm sorry. It's just that this newsgroup serve

Re: python module for finite element program

2006-10-20 Thread google
This isn't a python module, but python is embedded in the environment http://salome-platform.org/ Also check out http://www.caelinux.com/CMS/ for a live distro that contains several FE applications. Andy -- http://mail.python.org/mailman/listinfo/python-list

Re: python under the hood

2006-10-20 Thread John Salerno
[EMAIL PROTECTED] wrote: > Hello. > > Is there any good information about python's internals and semantic? I > mean "under the hood". > For example, I want to understant what do these strings > > x = 10 > y = 10 > x = 20 > > mean (memory allocation for object? ctors? etc.) > Unfortynatly, I'm to

Re: Unicode support in python

2006-10-20 Thread John Roth
sonald wrote: > Hi, > I am using python2.4.1 > > I need to pass russian text into python and validate the same. > Can u plz guide me on how to make my existing code support the > russian text. > > Is there any module that can be used for unicode support in python? > > Incase of decimal numbers, h

Re: invert or reverse a string... warning this is a rant

2006-10-20 Thread Carl Banks
[EMAIL PROTECTED] wrote: > The extended slice notation comes from the > numeric community though where they are probably all former FORTRAN > programmers. I think the concept of start, stop, step (or stride?) is > pretty common there. Yep. I do a bit of numerical work and the meaning of abc[::-

Re: help with my first use of a class

2006-10-20 Thread Bruno Desthuilliers
Fulvio wrote: > *** > Your mail has been scanned by InterScan MSS. > *** > > > On Friday 20 October 2006 14:34, James Stroud wrote: >> You really don't need classes for this > > I'm in that matter too. Doesn't classes make the main program neater? Depends

Using Python scripts in Windows Explorer

2006-10-20 Thread Ben Sizer
I'd like to be able to drag a file onto a Python script in Windows Explorer, or send that file to the script via the Send To context-menu option, so I can then process that file via sys.argc. Unfortunately, I can't drag items onto the Python script, because Windows doesn't recognise that the scrip

Python decorator article

2006-10-20 Thread gole
Hello, I am writing to point interested readers to a few short articles on decorators: Please find them here: http://muharem.wordpress.com/2006/10/18/3/ Best regards -- Muharem -- http://mail.python.org/mailman/listinfo/python-list

Re: invert or reverse a string... warning this is a rant

2006-10-20 Thread Carl Banks
Demel, Jeff wrote: > I've been programming professionally for over 10 years, and have never > once needed to reverse a string. Maybe it's a lack of imagination on my > part, but I can't think of a single instance this might be necessary. Say you're using a function from a third-party library tha

Re: proper format for this database table

2006-10-20 Thread Carsten Haese
On Fri, 2006-10-20 at 10:57, John Salerno wrote: > [EMAIL PROTECTED] wrote: > > > you should rethink it as > > > > [id] [university] [yearStart] [yearEnd] [degreeEarned] > > 1 U of I 19711975 BS > > 1 U of I 19751976 MS > > 1 U of I 1976

Re: list comprehension (searching for onliners)

2006-10-20 Thread Carsten Haese
On Fri, 2006-10-20 at 10:53, Fredrik Lundh wrote: > if you want to become a good Python programmer, you really need to get > over that "I need a oneliner" idea. +1 QOTW -Carsten -- http://mail.python.org/mailman/listinfo/python-list

Re: User Access to the docstring of a property

2006-10-20 Thread georgeryoung
Colin J. Williams wrote: > Is there some way that the user can access the docstring specified for a > property? Do keep in mind that the docstring is not guaranteed to be available. If the application is run with optimization turned on, docstrings are usually optimized out. Docstrings are handy

Re: FOR statement

2006-10-20 Thread Grant Edwards
On 2006-10-20, Lad <[EMAIL PROTECTED]> wrote: > If I have a list > > Mylist=[1,2,3,4,5] [...] > But how can I print it in a reverse order so that I get > 5 > 4 > 3 > 2 > 1 Another option: >>> Mylist=[1,2,3,4,5] >>> for i in Mylist[::-1]: ... print i ... 5 4 3 2 1 But, I think the reversed(

Re: proper format for this database table

2006-10-20 Thread Neil Cerutti
On 2006-10-20, John Salerno <[EMAIL PROTECTED]> wrote: > Bruno Desthuilliers wrote: >> John Salerno a écrit : >>> Hi guys. I was wondering if someone could suggest some possible >>> structures for an "Education" table in a database. >> >> Wrong newsgroup, then. comp.database.* is right next door

  1   2   3   >