Re: Why stay with lisp when there are python and perl?

2007-05-07 Thread Bart Willems
Xah Lee wrote: > blah blah blah blah blah lisp blah blah blah > blah blah lisp blah blah. Blah blah? Blah blah! > blah blah blah blah blah; > 1) Blah lisp. > 2) Blah blah. > 3) Blah lisp blah. > blah blah blah blah blah. Blah blah lisp! Blah lisp! > Blah lisp! Blah! Blah blah blah! Lisp bla

Re: python win32com excel problem

2007-05-01 Thread Bart Willems
Bart Willems wrote: > Autofit is a method. Also, columns are a method of a worksheet - try: > xlApp.Worksheets.Columns("C:K").Autofit() Silly me. That is of course xlApp.Activesheet.Columns("C:K").Autofit() On a sidenote, you can refer to a worksheet with xlApp

Re: python win32com excel problem

2007-05-01 Thread Bart Willems
Ray wrote: > Hi, > I tried to call "xlApp.Columns.AutoFit=1" the whole program will crash, > but without xlApp.Columns.AutoFit=1, everything just fine. Autofit is a method. Also, columns are a method of a worksheet - try: xlApp.Worksheets.Columns("C:K").Autofit() (or whatever columns you need of c

Re: Chart drawing tool in python

2007-04-29 Thread Bart Willems
[EMAIL PROTECTED] wrote: > Hi, > > In Perl, there is a GD module to draw custom chart. > http://www-128.ibm.com/developerworks/opensource/library/os-perlgdchart/?ca=dgr-lnxw01Perl-GD-Charts > Can you please tell me if there is an equivalent library in python? Did you take a look at reportlab? (ht

Re: Any Good tools to create CSV Files?

2007-04-29 Thread Bart Willems
Aahz wrote: > In all fairness, the csv module is new in Python 2.3, and I'm sure I'm > not the only person still using Python 2.2 for production. That is true, on the other hand, Reportlab is made for at least Python 2.4, "although it will work with 2.3" - so he has 2.3 at least :) -- http://mail

Re: if __name__ == 'main': & passing an arg to a class object

2007-04-29 Thread Bart Willems
gtb wrote: > appear at the end of many examples I see. Is this to cause a .class > file to be generated? This might be obvious, but no one else mentioned it: the Python interpreter cannot execute code that it hasn't compiled yet, which is why the "if __name__ ..." code is always at the end of the

Re: I have a chance to do somting diffrent way not Python ?!

2007-04-29 Thread Bart Willems
anders wrote: > So basicly i like advice about interac with os, compiler etc. > Nice webblinks to read more > and do/don't things. Hello Anders, OS Support for Windows in Python is excellent. I suggest you download the latest version, and don't forget to download Mark Hammond's win32 library as

Re: Any Good tools to create CSV Files?

2007-04-29 Thread Bart Willems
Carsten Haese wrote: > You mean something like the csv module that is part of Python's standard > library? > import csv help(csv) You have to admit, the module name is not really intuitive... :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Combinate 2 lists to a dict ?

2007-04-18 Thread Bart Willems
Jia Lu wrote: > I have 2 lists, > a = [1,2,3] > b = ["ooo","aaa","ppp"] reading the documentation might help. If that doesn't work, try d = dict(zip(a, b)) -- http://mail.python.org/mailman/listinfo/python-list

That might be the case for more complex objects...

2007-04-14 Thread Bart Willems
Dennis Lee Bieber wrote: > On 14 Apr 2007 06:35:34 -0700, "jamadagni" <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > In Python, the "variable" NAME does NOT define storage; unlike most > other classical languages where the "variable name" is a storage > address, and the

Re: Simple integer comparison problem

2007-04-14 Thread Bart Willems
> if points > 89 and points <= 100: > return "A" > elif points > 89 and points <= 89: > return "B" > elif points > 69 and points <= 79: > return "C" > elif points > 59 and points <= 69: > return "D" > else: > return "F" The previous poste

Re: tuples are useless???

2007-04-08 Thread Bart Willems
James Stroud wrote: > ... It boils down to the fact that tuples are useless as a > result unless you know you really need them--and you never really NEED > them. Could you clarify that for me? I use tuples *a lot* and I really *NEED* them - I'm building a lot of multi-tier reports where detail-

Re: Why NOT only one class per file?

2007-04-06 Thread Bart Willems
Steven D'Aprano wrote: > On Wed, 04 Apr 2007 14:23:19 -0700, Chris Lasher wrote: > >> A friend of mine with a programming background in Java and Perl places >> each class in its own separate file in . I informed him that keeping >> all related classes together in a single file is more in the Pytho

Re: reverse engineering Excel spreadsheet

2007-04-02 Thread Bart Willems
John Machin wrote: > I'm a bit puzzled by your notion of creating a dependency graph > *without* first extracting the "relationships (functions)" [which you > could do only by parsing the formulas and macros]. Not really. The range object in the Excel object model has a Dependents attribute, al

Re: What are OOP's Jargons and Complexities

2007-03-31 Thread Bart Willems
> > Even better: pick one entry of your choice from > > http://images.google.com/images?q=%22don%27t+feed+the+troll%22 > > > Michele OMG and here I am thinking that Ken Rockwell's site is full of crap. This one's worse... Does the guy have a job? Or a life? -- http://mail.python.org/mailman/

Re: Technical Answer - Protecting code in python

2007-03-22 Thread Bart Willems
Aaah, *now* we're getting somewhere... :-) >> All he wants is something that turns 'readable, >> changeable python' into 'unreadable, immutable python'. > > chown scriptuser script.py # a unique user > chmod a-rwx script.py > chmod u+rx script.py > > I believe that fully meets the functional r

Re: why brackets & commas in func calls can't be ommited? (maybe it could be PEP?)

2007-03-22 Thread Bart Willems
dmitrey wrote: > 1st still is shorter by 1 char; considering majority of people use > space after comma & number of parameters can be big it yileds > foo bar baz bar2 bar3 bar4 > vs > foo(bar, baz, bar2, bar3, bar4) I think most readers already agree on the ambiguities part. Now, for the length o

Re: Technical Answer - Protecting code in python

2007-03-21 Thread Bart Willems
Steven D'Aprano wrote: > Protect it from what? Viruses? Terrorists? The corrupt government? Your > ex-wife cutting it up with scissors? People who want to copy it? People > who will look at your code and laugh at you for being a bad programmer? > > Until you tell us what you are trying to protect

Re: Problem I have with a while loop/boolean/or

2007-03-13 Thread Bart Willems
John McMonagle wrote: > Try it a different way: > > while True: > hint = raw_input("\nAre you stuck? y/n: ") > hint = hint.lower() > if hint != 'y' and hint != 'n': > print "Please answer y or n" > continue > else: > break > if hint == 'y': > do_your_hin

Re: any better code to initalize a list of lists?

2007-03-11 Thread Bart Willems
Donald Fredkin wrote: > John wrote: > >> For my code of radix sort, I need to initialize 256 buckets. My code >> looks a little clumsy: >> >> radix=[[]] >> for i in range(255): >>radix.append([]) >> >> any better code to initalize this list? > > radix = [[[]]*256][0] > No I fell for that on

Re: Python-list Digest, Vol 42, Issue 117

2007-03-09 Thread Bart Willems
I'm sorry, but what's wrong with: radix = [ [] ] * 256 Cheers, Bart "John" writes: >> For my code of radix sort, I need to initialize 256 buckets. My code looks a >> little clumsy: >> >> radix=[[]] >> for i in range(255): >> radix.append([]) >> >> any better code to initalize this list? >>