Re: Parsing numeric ranges

2011-02-25 Thread Simon Brunning
On 25 February 2011 09:27, Seldon wrote: > Hi all, > I have to convert integer ranges expressed in a popular "compact" notation > (e.g. 2, 5-7, 20-22, 41) to a the actual set of numbers (i.e. > 2,5,7,20,21,22,41). > > Is there any library for doing such kind of things or I have to write it > from

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Simon Brunning
On 9/28/05, could ildg <[EMAIL PROTECTED]> wrote: > Python is wonderful except that it has no real private and protected > properties and methods. > Every py object has dict so that you can easily find what fields and methods > an obj has, > this is very convenient, but because of this, py is very

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Simon Brunning
On 9/28/05, Simon Brunning <[EMAIL PROTECTED]> wrote: > My convention, attributes with names prefixed with a single underscore > are private. There's nothing to stop anyone using these, but, well, if > you take the back off the radio, the warranty is void. *By* convention,

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Simon Brunning
On 9/28/05, Tony Meyer <[EMAIL PROTECTED]> wrote: > I'm not sure why I haven't seen this mentioned yet, but a leading > double-underscore does really make a member private: I thought about it, but I didn't mention it in the end because this feature ("name mangling") isn't intended as a mechanism f

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Simon Brunning
On 28 Sep 2005 05:06:50 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > > Do you know any language that has real private and protected attributes? > > Java? Oh, there are ways around private and protected, even in Java. CGLIB spings to mind

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Simon Brunning
On 9/28/05, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > If *real* private and protected are *enforced*, Python will be the > > poorer for it. See > > . > > That's a wonderful, if long, essay. That's the Martellibot for you. N

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Simon Brunning
On 28 Sep 2005 05:35:25 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > I don't see anything on the CGLIB web page (in about 1 minute of > looking) that says it can get around private and protected. It looks > like something that disassembles class files and reassembles them into > new

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Simon Brunning
On 9/28/05, Tony Meyer <[EMAIL PROTECTED]> wrote: > That's not what the documentation says: So, either the docs are wrong, or I am. You be the judge. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread Simon Brunning
On 9/29/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > What if the access to that variable was forbidden for reasons you never > foresaw? What if the class author decide to remove the variable in the next > version of the class, because it's not an interface, but only a part of the > class impl

Re: A rather unpythonic way of doing things

2005-09-29 Thread Simon Brunning
On 9/29/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > "fraca7" wrote: > > > print ''.join(map(lambda x: chrord(x) - ord('a')) + 13) % 26) + > > ord('a')), 'yvfc')) > > that's spelled > > print "yvfc".decode("rot-13") > > or, if you prefer, > > print "yvfc".encode("rot-13") > > , in co

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread Simon Brunning
On 9/29/05, could ildg <[EMAIL PROTECTED]> wrote: > **Encapsulation** is one of the 3 basic characteristics of OOP. Pyhton has encapsulation. On objetcts members are encapsulated in a namespace all of its own. You can't change these by accident. > Every programmer is just a human being, but not

Re: Python <=> Excel question

2005-09-30 Thread Simon Brunning
On 9/30/05, Gerry Blais <[EMAIL PROTECTED]> wrote: > Finally, how can I, in Python, make a .txt version of a Word document? http://www.brunningonline.net/simon/blog/archives/001299.html -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mai

Re: updating local()

2005-10-06 Thread Simon Brunning
On 6 Oct 2005 05:55:14 -0700, Flavio <[EMAIL PROTECTED]> wrote: > Now what would you do if you wanted to pass a lot of variables (like a > thousand) to a function and did not wanted the declare them in the > function header? I'd think twice. If on reflection I decided I really wanted to do it, I'd

Re: updating local()

2005-10-06 Thread Simon Brunning
On 6 Oct 2005 07:04:08 -0700, Flavio <[EMAIL PROTECTED]> wrote: > I know I could pass these variables around as: > > def some_function(**variables): > ... > > some_function(**variables) > > but its a pain in the neck to have to refer to them as > variables['whatever']... > > dont you think? Er

Re: [Info] PEP 308 accepted - new conditional expressions

2005-10-07 Thread Simon Brunning
On 07/10/05, Eric Nieuwland <[EMAIL PROTECTED]> wrote: > Ever cared to check what committees can do to a language ;-) +1 QOTW. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: how to(can we ?) pass argument to .py script ?

2005-10-11 Thread Simon Brunning
On 11 Oct 2005 07:07:44 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > i wrote a .py file and it works fine, my goal is to pass argument to > that py file when it get executed, and accept that argument within py > file, eg. i prefer a command like below: > > python test.py -t > > and then, i

Re: slots? SLOTS?

2005-10-12 Thread Simon Brunning
On 12/10/05, tin gherdanarra <[EMAIL PROTECTED]> wrote: > what is a "slot" in python? -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-19 Thread Simon Brunning
On 19/10/05, James Stroud <[EMAIL PROTECTED]> wrote: > The OP is obviously a troll. Hey - let's not throw the T word around quite so freely. The OP did say that he was switching to Windows "for unfortunate reasons", and that OSX was "not as bad" as Windows. Besides, it is possible to prefer Windo

Re: Python variables are bound to types when used?

2005-10-19 Thread Simon Brunning
On 19 Oct 2005 12:51:02 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > So I want to define a method that takes a "boolean" in a module, eg. > > def getDBName(l2): > ... > > Now, in Python variables are bound to types when used, right? Python doesn't really have variables as such. It has obj

Re: Accessing a dll from Python

2005-10-21 Thread Simon Brunning
On 21/10/05, Grant Edwards <[EMAIL PROTECTED]> wrote: > Sorry, I've no clue about anything VB-related unless it's > Victoria Bitter. +1 QOTW. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: syntax question - if 1:print 'a';else:print 'b'

2005-10-27 Thread Simon Brunning
On 27/10/05, Gregory Piñero <[EMAIL PROTECTED]> wrote: > So much for writing my whole program on one line :-( http://www.unixuser.org/~euske/pyone/ But you didn't hear it from me, OK? ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/

Re: Python and DevTrack?

2005-11-02 Thread Simon Brunning
On 1 Nov 2005 10:57:29 -0800, warpcat <[EMAIL PROTECTED]> wrote: > I'm a python nubie, so be gental. I've been setting up functionality > by managing my Perforce clientspec with python (since it seems all of > P4's commands are avaliable at the prompt), and I'd love to get access > to DevTrack in

Re: Python's website does a great disservice to the language

2005-11-02 Thread Simon Brunning
On 02/11/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > a version of Paint that works on a Mac, an obstreperous mentality, > and a sense of humour. what else do you need? Biscuits. You need biscuits. Treating-this-thread-as-seriously-as-it-deserves-ly y'rs, Simon B. -- http://mail.python.org/ma

Re: Pythonwin - Word automation - Removing watermark not working

2005-11-05 Thread Simon Brunning
On 04/11/05, Gregory Piñero <[EMAIL PROTECTED]> wrote: > Is there a different group/mailing list I should try? Does anyone know if > there is a pythonwin group/list for example? There is: . -- Cheers, Simon B, [EMAIL PROTECTED], http://www.br

Re: Addressing the last element of a list

2005-11-08 Thread Simon Brunning
On 8 Nov 2005 01:43:43 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > But if lst[42]["pos"] happens to hold an integer value, then > > a = lst[42]["pos"] > > will _copy_ that integer value into 'a', right? Nope. It will bind the name 'a' to the integer object. > Changing 'a' will not > cha

Re: what the %?....

2005-11-08 Thread Simon Brunning
On 07/11/05, john boy <[EMAIL PROTECTED]> wrote: > Hey can somebody tell me what the "%" function does...I am not math > illiterate...its just a new symbol for meis it a divisor? remainder > something another?? For numeric values, it's the modulo operator - see

Re: Pywin32: How to import data into Excel?

2005-11-08 Thread Simon Brunning
On 08/11/05, Dmytro Lesnyak <[EMAIL PROTECTED]> wrote: > I need to import some big data into Excel from my Python script. I have TXT > file (~7,5 Mb). Have you considered converting your text data to CSV format? Excel opens CSV files happily enough, and you could always automate save-as-workbook a

Re: any python module to calculate sin, cos, arctan?

2005-11-08 Thread Simon Brunning
On 08/11/05, Shi Mu <[EMAIL PROTECTED]> wrote: > any python module to calculate sin, cos, arctan? I seem to be posting loads of links to the docs today... -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mai

Re: Sorting Documentation

2005-11-08 Thread Simon Brunning
On 8 Nov 2005 02:27:29 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I want to read a little bit about sorting in Python (sorted() and > method sort()). But I can't seem to find anything in the documentation > at the homepage? Sorted() is documented here -

Re: Sorting Documentation

2005-11-08 Thread Simon Brunning
On 8 Nov 2005 02:32:44 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > For example, where can I find the official documentation on the > list.sort() method? -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ --

Re: output question 1

2005-11-10 Thread Simon Brunning
On 10/11/05, leewang kim <[EMAIL PROTECTED]> wrote: > I wrote the following code and got the output: > a 13 0 > None > b 81 3 (snip) > where are those 'none' from? and how can I remove them? > > class Point: > def __init__(self,x,y,name): > self.x = x > self.y = y > se

Re: Is there a built-in method for transforming (1, None, "Hello!") to 1, None, "Hello!"?

2005-11-11 Thread Simon Brunning
On 11 Nov 2005 07:21:46 -0800, Daniel Crespo <[EMAIL PROTECTED]> wrote: > Is there a built-in method for transforming (1,None,"Hello!") to > 1,None,"Hello!"? There's no conversion to do: >>> (1,None,"Hello!") (1, None, 'Hello!') >>> 1,None,"Hello!" (1, None, 'Hello!') They are both tuples contin

Re: Python Countdown

2005-11-11 Thread Simon Brunning
On 11/11/05, john boy <[EMAIL PROTECTED]> wrote: > I am running the following program from the example in "how to think like a > computer scientist" > > def countdown(n): > if n ==0: >print "Blastoff!" > else: > print n > countdown (n-1) > > countdown (10

Re: Python Countdown

2005-11-11 Thread Simon Brunning
On 11/11/05, john boy <[EMAIL PROTECTED]> wrote: > I have adjusted the program to: > > import sys. > sys. getrecursionlimit() > sys.setrecursionlimit(2000) > def countdown (n): >if n ==0: >print "blastoff" > else: > print n > countdown (n-1) > countdown

Re: string help

2005-11-15 Thread Simon Brunning
On 14/11/05, john boy <[EMAIL PROTECTED]> wrote: > using the following program: > > prefixes = "JKLMNOPQ" > suffix = "ack" > for letter in prefixes: > print letter + suffix > if prefixes == "O" or "Q" Here you need: if prefixes == "O" or prefixes == "Q" >print letter + "u" + suf

Re: Is Python worth it??

2005-11-15 Thread Simon Brunning
On 14/11/05, john boy <[EMAIL PROTECTED]> wrote: > I have started out trying to learn Python for my first programming language. > I am starting off with the book "how to think like a computer scientist." > I spend about 4-5 hrs a day trying to learn this stuff. It is certainly no > easy task. I'

Re: how to think like a computer scientist

2005-11-15 Thread Simon Brunning
On 14/11/05, john boy <[EMAIL PROTECTED]> wrote: > Does anyone know if there is an "answer key" to all of the exercises in "how > to think like a computer scientist"sure would be a lot easier to refer > to that instead of tying up this forum with questions about exercises I'm > sure that have b

Re: compare list

2005-11-15 Thread Simon Brunning
On 15/11/05, Shi Mu <[EMAIL PROTECTED]> wrote: > it does not work. > >>> len(set(lisA).intersection(set(lisB))) == 2 > Traceback (most recent call last): > File "", line 1, in ? > NameError: name 'set' is not defined 'set' is introduced as a built-in at Python 2.4. If you have 2.3, there's an an

Re: compare list

2005-11-15 Thread Simon Brunning
On 15/11/05, Shi Mu <[EMAIL PROTECTED]> wrote: > Yes, i am using python 2.3, > I have used from sets import * > but still report the same error: > > > Traceback (most recent call last): > > > File "", line 1, in ? > > > NameError: name 'set' is not defined I said analogous, not identical. try (u

Re: compare list

2005-11-15 Thread Simon Brunning
On 15/11/05, Ben Bush <[EMAIL PROTECTED]> wrote: > an error reported: > Traceback (most recent call last): > File > "C:\Python23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", > line 310, in RunScript > exec codeObject in __main__.__dict__ > File "C:\temp\try.py", line 8, in ?

Re: compare list

2005-11-15 Thread Simon Brunning
On 15/11/05, Ben Bush <[EMAIL PROTECTED]> wrote: > I found I named the following python file as sets.py, which brought the > problem (is that right?). i changed it to other name and it works. > But the logic output is wrong. > from sets import Set as set > lisA=[1,2,5,9] > lisB=[9,5,0,2] > lisC=[9,

Re: Can anyone tell me if pygame and Tkinter can work together?

2005-11-16 Thread Simon Brunning
On 16/11/05, Nathan Pinno <[EMAIL PROTECTED]> wrote: > It worked, but unfornately I can't use this line as it brings up errors: > > from Tkinter (or pygame) import * > > Anyway around this little bug? What's the error? -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blo

Re: Adding through recursion

2005-11-18 Thread Simon Brunning
On 18 Nov 2005 05:22:47 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > There is problaly a really simple answer to this, but why does this > function print the correct result but return "None": > > def add(x, y): > if x == 0: > print y > return y > else: > x -

Re: Adding through recursion

2005-11-18 Thread Simon Brunning
On 18 Nov 2005 06:30:58 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I still don't get it. I tried to test with x = 0 and found that to > work. How come since the value of y is right and it is printed right it > "turns into" None when returned by the return statement ? There is no return

Re: the PHP ternary operator equivalent on Python

2005-11-18 Thread Simon Brunning
On 18 Nov 2005 10:53:04 -0800, Daniel Crespo <[EMAIL PROTECTED]> wrote: > I would like to know how can I do the PHP ternary operator/statement > (... ? ... : ...) in Python... Wait for Python 2.5 - . -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunn

Re: Controlling windows gui applications from python

2005-11-18 Thread Simon Brunning
On 18/11/05, tim <[EMAIL PROTECTED]> wrote: > Hi all, I'm almost as new to this list as to python so I hope I don't > get a "this has been answered a 100 times before" or anything... > > Currently I am using a program named 'Macro Scheduler' for automating > programs that don't have a command line

Re: Is Python weak on the web side?

2005-11-20 Thread Simon Brunning
On 19/11/05, Michael Goettsche <[EMAIL PROTECTED]> wrote: > On Sunday 20 November 2005 00:24, Tony wrote: > > If I'd like to learn Python for web-development, what are the options > > available? > > A nice framework is CherryPy: http://www.cherrypy.org > or Turbogears, which is based on CherryPy: h

Re: Controlling windows gui applications from python

2005-11-22 Thread Simon Brunning
On 21/11/05, tim <[EMAIL PROTECTED]> wrote: > Thanks for this tip, this looks like exactly what I need. > > Is there a more extended documentation for watsup somewhere ? Err, not a lot, no. > I didn't find info on: > how to send keystrokes to a program. You don't do that. WATSUP uses WinGuiAuto,

Re: user-defined operators: a very modest proposal

2005-11-23 Thread Simon Brunning
On 23/11/05, Joseph Garvin <[EMAIL PROTECTED]> wrote: > What do you mean by unicode operators? Link? http://fishbowl.pastiche.org/2003/03/19/jsr666_extended_operator_set -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/py

Re: Converting a flat list to a list of tuples

2005-11-23 Thread Simon Brunning
On 22/11/05, Bengt Richter <[EMAIL PROTECTED]> wrote: > That would be a counter-intuitive thing to do. Most things go left->right > in order as the default assumption. +1 -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/p

Re: SelfExtract with zipfile

2005-11-23 Thread Simon Brunning
On 23/11/05, Catalin Lungu <[EMAIL PROTECTED]> wrote: > Hi, > I need to compress files in self-extract archive. I use the zipfile module. > Is there an option or parameter to do that? No, AFAIK. If you have a command line tool, perhaps you could try driving that. -- Cheers, Simon B, [EMAIL PROTEC

Re: user-defined operators: a very modest proposal

2005-11-23 Thread Simon Brunning
On 23/11/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > see also: > > http://www.brunningonline.net/simon/blog/archives/000666.html > http://www.python.org/peps/pep-0666.html PEP 666 should have been left open. There are a number of ideas that come up here that should be added to it - and

Re: Python as Guido Intended

2005-11-24 Thread Simon Brunning
On 24 Nov 2005 10:21:51 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: > But only Guido, thinks like Guido and then even Guido may now think > differently than he thought before. And what if Guido had a bad day > when he came up with something, should we just adopt to what he > had in mind without q

Re: Python as Guido Intended

2005-11-24 Thread Simon Brunning
On 24 Nov 2005 11:30:04 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: > > But he's consistently a > > better judge of language design than I am, and in all likelihood > > better than you, too. If you like Python, it's 'cos you like the > > decisions he's made over many years. > > So, that makes tha

Re: Understanding Python Documentation

2005-11-24 Thread Simon Brunning
On 24/11/05, Josh Cronemeyer <[EMAIL PROTECTED]> wrote: > I have very little experience programming in python but considerable > experience with java. One thing that is frustrating me is the differences in > the documentation style. Javadocs, at the top level are just a list of > packages. Drill

Re: Python as Guido Intended

2005-11-24 Thread Simon Brunning
On 24/11/05, Bengt Richter <[EMAIL PROTECTED]> wrote: > >Where my first impulse is to think that one of decisions is wrong, > >nine times out of ten in time I'll come to find that I was wrong and > >he was right. > > > You have a reservation about that other 10% ? ;-) The other 10%, I've just not

Python book for a non-programmer

2005-11-25 Thread Simon Brunning
I have a non-programming friend who wants to learn Python. It's been so long since I've been in her shoes that I don't feel qualified to judge the books aimed at people in her situation. I know of two such books:

Re: Python book for a non-programmer

2005-11-25 Thread Simon Brunning
On 25 Nov 2005 03:23:33 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > http://www.python.org/doc/Intros.html > > and two great texts when she has covered the basics are: > > http://diveintopython.org/ > > http://www.mindview.net/Books/TIPython I wouldn't have thought either of those was sui

Re: How to stop a linux process

2005-11-28 Thread Simon Brunning
On 11/28/05, Glen <[EMAIL PROTECTED]> wrote: > When I used the following line to play a midi file in linux, > > return_value = os.system('timidity test.mid') > > I have encountered two problems. > 1. The python script halts until timidity has finished. > 2. If I had control of the script, I can't t

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-02 Thread Simon Brunning
On 12/2/05, Dave Hansen <[EMAIL PROTECTED]> wrote: > FWIW, indentation scoping one one of the features that _attracted_ me > to Python. +1 QOTW OK, it's a bit of a cliche. But it's a cliche because it's *true*. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ --

Re: Bitching about the documentation...

2005-12-07 Thread Simon Brunning
On 12/7/05, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > But none of them are the cost of Python, which is free. It really isn't a > scam, nobody is going to come knocking at your door with a surprise bill > for using Python. Well, there is the PSU's "Spanish Inquisition" division. Last week they

Re: first post: new to pythong. some questions.

2005-12-08 Thread Simon Brunning
On 12/8/05, shawn a <[EMAIL PROTECTED]> wrote: > Hello. Im brand new to this list and to python. Ive recently started > reading about it > and am now in the tinkering stage. Welcome to Python! > I have a script im working on that i > need some > asistance debugging. Its super small and shoul

Re: OT: spacing of code in Google Groups

2005-01-06 Thread Simon Brunning
On Wed, 05 Jan 2005 22:57:33 GMT, JanC <[EMAIL PROTECTED]> wrote: > Rectangular selection only works with the mouse in SciTE/Scintilla: > alt-click-drag. Nope - hold down alt-shift, and select with the cursor keys. -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/

Re: python reading/writing ms-project files?

2005-01-07 Thread Simon Brunning
On 6 Jan 2005 16:05:07 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > any existing or pointers on how to do this? If you are running on Windows and have a copy of Project, then COM automation is probably your best bet. See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/279003 for a

Re: countint words from an input string

2005-01-07 Thread Simon Brunning
On Fri, 7 Jan 2005 15:58:06 +0100, Øystein Western <[EMAIL PROTECTED]> wrote: > Try to write som code that will get an input string from the user. Futher > more, I'd like to have the program to count all the word the user has > written. > > Startet out like this: > > /- > s = raw_inpu

Re: Getting rid of "self."

2005-01-07 Thread Simon Brunning
On 7 Jan 2005 08:10:14 -0800, Luis M. Gonzalez <[EMAIL PROTECTED]> wrote: > The word "self" is not mandatory. You can type anything you want > instead of self, as long as you supply a keyword in its place (it can > be "self", "s" or whatever you want). You *can*, yes, but please don't, not if ther

Re: Python Installation

2005-01-12 Thread Simon Brunning
On Tue, 11 Jan 2005 21:00:40 +0100, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Steve Holden wrote: > > > Hmm, effbot.org seems to be down just now. Sure it'll be back soon, though. > > http://news.bbc.co.uk/2/hi/europe/4158809.stm Good to see that it was effbot.org that was down, rather that the

Re: Excel module for Python

2005-01-12 Thread Simon Brunning
On Wed, 12 Jan 2005 15:18:09 +0800, sam <[EMAIL PROTECTED]> wrote: > I m wondering which Excel module is good to be used by Python? If you are on Windows, and you have Excel, then the Python for Windows extensions[1] are all you need to drive Excel via COM. O'Reilly's "Python Programming on Win32"

Re: Excel module for Python

2005-01-12 Thread Simon Brunning
On Wed, 12 Jan 2005 23:19:44 +0800, sam <[EMAIL PROTECTED]> wrote: > > No, I don't use MS windows. I need to generate Excel file by printing > data to it, just like Perl module Spreadsheet::WriteExcel. If it's just data that needs to go into your spreadsheet, then I'd just build a CSV file if I we

Re: Unclear On Class Variables

2005-01-13 Thread Simon Brunning
On 13 Jan 2005 07:18:26 EST, Tim Daneliuk <[EMAIL PROTECTED]> wrote: > I am a bit confused. I was under the impression that: > > class foo(object): > x = 0 > y = 1 > > means that x and y are variables shared by all instances of a class. > But when I run this against two instances

Re: module on files & directories

2005-01-13 Thread Simon Brunning
On Thu, 13 Jan 2005 04:51:22 -0800 (PST), Sara Fwd <[EMAIL PROTECTED]> wrote: > Hi all > > Can anybody help me find a module or a function that > looks in a directory and defines whether the objects > in there are files or directories? See os.path.isfile() and os.path.isdir() -

Re: Unclear On Class Variables

2005-01-13 Thread Simon Brunning
On Thu, 13 Jan 2005 08:56:10 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote: > Simon, it's really not about mutability at all. You've changed > the example, Err, there *wasn't* an example, not really. The OP just mentioned 'setting the values' of instance members. That *can* mean name binding, bu

Re: Octal notation: severe deprecation

2005-01-14 Thread Simon Brunning
On Thu, 13 Jan 2005 16:50:56 -0500, Leif K-Brooks <[EMAIL PROTECTED]> wrote: > Tim Roberts wrote: > > Stephen Thorne <[EMAIL PROTECTED]> wrote: > > > >>I would actually like to see pychecker pick up conceptual errors like this: > >> > >>import datetime > >>datetime.datetime(2005, 04,04) > > > > > >

Re: Fuzzy matching of postal addresses

2005-01-18 Thread Simon Brunning
You might find these at least periperally useful: They refer to address formatting rather than de-duping - but normalising soulds like a useful first step to me. -- Che

Re: lambda

2005-01-18 Thread Simon Brunning
On 18 Jan 2005 07:51:00 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: > 3 mutating an item in a sorted list *does* *always* cause problems No, it doesn't. It might cause the list no longer to be sorted, but that might or might no be a problem. > More specific the Decimal class is mutable and usab

Re: map in Python

2005-01-21 Thread Simon Brunning
On 21 Jan 2005 04:25:27 -0800, Stu <[EMAIL PROTECTED]> wrote: > I have recently switched over to Python from Perl. I want to do > something like this in Python: > > @test = ("a1", "a2", "a3"); > map {s/[a-z]//g} @test; > print @test; > > However, I take it there is no equivalent to $_ in Python.

Re: map in Python

2005-01-21 Thread Simon Brunning
On Fri, 21 Jan 2005 12:37:46 +, Simon Brunning <[EMAIL PROTECTED]> wrote: > This what you want? > > >>> import re > >>> test = ["a1", "a2", "a3"] > >>> test = [re.sub("[a-z]", "", item) for

Re: circular iteration

2005-01-21 Thread Simon Brunning
On 21 Jan 2005 08:31:02 -0800, Flavio codeco coelho <[EMAIL PROTECTED]> wrote: > hi, > > is there a faster way to build a circular iterator in python that by doing > this: > > c=['r','g','b','c','m','y','k'] > > for i in range(30): > print c[i%len(c)] I don''t know if it's faster, but: >>

Re: Python 2.1 - 2.4 differences

2005-01-24 Thread Simon Brunning
On Mon, 24 Jan 2005 17:13:44 +0100, BOOGIEMAN <[EMAIL PROTECTED]> wrote: > I found some e-book about Python 2.1, I want to print it but just to check > first if sintax of Python 2.1 is same as 2.4 ? Pretty musch the same, but naturally, some things have changed. See these documents for the major c

Re: "private" variables a.k.a. name mangling (WAS: What is print? A function?)

2005-01-25 Thread Simon Brunning
On Mon, 24 Jan 2005 12:17:13 -0600, Philippe C. Martin <[EMAIL PROTECTED]> wrote: > > I use "__"for private variables because I must have read on net it was > the way to do so - yet this seems to have changed - thanks: > > http://www.network-theory.co.uk/docs/pytut/tut_77.html Nope, that's still

Re: Question: "load"ing a shared object in python

2005-01-26 Thread Simon Brunning
On Tue, 25 Jan 2005 23:19:01 +0200, Pro Grammer <[EMAIL PROTECTED]> wrote: > Hello, all, > I am not sure if this is the right place to ask, but could you kindly > tell me how to "load" a shared object (like libx.so) into python, so > that the methods in the .so can be used? That too, given that the

Re: fast list lookup

2005-01-26 Thread Simon Brunning
On Wed, 26 Jan 2005 06:45:29 -0800 (PST), Klaus Neuner <[EMAIL PROTECTED]> wrote: > what is the fastest way to determine whether list l (with > len(l)>3) contains a certain element? If the list isn't sorted, I doubt you'll do better than if an_element in my_list: # do whatever If the lis

Re: Help With Python

2005-01-26 Thread Simon Brunning
On Wed, 26 Jan 2005 15:55:28 -, Judi Keplar <[EMAIL PROTECTED]> wrote: > I am currently taking a course to learn Python and was looking for > some help. I need to write a Python statement to print a comma- > separated repetition of the word, "Spam", written 511 times ("Spam, > Spam, â Spam").

Re: how to operate the excel by python?

2005-06-20 Thread Simon Brunning
On 6/17/05, Hughes, Chad O <[EMAIL PROTECTED]> wrote: > > I have posed a more complete answer to your question, however, it is quite a > large and It is awaiting approval. For now, xlRight = -4152. You can find > this out by opening up Excel and typing the ALT-F11 combination. From there > use

Re: py2exe problem

2005-06-21 Thread Simon Brunning
On 6/21/05, Austin <[EMAIL PROTECTED]> wrote: > I use py2exe to build python program to "aa.exe". > If this program has a bug, after closed this program, it will show > "aa.exe.log" in this folder. > Is there any ways to avoid this log file? It's probably best just have a try/except at the very to

Re: How to get/set class attributes in Python

2005-06-21 Thread Simon Brunning
On 6/12/05, Steve Jorgensen <[EMAIL PROTECTED]> wrote: > Oops - I thought I cancelled that post when I relized I was saying nothing, Would that everyone cancelled their posts when they realised that they weren't saying anything. ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonlin

Re: FAQ: __str__ vs __repr__

2005-06-21 Thread Simon Brunning
On 6/15/05, Peter Hansen <[EMAIL PROTECTED]> wrote: > __repr__ shouldn't be anything, if you don't have an actual need for it. > Neither should __str__. Oh, I don't know. __str__ is so frequently useful in debugging and logging that I always try and do something useful with it. -- Cheers, Simo

Re: getting an object name

2005-06-22 Thread Simon Brunning
On 6/22/05, David Bear <[EMAIL PROTECTED]> wrote: > Let's say I have a list called, alist. If I pass alist to a function, > how can I get the name of it? The effbot put it beautifully: "The same way as you get the name of that cat you found on your porch: the cat (object) itself cannot tell you i

Dr. Dobb's Python-URL! - weekly Python news and links (Jun 22)

2005-06-22 Thread Simon Brunning
QOTW: "Python is more concerned with making it easy to write good programs than difficult to write bad ones." - Steve Holden "Scientists build so that they can learn. Programmers and engineers learn so that they can build." - Magnus Lycka "It happens that old Java programmers make one module per

Dr. Dobb's Python-URL! - weekly Python news and links (Jun 22)

2005-06-22 Thread Simon Brunning
QOTW: "Python is more concerned with making it easy to write good programs than difficult to write bad ones." - Steve Holden "Scientists build so that they can learn. Programmers and engineers learn so that they can build." - Magnus Lycka "It happens that old Java programmers make one module per

Re: suggestions invited

2005-06-24 Thread Simon Brunning
On 23 Jun 2005 13:46:18 -0700, Peter Herndon <[EMAIL PROTECTED]> wrote: > Reasonable enough. As per Mike's suggestion below, building a few web > pages to document the apps is a good start. To expand on that idea, > you could write daemons/cron jobs, perhaps in Python if Python runs on > OS/400,

Re: Thoughts on Guido's ITC audio interview

2005-06-28 Thread Simon Brunning
On 6/26/05, John Roth <[EMAIL PROTECTED]> wrote: > What's being ignored is that type information is useful for other things > than compile type checking. The major case in point is the way IDEs > such as IntelliJ and Eclipse use type information to do refactoring, code > completion and eventually n

Re: Thoughts on Guido's ITC audio interview

2005-06-28 Thread Simon Brunning
On 6/27/05, Sakesun Roykiattisak <[EMAIL PROTECTED]> wrote: > 1. Automatic refactoring never solve the readability issue. Eclipse's refactorings are a great boon, I find. Refectoring is never *fully* automatic, of course, but the ability to, for example, select a chunk of code and have it extracte

Re: Modules for inclusion in standard library?

2005-06-29 Thread Simon Brunning
On 6/28/05, John Roth <[EMAIL PROTECTED]> wrote: > I'd definitely like to see ctypes. I can agree with the segfault > issue, but I think that some design work would eliminate that. I'm not sure that it would. Ctypes allows you, as one colleague memorably put it, to "poke the operating system with

Dr. Dobb's Python-URL! - weekly Python news and links (Jun 29)

2005-06-29 Thread Simon Brunning
QOTW: "And what defines a 'python activist' anyway? Blowing up Perl installations worldwide?" - Ivan Van Laningham "Floating point is about nothing if not being usefully wrong." - Robert Kern Sibylle Koczian needs to sort part of a list. His first attempt made the natural mistake - sort

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-30 Thread Simon Brunning
On 29 Jun 2005 15:34:11 -0700, Luis M. Gonzalez <[EMAIL PROTECTED]> wrote: > What's exactly the "cockney" accent? > Is it related to some place or it's just a kind of slang? A cockney is a *real* Londoner, that is, someone born within the City of London, a.k.a The Square Mile. More specifically, i

Re: Modules for inclusion in standard library?

2005-06-30 Thread Simon Brunning
On 6/29/05, Christopher Arndt <[EMAIL PROTECTED]> wrote: (snip) > Most of these are probably not elegible due to license issues but I'd > love to see SQLite support added to Python-out-of-the-box. Adding sqllite to the standard library has been discussed before: http://groups-beta.google.com/gro

Re: Modules for inclusion in standard library?

2005-06-30 Thread Simon Brunning
On 6/29/05, Thomas Heller <[EMAIL PROTECTED]> wrote: > > To me, this sounds that *at least* a PEP would be needed to convince > Guido. Or, to record the reasoning why it cannot be included. I have a feeling that Guido won't allow ctypes into the standard library since it can crash Python. I don'

Dr. Dobb's Python-URL! - weekly Python news and links (Jun 29)

2005-06-30 Thread Simon Brunning
QOTW: "And what defines a 'python activist' anyway? Blowing up Perl installations worldwide?" - Ivan Van Laningham "Floating point is about nothing if not being usefully wrong." - Robert Kern Sibylle Koczian needs to sort part of a list. His first attempt made the natural mistake - sort

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Jun 29)

2005-07-01 Thread Simon Brunning
On 7/1/05, Peter Maas <[EMAIL PROTECTED]> wrote: > Simon Brunning schrieb: > > Sibylle Koczian needs to sort part of a list. His first attempt made > > the natural mistake - sorting a *copy* of part of the list: > > I think it was _her_ first attempt. Ooops!

  1   2   3   4   5   6   >