Re: Newbie Q about Turtle Gfx

2009-02-19 Thread Neil
Hi It turns out I should have used t=turtle.Pen() and not t=turtle.pen() My stupid mistake! "Neil" wrote in message news:jyydnb8xe8hpoghunz2dnuvz8juwn...@bt.com... > Thanks everyone! > > It appears the info in the book is wrong. Trying what you have all > suggested > has got it to work! >

Re: Newbie Q about Turtle Gfx

2009-02-18 Thread Neil
Thanks everyone! It appears the info in the book is wrong. Trying what you have all suggested has got it to work! Many thanks, and I am sure I will be back here again with other newbie problems! Neil "Neil" wrote in message news:ifidnr_gysdmfqhunz2dnekdnzzin...@bt.com... > Hello > > Sorry if

Re: Newbie Q about Turtle Gfx

2009-02-18 Thread Mensanator
On Feb 18, 4:16 pm, "Neil" wrote: > Hello > > Sorry if this is not an appropriate newsgroup for this problem. I am very > new to Python but not new to programming. > > I am hoping to use Python to teach a class and have been looking at the > online book 'Snake Wrangling for Kids'. > > I have follo

Re: Newbie Q about Turtle Gfx

2009-02-18 Thread Scott David Daniels
Neil wrote: Forgot to say, that after the error message the turtle window 'hangs' as unresponsive ... "Neil" wrote in message news:ifidnr_gysdmfqhunz2dnekdnzzin...@bt.com... Hello I am hoping to use Python to teach a class and have been looking at the online book 'Snake Wrangling for Kids'.

Re: Newbie Q about Turtle Gfx

2009-02-18 Thread Neil
Thanks for the very speedy reply! Not sure what your reply means but I have emailed the author with the problem! Cheers Neil "sjbrown" wrote in message news:9ba48cb7-d32b-40ef-a6a6-d22508863...@l33g2000pri.googlegroups.com... It looks like there may be a bug if you were expecting t to be som

Re: Newbie Q about Turtle Gfx

2009-02-18 Thread sjbrown
It looks like there may be a bug if you were expecting t to be some object other than a dict. You can apparently contact the authour here: http://www.briggs.net.nz/log/contact/ On Feb 18, 2:16 pm, "Neil" wrote: > Hello > > Sorry if this is not an appropriate newsgroup for this problem. I am ver

Re: Newbie Q about Turtle Gfx

2009-02-18 Thread Neil
Forgot to say, that after the error message the turtle window 'hangs' as unresponsive ... "Neil" wrote in message news:ifidnr_gysdmfqhunz2dnekdnzzin...@bt.com... > Hello > > Sorry if this is not an appropriate newsgroup for this problem. I am very > new to Python but not new to programming. >

Re: Newbie Q: modifying SQL statements

2008-01-11 Thread Faber J. Fedor
On 12/01/08 00:23 +0100, Hrvoje Niksic wrote: > "Faber J. Fedor" <[EMAIL PROTECTED]> writes: > > Does this '("" if not where...' syntax actually work? > > http://docs.python.org/whatsnew/pep-308.html C'mon! I'm in Day Two of learning Python. You can't expect me to be reading "What's New" docs a

Re: Newbie Q: modifying SQL statements

2008-01-11 Thread Faber J. Fedor
On 11/01/08 18:29 -0500, Mike Meyer wrote: > It is a 2.5 feature, though. I was beginning to wonder of that was the case. > I converted all my clients to 2.5.1, > shortly after it was available, and haven't used anything older > since. Sorry 'bout that. No prob. -- Regards, Faber Fedor

Re: Newbie Q: modifying SQL statements

2008-01-11 Thread Hrvoje Niksic
"Faber J. Fedor" <[EMAIL PROTECTED]> writes: > On 10/01/08 22:53 -0500, Mike Meyer wrote: >> Personally, I think it would be more pythonic to not try and use two >> different APIs to walk the list of jobs (... One Way To Do it): >> >> def __call__(self, where=None): >> q = "select * from %s"

Re: Newbie Q: modifying SQL statements

2008-01-11 Thread Mike Meyer
On Fri, 11 Jan 2008 18:11:41 -0500 "Faber J. Fedor" <[EMAIL PROTECTED]> wrote: > On 10/01/08 22:53 -0500, Mike Meyer wrote: > > Personally, I think it would be more pythonic to not try and use two > > different APIs to walk the list of jobs (... One Way To Do it): > > > > def __call__(self, where

Re: Newbie Q: modifying SQL statements

2008-01-11 Thread Faber J. Fedor
On 10/01/08 22:53 -0500, Mike Meyer wrote: > Personally, I think it would be more pythonic to not try and use two > different APIs to walk the list of jobs (... One Way To Do it): > > def __call__(self, where=None): > q = "select * from %s" % (self.name,) + ("" if not where else (" where > %s

Re: Newbie Q: modifying SQL statements

2008-01-10 Thread Mike Meyer
On Thu, 10 Jan 2008 20:32:06 -0500 "Faber J. Fedor" <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm in the process of learning Python by writing a job queue program. > Nothing fancy, mind you, just read from a table, shell out to a program, > write back to the table. > > I'm working off of the tuto

Re: newbie Q: sequence membership

2007-11-19 Thread Steven D'Aprano
On Mon, 19 Nov 2007 16:06:36 -0500, Sells, Fred wrote: >> >>> a, b = [], [] >> >>> a.append(b) >> >>> b.append(a) > did you perhaps mean a.append('b'); b.append('a'); otherwise this seems > pretty advanced for a newbie If you had bothered to read the rest of the post, you'd see that he meant exa

RE: newbie Q: sequence membership

2007-11-19 Thread Sells, Fred
> >>> a, b = [], [] > >>> a.append(b) > >>> b.append(a) did you perhaps mean a.append('b'); b.append('a'); otherwise this seems pretty advanced for a newbie > >>> b in a > True > >>> a in a > Traceback (most recent call last): > File "", line 1, in > RuntimeError: maximum recursion depth exce

Re: newbie Q: sequence membership

2007-11-19 Thread Gabriel Genellina
En Mon, 19 Nov 2007 03:32:12 -0300, saccade <[EMAIL PROTECTED]> escribió: > So if I am permitted to think of integers as immutable objects with > predefined labels (i.e. the integers used in the text of the program > code) that cannot de or re referenced then what a similar treatment of > characte

Re: newbie Q: sequence membership

2007-11-19 Thread John Machin
> > On Nov 17, 4:35 am, John Machin <[EMAIL PROTECTED]> wrote: >> Worse: Consider z = ['A1', 'Z9']. It's highly likely that when x == >> 'A1', "x is_in z" is True -- because an unguaranteed implementation- >> dependent caper caches or "interns" some values, so that x and z[0] >> are the same objec

Re: newbie Q: sequence membership

2007-11-18 Thread MonkeeSage
On Nov 19, 12:32 am, saccade <[EMAIL PROTECTED]> wrote: > I am not a programmer so I feel odd commenting about language design > decisions. When my Prof. introduced python the first question that > popped into mind was that since "x=9; y=9; print x is y and x == y" > prints "True" is there a way t

Re: newbie Q: sequence membership

2007-11-18 Thread saccade
On Nov 17, 3:40 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > You can write your own membership test based on identity ('is'): > Thank you for the practical (usable) advice and explanation of the '==' operator. On Nov 17, 4:35 am, John Machin <[EMAIL PROTECTED]> wrote: > > And that can

Re: newbie Q: sequence membership

2007-11-17 Thread John Machin
On Nov 17, 6:02 pm, saccade <[EMAIL PROTECTED]> wrote: > >>> a, b = [], [] > >>> a.append(b) > >>> b.append(a) > >>> b in a > True > >>> a in a > > Traceback (most recent call last): > File "", line 1, in > RuntimeError: maximum recursion depth exceeded in cmp > > >>> a is a[0] > False > >>> a =

Re: newbie Q: sequence membership

2007-11-17 Thread Gabriel Genellina
En Sat, 17 Nov 2007 04:02:12 -0300, saccade <[EMAIL PROTECTED]> escribió: a, b = [], [] a.append(b) b.append(a) b in a > True a in a > Traceback (most recent call last): > File "", line 1, in > RuntimeError: maximum recursion depth exceeded in cmp a is a[0] >

Re: Newbie Q: Class Privacy (or lack of)

2006-08-02 Thread Antoon Pardon
On 2006-08-02, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >> I find that a strange purpose because when you are working on a class, >> you don't necessarily know if you will ever know many instance of that >> class. So should I use __slots__ in all my classes, just to be sure >> for when someone w

Re: Newbie Q: Class Privacy (or lack of)

2006-08-02 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Antoon Pardon wrote: > On 2006-07-28, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> This avoids the problem but you get others in return. And it's an >> abuse of `__slots__` which is meant as a way to save memory if you need >> really many objects of that type an

Re: Newbie Q: Class Privacy (or lack of)

2006-08-02 Thread Diez B. Roggisch
> I find that a strange purpose because when you are working on a class, > you don't necessarily know if you will ever know many instance of that > class. So should I use __slots__ in all my classes, just to be sure > for when someone wants many instances of one? I find that a strange reasoning b

Re: Newbie Q: Class Privacy (or lack of)

2006-08-02 Thread Antoon Pardon
On 2006-07-28, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> >> class MyClass(object): >> >> __slots__ = ('bar',) >> >> def func(self): >> return 123 >> >> x = MyClass() >> x.instance_var_not_defined_in_the_class = 456 >> ==> >> AttributeError: 'MyClass' object has no a

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Ray
Ben Sizer wrote: > Ray wrote: > But remember, at no point did they think to make that stuff > deliberately hard so that it would give you safety. It's hard because > the implementation is relatively complex. The flipside of that is > writing function objects in C++, which are an ugly hack to get a

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Ben Sizer
Ray wrote: > Yeah, I know... but the thing is that it's easy to "do it". Say in C++, > you can rebind the method of a class to another function if you want > to, you can muck around with the vtable and stuff, but you've gotta do > something different than, say, a normal assignment. But remember, a

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Ray
Bruno Desthuilliers wrote: > Ray wrote: > > Bruno Desthuilliers wrote: > > Actually Bruno, don't you think that the notion of flexibility in > > Python comes at the expense of "security" is simply due to the fact > > that the syntax of "screw up" is exactly the same as the syntax of "I > > mean it

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Timo wrote: > Steve Jobless kirjoitti: > >> Let's say the class is defined as: >> >> class MyClass: >> def __init__(self): >> pass >> def func(self): >> return 123 >> >> But from the outside of the class my interpreter let me do: >> >> x = MyClass()

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Bruno Desthuilliers
Ray wrote: > Bruno Desthuilliers wrote: >>> I'd rather let a machine to do that. Wasn't computer created for tasks >>> like this? (No, not really. But...) >> There's obviously a trade-off between 'security' and flexibility. As I >> said, I do make lots of typo too, but OTOH the edit/test cycle in P

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Bruno Desthuilliers
Steve Jobless wrote: > Bruno Desthuilliers wrote: >> Steve Jobless wrote: >>> Sybren Stuvel wrote: >>> Steve Jobless enlightened us with: > The first case can be just a typo, like: > > x.valeu = 5 > > I make typos all the time. Without a spell checker, this message >>

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Ben Sizer
Steve Jobless wrote: > Unfortunately, I don't see a way > to separate interface from implementation in Python. So, it may not make > much difference whether you subclass it or hack it from the outside. Documentation. (And name-mangling, underscore prepending, all the stuff the others said.) Whenev

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Timo
Steve Jobless kirjoitti: > Let's say the class is defined as: > > class MyClass: > def __init__(self): > pass > def func(self): > return 123 > > But from the outside of the class my interpreter let me do: > > x = MyClass() > x.instance_var_not_defined_in_the_class = 456 >

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Ray
Ben Sizer wrote: > Ray wrote: > > Actually Bruno, don't you think that the notion of flexibility in > > Python comes at the expense of "security" is simply due to the fact > > that the syntax of "screw up" is exactly the same as the syntax of "I > > mean it this way and I do want it"? > > > > Per

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Ben Sizer
Ray wrote: > Actually Bruno, don't you think that the notion of flexibility in > Python comes at the expense of "security" is simply due to the fact > that the syntax of "screw up" is exactly the same as the syntax of "I > mean it this way and I do want it"? > > Perhaps if we use a different synta

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Steve Jobless wrote: > Bruno Desthuilliers wrote: >> >> Steve Jobless wrote: >> > But what about adding a method to the class? Am I supposed to ask "Is >> > anyone using name xxx?" >> >> assert 'xxx' not in dir(SomeClassOrObject) >> >> > The class may be used by develop

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Ray
Bruno Desthuilliers wrote: > > I'd rather let a machine to do that. Wasn't computer created for tasks > > like this? (No, not really. But...) > > There's obviously a trade-off between 'security' and flexibility. As I > said, I do make lots of typo too, but OTOH the edit/test cycle in Python > is u

Re: Newbie Q: Class Privacy (or lack of)

2006-07-28 Thread Steve Jobless
Bruno Desthuilliers wrote: > > Steve Jobless wrote: > > Sybren Stuvel wrote: > > > >>Steve Jobless enlightened us with: > >> > >>>The first case can be just a typo, like: > >>> > >>> x.valeu = 5 > >>> > >>>I make typos all the time. Without a spell checker, this message > >>>would be unreadable :

Re: Newbie Q: Class Privacy (or lack of)

2006-07-27 Thread Ben Sizer
Steve Jobless wrote: > Sybren Stuvel wrote: > > > > Steve Jobless enlightened us with: > > > The first case can be just a typo, like: > > > > > > x.valeu = 5 > > > > > > I make typos all the time. Without a spell checker, this message > > > would be unreadable :). > > > > Then learn to read what

Re: Newbie Q: Class Privacy (or lack of)

2006-07-27 Thread Ray
Bruno Desthuilliers wrote: > Ray wrote: > Ray, please, don't top-post Um, top-post? I'm using Google News and it looks like it is placed correctly in the thread... or you're referring to a different thing? Ray -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Q: Class Privacy (or lack of)

2006-07-27 Thread Ray
John Machin wrote: > Ray wrote: > > > The argument against this is that since development with Python is so > > rapid, you're supposed to always equip your code with extensive unit > > tests. I like Python but I've never really bought that argument--I > > guess I've been doing Java too long :) > >

Re: Newbie Q: Class Privacy (or lack of)

2006-07-27 Thread Ray
Sybren Stuvel wrote: > Ray enlightened us with: > > Huh? No. The compiler will always tell you. Have you ever tried Java > > before? > > I know what I'm talking about, I've got a degree in Computer Science > from the University of Amsterdam. Then how come you didn't know that the Java compiler wi

Re: Newbie Q: Class Privacy (or lack of)

2006-07-27 Thread Bruno Desthuilliers
Steve Jobless wrote: > Sybren Stuvel wrote: > >>Steve Jobless enlightened us with: >> >>>The first case can be just a typo, like: >>> >>> x.valeu = 5 >>> >>>I make typos all the time. Without a spell checker, this message >>>would be unreadable :). >> >>Then learn to read what you type, as you ty

Re: Newbie Q: Class Privacy (or lack of)

2006-07-27 Thread John Machin
Ray wrote: > The argument against this is that since development with Python is so > rapid, you're supposed to always equip your code with extensive unit > tests. I like Python but I've never really bought that argument--I > guess I've been doing Java too long :) > In Java, if you don't always e

Re: Newbie Q: Class Privacy (or lack of)

2006-07-27 Thread Bruno Desthuilliers
Ray wrote: Ray, please, don't top-post (snip) > Also having to check whether a name has already existed can be a major > pain in the butt with Python. assert 'somename' not in dir(someObject) (snip) > Regarding the lack of privacy, s/privacy/language-inforced access restriction/ > --I guess

Re: Newbie Q: Class Privacy (or lack of)

2006-07-27 Thread Ray
Sybren Stuvel wrote: > Ray enlightened us with: > > Also having to check whether a name has already existed can be a > > major pain in the butt with Python. With Java you always know when a > > name has already existed, and what type is bound to the name. I > > consider this to be a Good Thing (tm

Re: Newbie Q: Class Privacy (or lack of)

2006-07-26 Thread Ray
Hey Steve, Yes, I agree with you. The lack of checking can get confusing fast. It's not about typing without errors. Regardless of how you train as long as you're human you WILL make typos. Also having to check whether a name has already existed can be a major pain in the butt with Python. With J

Re: Newbie Q: Class Privacy (or lack of)

2006-07-26 Thread Steve Jobless
Sybren Stuvel wrote: > > Steve Jobless enlightened us with: > > The first case can be just a typo, like: > > > > x.valeu = 5 > > > > I make typos all the time. Without a spell checker, this message > > would be unreadable :). > > Then learn to read what you type, as you type it. Typing without

Re: Newbie Q: Class Privacy (or lack of)

2006-07-26 Thread bearophileHUGS
Steve Jobless: > I'm hearing that "they are features, but don't use them." You can use them if you know why you are doing it. You can also take a look at PyChecker and PyLint, they may help you. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Q: Class Privacy (or lack of)

2006-07-26 Thread Simon Brunning
On 7/26/06, Steve Jobless <[EMAIL PROTECTED]> wrote: > If I was working on a large project with many engineers, I'd assume > someone will do things like this sooner or later. I've seen many > horrendous code in my life and I have no control over who I work with. If you work with cowboys, not P

Re: Newbie Q: Class Privacy (or lack of)

2006-07-25 Thread Steve Jobless
Steve Jobless wrote: > > Hi, > > I just started learning Python. I went through most of the tutorial at > python.org. But I noticed something weird. I'm not talking about the > __private hack. > > Let's say the class is defined as: > > class MyClass: > def __init__(self): > pass >

Re: Newbie Q: Class Privacy (or lack of)

2006-07-25 Thread Bruno Desthuilliers
Steve Jobless wrote: > Hi, > > I just started learning Python. I went through most of the tutorial at > python.org. But I noticed something weird. I'm not talking about the > __private hack. Actually this is __ultra_private. For normal privacy, _private is enough !-) > Let's say the class is def

Re: Newbie Q: Class Privacy (or lack of)

2006-07-24 Thread John Machin
Steve Jobless wrote: > Hi, > > I just started learning Python. I went through most of the tutorial at > python.org. But I noticed something weird. I'm not talking about the > __private hack. > > Let's say the class is defined as: > > class MyClass: > def __init__(self): > pass > def

Re: Newbie Q: Class Privacy (or lack of)

2006-07-24 Thread Kevin Watters
See: http://redhanded.hobix.com/inspect/monkeypytching.html Shouldn't be done unless you have a really cool reason for doing so. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Q: Class Privacy (or lack of)

2006-07-24 Thread Jean-Paul Calderone
On Tue, 25 Jul 2006 02:49:06 GMT, Steve Jobless <[EMAIL PROTECTED]> wrote: >Hi, > >I just started learning Python. I went through most of the tutorial at >python.org. But I noticed something weird. I'm not talking about the >__private hack. > >Let's say the class is defined as: > > class MyClass:

Re: Newbie Q: dynamically assigning object attribute

2006-02-10 Thread Ben Wilson
Well, my Perl way of doing it would be to have all attributes in a dict (hash), then create the accessor vi a dynamic function. I knew Python would have a right way to do it for Python, but when I went looking I neglected to look at the core of the language. I suppose I'm just too accustomed to the

Re: Newbie Q: dynamically assigning object attribute

2006-02-10 Thread Sion Arrowsmith
Ben Wilson <[EMAIL PROTECTED]> wrote: >I would like to dynamically assign object attributes: > >dict = { > a : 1, > b : 2, >} > >for key,val in dict : > obj.key = val > >I've googled to no effect, or maybe I'm needing to be hit with the >appropriately sized clue-by-four. The conventional clue-by-

Re: Newbie Q: dynamically assigning object attribute

2006-02-09 Thread Dylan Moreland
No problem. There are, in fact, ugly class-based methods of doing this. You could assign to an instance's __dict__ dictionary, or -- if the class is a new-style class -- you can call the __setattr__(self, name, value) method. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Q: dynamically assigning object attribute

2006-02-09 Thread Ben Wilson
That's it. I should spend more time R-ingTFM. I kept looking for some class-based solution and there was a built in. Perfectly logical. Thanks, Ben -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Q: dynamically assigning object attribute

2006-02-09 Thread Dylan Moreland
Take a look at the built-in function setattr: http://ftp.python.org/doc/lib/built-in-funcs.html#l2h-64 -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie Q on sdtin word completion

2005-12-08 Thread Fischer
Thanks, exactly what I was looking for. I should go and buy you book ;-) Bernd Fredrik Lundh wrote: > "Bernd" wrote: > > >>I'm on a Linux env and try to get >>word completion form sdtin done, >>like Perl's >> $stdin = Complete( "\t: ", @choices ); >> >>What I have so far shows me the directory

Re: newbie Q on sdtin word completion

2005-12-08 Thread Fredrik Lundh
"Bernd" wrote: > I'm on a Linux env and try to get > word completion form sdtin done, > like Perl's > $stdin = Complete( "\t: ", @choices ); > > What I have so far shows me the directory listing > on the second hit on TAB and not the list of > choices on the first like I wanted to have. your com

Re: newbie Q: mouse clicks don't seem to get trapped

2005-09-05 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hi, > > I want to display a window containing an image and when I move the > mouse over the image and click on the left Mb, I want to get the > position of the mouse on the image. > I listed the code to view the image below (so far so good) but for some > reason the EVT_

Re: newbie q

2005-01-14 Thread Steve Holden
Bengt Richter wrote: On Thu, 13 Jan 2005 09:16:40 -0500, Steve Holden <[EMAIL PROTECTED]> wrote: [...] Any statement of the form for i in [x for x in something]: can be rewritten as for i in something: Note that this doesn't mean you never want to iterate over a list comprehension. It's the

Re: newbie q

2005-01-14 Thread TZOTZIOY
On Fri, 14 Jan 2005 00:08:09 GMT, rumours say that [EMAIL PROTECTED] (Bengt Richter) might have written: >As I'm sure you know, with 2.4's generator expressions you >don't have to build the temporary list. >Which could be important if 'something' >is (or generates) a huge sequence. > > for i

Re: newbie q

2005-01-13 Thread Bengt Richter
On Thu, 13 Jan 2005 09:16:40 -0500, Steve Holden <[EMAIL PROTECTED]> wrote: [...] > >Any statement of the form > > for i in [x for x in something]: > >can be rewritten as > > for i in something: > >Note that this doesn't mean you never want to iterate over a list >comprehension. It's the e

Re: newbie q

2005-01-13 Thread Steve Holden
Egor Bolonev wrote: "Stephen Thorne" <[EMAIL PROTECTED]> ÑÐÐÐÑÐÐ/ÑÐÐÐÑÐÐÐ Ð ÑÐÐÐÑÑÑÐÐ: news:[EMAIL PROTECTED] On Thu, 13 Jan 2005 15:55:10 +1000, Egor Bolonev <[EMAIL PROTECTED]> wrote: how to get rid of 'for' operator in the code? import os, os.path def _test(): src = 'C:\\Documents a

Re: newbie q

2005-01-13 Thread Will Stuyvesant
I understand you want to do it in an applicative programming style? Not recommended in general. But here goes: .# c.l.p. question: .# "using map, lambda, reduce, filter and List Comprehensions [x for .# x in []] just don't get how to add string to all elements of list" . .## .# A function that re

Re: newbie q

2005-01-13 Thread Stephen Thorne
On Thu, 13 Jan 2005 17:05:39 +1000, Egor Bolonev <[EMAIL PROTECTED]> wrote: > > "Stephen Thorne" <[EMAIL PROTECTED]> ÑÐÐÐÑÐÐ/ÑÐÐÐÑÐÐÐ Ð > > ÑÐÐÐÑÑÑÐÐ: news:[EMAIL PROTECTED] > On Thu, 13 Jan 2005 15:55:10 +1000, Egor Bolonev <[EMAIL PROTECTED]> wrote: > > how to get rid of 'for' operator

Re: newbie q

2005-01-12 Thread Egor Bolonev
"Stephen Thorne" <[EMAIL PROTECTED]> ÑÐÐÐÑÐÐ/ÑÐÐÐÑÐÐÐ Ð ÑÐÐÐÑÑÑÐÐ: news:[EMAIL PROTECTED] On Thu, 13 Jan 2005 15:55:10 +1000, Egor Bolonev <[EMAIL PROTECTED]> wrote: how to get rid of 'for' operator in the code? import os, os.path def _test(): src = 'C:\\Documents and Settings\\ÐÐÐÑ\\M

Re: newbie q

2005-01-12 Thread Stephen Thorne
On Thu, 13 Jan 2005 15:55:10 +1000, Egor Bolonev <[EMAIL PROTECTED]> wrote: > how to get rid of 'for' operator in the code? > > import os, os.path > > def _test(): > src = 'C:\\Documents and Settings\\ÐÐÐÑ\\My Documents\\My Music\\' > > for i in [x for x in os.listdir(src) if os.path.isf