Re: How to run Python file?

2006-09-02 Thread Rick Zantow
"mistral" <[EMAIL PROTECTED]> wrote in news:1157239512.139823.15650 @74g2000cwt.googlegroups.com: [...] > Assuming I have Windows XP, and I installed ActiveState Python. No any > other additional manipulations were done, no any PATHEXTes environment > variables, etc, etc, nothing. How many prepara

Re: How to run Python file?

2006-09-02 Thread Rick Zantow
"Ant" <[EMAIL PROTECTED]> wrote in news:1157218244.750434.36220 @h48g2000cwc.googlegroups.com: > > zefciu wrote: >> Pontus Ekberg wrote: > ... >> > $ python test.py >> > >> > or >> > >> > $ ./test.py (if test.py is executable) >> > >> > >> Thats if you use un*x. If you word under windows, the fi

Re: When is a subclass not right?

2006-08-24 Thread Rick Zantow
Gabriel Genellina <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > At Thursday 24/8/2006 17:44, Chaz Ginger wrote: > >>That is merely a logical use of OO after all when would a car and an >>orange be the same? > > Uh... what's the point...? > By example, an orange inside a car would be mo

Re: Proposal: [... for ... while cond(x)]

2006-08-07 Thread Rick Zantow
Duncan Booth <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Diez B. Roggisch wrote: > >>> No, the list comprehension lets you write an expression directly >>> avoiding a function call, and it also allows you to add in a >>> condition which can be used to filer the sequence. Your proposal

Re: Class definition within function

2006-08-02 Thread Rick Zantow
Duncan Booth <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: >> >>> def f(): >> class C(object): >> def __init__(self): >>self.a = 'a' >> return C() >> >> >>> x = f() >> >>> x.a >> 'a' >> >>> y=f.C() >> > Of course there's this: >>> def f(): ... clas

Re: write()

2006-07-27 Thread Rick Zantow
"manuhack" <[EMAIL PROTECTED]> wrote in news:1153981114.837884.232610 @p79g2000cwp.googlegroups.com: > I copied the lines > > f=open('/tmp/workfile', 'w') > print f > f.close() > > from Python 2.4 Documentation 7.2. But it said IOerror No such file or > directory" '/tmp/workfile' > > Is it som

Re: Amara installation

2006-06-19 Thread Rick Zantow
"tjreedy" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> O/S WinXP Home >> Vsn of Python: 2.4 >> >> Wish to install Amara. Using amara-allinone-1.0.win32-py2.4.exe >> (2965KB) >> >> Forder structure before installation:

Re: Pychecker

2006-06-09 Thread Rick Zantow
Anthony Greene <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Howdy, I had the impression that pychecker caught and reported such > dynamic syntactical errors. > > #!/usr/bin/env python > > > def add(i): > i += 10 > > status = 3 > > if 1 == 1: > statuss = 15 > > add(stat

Re: Generating Cutter numbers

2006-05-20 Thread Rick Zantow
[EMAIL PROTECTED] wrote in news:1148133784.844430.23130@ 38g2000cwa.googlegroups.com: > Gerard Flanagan wrote: >> All >> >> would anyone happen to have code to generate Cutter Numbers: >> >> eg. http://www1.kfupm.edu.sa/library/cod-web/Cutter-numbers.htm >> [...] > > I wrote a script to see if

Re: do while loop

2006-04-26 Thread Rick Zantow
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > In <[EMAIL PROTECTED]>, 雷 wrote: > >> suggest add do while loop in later version > > Please also suggest a clean syntax for this. :-) > Since Python already has a while : loop, I'm supposing you mean somethin

Re: how to print without blank?

2006-04-09 Thread Rick Zantow
Steven D'Aprano <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > On Sat, 08 Apr 2006 22:54:17 -0700, Ju Hui wrote: > >> I want to print 3 numbers without blank. > [snip] >> how to print >> 012 >> ? > > Method one: accumulate your numbers into a single string, then print > it in one go. >

Re: how to comment lot of lines in python

2006-04-04 Thread Rick Zantow
Kent Johnson <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Rick Zantow wrote: >> Kent Johnson <[EMAIL PROTECTED]> wrote in news:44310867$1_1 >> @newspeer2.tds.net: >> >>> Sion Arrowsmith wrote: >>>> Out of curiousity, is there a m

Re: how to comment lot of lines in python

2006-04-03 Thread Rick Zantow
Kent Johnson <[EMAIL PROTECTED]> wrote in news:44310867$1_1 @newspeer2.tds.net: > Sion Arrowsmith wrote: >> Eric Deveaud <[EMAIL PROTECTED]> wrote: >>> some moderns editors allow you to comment/uncomment a selected Bunch >>> of lines of code >> >> Out of curiousity, is there a modern editor wh

Re: why use special config formats?

2006-03-11 Thread Rick Zantow
"gangesmaster" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > aah. you all are too stupid. -1 QOTW. -- rzed -- http://mail.python.org/mailman/listinfo/python-list

Re: UnboundLocalError: local variable 'colorIndex' referenced

2006-02-26 Thread Rick Zantow
[EMAIL PROTECTED] wrote in news:1140987642.195734.187540 @t39g2000cwt.googlegroups.com: > Can you please tell me what is the meaning this error in general? > > UnboundLocalError: local variable 'colorIndex' referenced before > assignment > > In my python script, > I have a variable define and i

Re: "Temporary" Variable

2006-02-23 Thread Rick Zantow
[EMAIL PROTECTED] wrote in news:1140725159.143882.202630 @j33g2000cwa.googlegroups.com: > > Steven D'Aprano wrote: >> You could try this: >> >> while 1: >> var = raw_input("Give me some data! ") >> if var == "some data": >> print "Success!" >> break >> else: >>

Re: Another n00b: Removing the space in "print 'text', var"

2006-02-13 Thread Rick Zantow
bruno at modulix <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > HappyHippy wrote: >> More of a minor niggle than anything but how would I remove the >> aforementioned space? > > >> eg. >> strName = 'World' >> print 'Hello', strName, ', how are you today?' > > > Already got an anwser,

Re: Number Format function

2006-02-08 Thread Rick Zantow
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > def number_format(num, places=0): > """Format a number according to locality and given places""" > locale.setlocale(locale.LC_ALL, "") > return locale.format("%.*f", (places, num), True) > There are some edge