Re: Default Value

2013-06-20 Thread rusi
On Jun 20, 10:57 pm, Ian Kelly wrote: > If > the goal is indeed to make the the functions more functional, then the > proper solution would be to keep the binding early but just disallow > mutable defaults altogether -- which is tricky to achieve in Python, > so we simply emulate it with the advic

Re: Default Value

2013-06-20 Thread rusi
On Jun 20, 10:19 pm, Chris Angelico wrote: > On Fri, Jun 21, 2013 at 3:12 AM, rusi wrote: > > Python (and all the other 'cool' languages) dont have gotchas because > > someone malevolently put them there. > > In most cases, the problem is seen too late and the

Re: Default Value

2013-06-20 Thread rusi
You know Rick, you are good at python, you are better at polemics. If only you would cut the crap I would (be able to) agree with you. See below On Jun 20, 7:49 pm, Rick Johnson wrote: > On Thursday, June 20, 2013 7:57:06 AM UTC-5, rusi wrote: > > Every language has gotchas. This

Re: Default Value

2013-06-20 Thread rusi
On Jun 20, 6:19 pm, Roy Smith wrote: > In article > <447dd1c6-1bb2-4276-a109-78d7a067b...@d8g2000pbe.googlegroups.com>, > >  rusi wrote: > > > > def f(a, L=[]): > > > >     L.append(a) > > > >     return L > > Every language has go

Re: Default Value

2013-06-20 Thread rusi
On Jun 20, 12:38 am, Rick Johnson wrote: > On Wednesday, June 19, 2013 2:17:35 PM UTC-5, Ahmed Abdulshafy wrote: > > I'm reading the Python.org tutorial right now, and I found > > this part rather strange and incomprehensible to me> > > > Important warning: The default value is evaluated only > >

Re: A Beginner's Doubt

2013-06-19 Thread rusi
On Jun 19, 9:53 pm, Joshua Landau wrote: > Please be aware, Augusto, that Rick is known to be a bit... OTT. Don't > take him too seriously (but he's not an idiot either). > > On 19 June 2013 14:58,   wrote: > > > Hello! > > This is my first post in this group and the reason why I came across here

Re: Writing Extensions for Python 3 in C

2013-06-19 Thread rusi
On Jun 18, 3:24 pm, Aditya Avinash wrote: > Hi. This is the last place where I want to ask a question. I have searched > for lots of tutorials and documentation on the web but, didn't find a > decent one to develop extensions for Python 3 using a custom compiler > (mingw32, nvcc). Please help me.

Re: weird behavior. bug perhaps?

2013-06-19 Thread rusi
On Jun 18, 8:31 pm, zoom wrote: > > yes, that's the hing. > > thanks a lot > > FYI this happens because >  >>> shape(mean(m,1)) > (4, 1) >  >>> shape(mean(array(m),1)) > (4,) > > thanks again And thank you for the 'Thank you' !! Given the noob-questions the list is currently dealing with, your q

Re: weird behavior. bug perhaps?

2013-06-18 Thread rusi
On Jun 18, 7:23 pm, zoom wrote: > Hi, I have a strange problem here. Perhaps someone would care to help me. > > In the file test.py I have the following code: > > from scipy import matrix, tile, mean, shape > import unittest > > class TestSequenceFunctions(unittest.TestCase): > >      def setUp(se

Re: Python API

2013-06-16 Thread rusi
On Jun 17, 11:38 am, Ganesh Pandi wrote: > Hi >         What are all the python api, u used in your python programming, we > used more api but may we forgot those, so i just want to list down the api we > familiar aboutplease add your replies... Maybe you are referring to th

Re: Don't feed the troll...

2013-06-16 Thread rusi
On Jun 16, 12:54 am, ru...@yahoo.com wrote: > > ... killfile him and shut the fuck up. Ok. Advice taken. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: on git gc --aggressive [was Re: Version Control Software]

2013-06-16 Thread rusi
On Jun 16, 7:09 pm, Jason Swails wrote: > On Sat, Jun 15, 2013 at 11:55 PM, rusi wrote: > > On Jun 16, 4:14 am, Chris Angelico wrote: > > > On Sun, Jun 16, 2013 at 12:16 AM, Roy Smith wrote: > > > > The advantage of DVCS is that everybody has a full copy of the

Re: Version Control Software

2013-06-15 Thread rusi
On Jun 16, 4:14 am, Chris Angelico wrote: > On Sun, Jun 16, 2013 at 12:16 AM, Roy Smith wrote: > > The advantage of DVCS is that everybody has a full copy of the repo. > > The disadvantage of the DVCS is that every MUST have a full copy of the > > repo.  When a repo gets big, you may not want to

Re: Don't feed the troll...

2013-06-15 Thread rusi
On Jun 15, 10:52 pm, Steven D'Aprano wrote: > On Sat, 15 Jun 2013 10:36:00 -0700, rusi wrote: > > With you as our spamming-guru, Onward! Sky is the limit! > > If you're going to continue making unproductive, off-topic, inflammatory > posts that prolong these alrea

Re: RFD: rename comp.lang.python to comp.support.superhost

2013-06-15 Thread rusi
On Jun 15, 10:29 pm, Nick the Gr33k wrote: > On 15/6/2013 8:11 μμ, Chris “Kwpolska” Warrick wrote: > > > > > > > > > > > On Fri, Jun 14, 2013 at 5:25 AM, alex23 wrote: > >> On Jun 14, 2:24 am, Νικόλαος Κούρας wrote: > >>> iam researchign a solution to this as we speak. > > >> Spamming endless "Z

Re: Don't feed the troll...

2013-06-15 Thread rusi
On Jun 15, 10:30 pm, Nick the Gr33k wrote: > > You are spamming my thread. With you as our spamming-guru, Onward! Sky is the limit! -- http://mail.python.org/mailman/listinfo/python-list

Re: Debugging memory leaks

2013-06-15 Thread rusi
On Jun 15, 4:23 pm, Ben Finney wrote: > rusi writes: > > On Jun 15, 5:16 am, Ben Finney wrote: > > > Is a web browser a “typical desktop app”? A filesystem browser? An > > > instant messenger? A file transfer application? A podcatcher? All of > > > those typi

Re: Pattern Search Regular Expression

2013-06-15 Thread rusi
On Jun 15, 3:55 pm, Mark Lawrence wrote: > On 15/06/2013 11:24, Denis McMahon wrote: > > > > > > > > > > > On Sat, 15 Jun 2013 10:05:01 +, Steven D'Aprano wrote: > > >> On Sat, 15 Jun 2013 02:42:55 -0700, subhabangalore wrote: > > >>> Dear Group, > > >>> I am trying to search the following pat

Re: Debugging memory leaks

2013-06-14 Thread rusi
On Jun 15, 5:16 am, Ben Finney wrote: > rusi writes: > > On Jun 14, 1:15 am, Giorgos Tzampanakis > > wrote: > > > Am I the only one who thinks this is terrible advice? > > > I would expect a typical desktop app to run for a couple of hours -- > > maybe a

Re: Eval of expr with 'or' and 'and' within

2013-06-14 Thread rusi
On Jun 14, 11:03 pm, Antoon Pardon wrote: > Op 14-06-13 18:09, Steven D'Aprano schreef: > > > > > > > > > > > On Fri, 14 Jun 2013 11:14:16 +0100, Robert Kern wrote: > > >> On 2013-06-14 10:50, Nick the Gr33k wrote: > > [snip question] > >>> This is all iw ant to know. > > >> This is all you need t

Re: Eval of expr with 'or' and 'and' within

2013-06-14 Thread rusi
On Jun 14, 9:09 pm, Steven D'Aprano wrote: > On Fri, 14 Jun 2013 11:14:16 +0100, Robert Kern wrote: > > On 2013-06-14 10:50, Nick the Gr33k wrote: > [snip question] > >> This is all iw ant to know. > > > This is all you need to read: > > >    http://docs.python.org/2/reference/expressions.html#boo

Re: Wrong website loaded when other requested

2013-06-14 Thread rusi
On Jun 14, 8:37 pm, Nick the Gr33k wrote: > > PLEASE SUGGEST SOMETHING! A lollipop maybe? -- http://mail.python.org/mailman/listinfo/python-list

Re: A certainl part of an if() structure never gets executed.

2013-06-14 Thread rusi
On Jun 14, 6:48 pm, Zero Piraeus wrote: > : > > On 14 June 2013 09:07, Nick the Gr33k wrote: > > > > > Thanks for explaining this but i cannot follow its logic at all. > > My mind is stuck trying to interpret it as an English sentence: > > > if ('Parker' and 'May' and '2001') > > > if ('Parker' o

Re: Debugging memory leaks

2013-06-14 Thread rusi
On Jun 14, 1:15 am, Giorgos Tzampanakis wrote: > Am I the only one who thinks this is terrible advice? I would expect a typical desktop app to run for a couple of hours -- maybe a couple of days. Living with a small (enough) leak there may be ok. [In particular I believe that most commercial apps

Re: Debugging memory leaks

2013-06-14 Thread rusi
On Jun 13, 6:24 am, writeson wrote: > Anyway, my real question is how to go about debugging memory leak problems in > Python, particularly for a long running > server process written with Twisted. I'm not sure how to use heapy or guppy, > and objgraph doesn't tell me enough to > locate the probl

Re: Don't feed the help-vampire

2013-06-14 Thread rusi
On Jun 14, 4:51 pm, rusi wrote: > On Jun 14, 3:20 pm, Fábio Santos wrote: > > > > Come on now, this is _so_ obviously trolling, it's not even remotely > > > funny anymore. Why doesn't killfiling work with the mailing list version of > > the python list? :

Re: Don't feed the troll... (was: Re: A few questiosn about encoding)

2013-06-14 Thread rusi
On Jun 14, 3:20 pm, Fábio Santos wrote: > > Come on now, this is _so_ obviously trolling, it's not even remotely > > funny anymore. Why doesn't killfiling work with the mailing list version of > the python list? :-( > > I have skimmed the archives for this month, and I estimate that a third of > t

Re: Creating a Super Simple WWW Link, Copy, & Paste into Spreadsheet Program

2013-06-13 Thread rusi
On Jun 14, 12:28 am, buford.lum...@gmail.com wrote: > Hi, I'm new to Python. Would someone be able to write me and/or to show me > how to write a simple program that: > > 1-follows a hyperlink from MS Excel to the internet (one of many links like > this,http://www.zipdatamaps.com/76180, for e.g.)

Re: Python biases [was Re: My son wants me to teach him Python]

2013-06-13 Thread rusi
On Jun 14, 5:44 am, Steven D'Aprano wrote: > On Thu, 13 Jun 2013 06:37:34 -0700, rusi wrote: > > Python-the-language has strengths that are undermined by the biases in > > the culture of Python. > > This implies that there are strengths in Python-the-language whic

Re: My son wants me to teach him Python

2013-06-13 Thread rusi
On Jun 13, 9:50 pm, Tomasz Rola wrote: > I've reposted on another list and got this reply. At first I was sceptic > a bit, but for the sake of completeness, here goes. Processing language > seems to be interesting in its own right. Examples are Java-flavoured, > images are ok. > > Regards, > Tomas

Re: Wrong website loaded when other requested

2013-06-13 Thread rusi
On Jun 13, 7:28 pm, Chris Angelico wrote: > On Fri, Jun 14, 2013 at 12:23 AM, Íéêüëáïò Êïýñáò > wrote: > > Please suggest something of why this happnes. > > You remind me of George. > > http://www.chroniclesofgeorge.com/ > > ChrisA HA! You are evil -- Chris! -- http://mail.python.org/mailman/l

Re: My son wants me to teach him Python

2013-06-13 Thread rusi
On Jun 13, 6:07 pm, Roy Smith wrote: > In article > <545a441b-0c2d-4b1e-82ae-024b011a4...@e1g2000pbo.googlegroups.com>, > >  rusi wrote: > > Python is at least two things, a language and a culture. > > This is true of all languages.  Hang out on the PHP, Ruby,

Re: My son wants me to teach him Python

2013-06-13 Thread rusi
On Jun 13, 12:46 am, John Ladasky wrote: > Hi folks, > > My son is 17 years old.  He just took a one-year course in web page design at > his high school.  HTML is worth knowing, I suppose, and I think he has also > done a little Javascript.  He has expressed an interest in eventually wanting >

Re: A certainl part of an if() structure never gets executed.

2013-06-13 Thread rusi
On Jun 12, 8:20 pm, Zero Piraeus wrote: > : > > On 12 June 2013 10:55, Neil Cerutti wrote: > > > > > He's definitely trolling. I can't think of any other reason to > > make it so hard to kill-file himself. > > He's not a troll, he's a help vampire: > >  http://slash7.com/2006/12/22/vampires/ > >

Re: Version Control Software

2013-06-13 Thread rusi
On Jun 13, 7:30 am, Ben Finney wrote: > > You should be wary of GitHub, a very popular Git hosting site. It uses > what amount to proprietary protocols, which encourage using GitHub's > specific interface instead of native Git for your operations and hide a > lot of the needless complexity; but th

Re: Version Control Software

2013-06-13 Thread rusi
On Jun 13, 4:26 pm, MRAB wrote: > On 13/06/2013 07:00, cutems93 wrote:> Thank you everyone for such helpful > responses! Actually, I have one > > more question. Does anybody have experience with closed source > > version control software? If so, why did you buy it instead of > > downloading open

Re: Version Control Software

2013-06-12 Thread rusi
On Jun 13, 11:00 am, cutems93 wrote: > Thank you everyone for such helpful responses! Actually, I have one more > question. Does anybody have experience with closed source version control > software? If so, why did you buy it instead of downloading open source > software? Does closed source vcs

Re: Turnign greek-iso filenames => utf-8 iso

2013-06-12 Thread rusi
On Jun 12, 7:42 pm, Mark Lawrence wrote: > On 12/06/2013 13:42, Νικόλαος Κούρας wrote: > > > > > Something you want me to try? > > I'd suggest suicide but that would no doubt start another stream of > questions along the lines of "How do I do it?". There's a saying in some Indian languages (unfor

Re: PYTHONPATH: dev and prod

2013-06-12 Thread rusi
On Jun 12, 6:29 pm, jacopo wrote: > > 1. How you run -- 'launch' -- the code -- from py and from prod > > when I have to test I use "python any_script.py"  but in production there is > a c++ program that is able to wrap and run python code (the technical details > are a bit beyond my knowledge)

Re: PYTHONPATH: dev and prod

2013-06-12 Thread rusi
On Jun 12, 4:10 pm, jacopo wrote: > this idea seemed perfect but it turned out that you have to execute the > module as a package > (python -m py.myscripts.any_script) otherwise I get an error on the relative > import. > Unfortunately I am working in a team and I do not have control on how the

Re: Split a list into two parts based on a filter?

2013-06-11 Thread rusi
On Jun 11, 10:37 pm, Chris Angelico wrote: > On Wed, Jun 12, 2013 at 3:23 AM, rusi wrote: > > On Jun 11, 10:05 pm, Fábio Santos wrote: > >> On 11 Jun 2013 17:47, "rusi" wrote: > > >> > [Of course I would prefer a 3-liner where the body of the for

Re: Split a list into two parts based on a filter?

2013-06-11 Thread rusi
On Jun 11, 10:05 pm, Fábio Santos wrote: > On 11 Jun 2013 17:47, "rusi" wrote: > > > [Of course I would prefer a 3-liner where the body of the for is > > indented :-) ] > > Is this an aside comprehension? Eh? Its a for-loop. Same as: for s in songs: (new_

Re: PYTHONPATH: dev and prod

2013-06-11 Thread rusi
On Jun 11, 9:28 pm, jacopo wrote: > I am developing my code in the path: > /py/myscripts > /py/mylib > In order to "import mylib", I need to add /py/mylib to PYTHONPATH. > > Now I want to save a snapshot of the current code in the production > directory, I will copy all in: > /prod/myscripts > /p

Re: Split a list into two parts based on a filter?

2013-06-11 Thread rusi
On Jun 11, 6:48 pm, Fábio Santos wrote: > > What I like so much about it is the .. if .. else .. Within the parenthesis > and the append() call outside these parenthesis. You can do this -- which does not mix up functional and imperative styles badly and is as much a 2-liner as Roy's original. n

Re: Build Python 2.7.5 - Modules missing

2013-06-11 Thread rusi
On Jun 10, 10:51 pm, Walter Hurry wrote: > On building Python 2.7.5 I got the following message: > > Python build finished, but the necessary bits to build these modules >  were not found: > dl                 imageop            linuxaudiodev > spwd               sunaudiodev > To find the necessar

Re: "Don't rebind built-in names*" - it confuses readers

2013-06-11 Thread rusi
On Jun 11, 12:09 pm, Peter Otten <__pete...@web.de> wrote: > Terry Jan Reedy wrote: > > Many long-time posters have advised "Don't rebind built-in names*. > > I'm in that camp, but I think this old post by Guido van Rossum is worth > reading to put the matter into perspective: Not sure what you ar

Re: "Don't rebind built-in names*" - it confuses readers

2013-06-10 Thread rusi
On Jun 11, 8:02 am, Steven D'Aprano wrote: > On Mon, 10 Jun 2013 19:36:44 -0700, rusi wrote: > > Pascal introduced the idea of block structure -- introduce a name at one > > level, override it at a lower level. [Ok ALgol introduced, Pascal > > popularized]. > > T

Re: "Don't rebind built-in names*" - it confuses readers

2013-06-10 Thread rusi
On Jun 11, 5:14 am, Terry Jan Reedy wrote: > Many long-time posters have advised "Don't rebind built-in names*. > > * Unless you really mean to mask it, or more likely wrap it, such as > wrapping print to modify some aspect of its operation than one cannot do > with its keyword parameters. The poi

Re: "Don't rebind built-in names*" - it confuses readers

2013-06-10 Thread rusi
On Jun 11, 5:53 am, Mark Janssen wrote: > > There's a subtle difference between a keyword and a built-in.  Good > > Python style generally avoids masking built-ins but allows it: > > Right, thank you for reminding me.  My C-mind put them in the same category. > -- > MarkJ > Tacoma, Washington Don

Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-06 Thread rusi
On Jun 7, 8:24 am, rusi wrote: > On Jun 7, 8:14 am, Mark Janssen wrote: > > > > > > > > > > > >> I am aware of what it means, but Python doesn't really have it (although > > >> it may evolve to it with annotations). > > > >

Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-06 Thread rusi
On Jun 7, 8:14 am, Mark Janssen wrote: > >> I am aware of what it means, but Python doesn't really have it (although > >> it may evolve to it with annotations). > > > No polymorphism huh? > > > py> len([1, 2, 3])  # len works on lists > > 3 > > py> len((1, 2))  # and on tuples > > 2 > > py> len({}

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread rusi
On Jun 7, 12:03 am, Lele Gaifax wrote: > You should *read* and *understand* the error message! When you *shout* at the deaf, the non-deaf get deaf . -- http://mail.python.org/mailman/listinfo/python-list

Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-06 Thread rusi
that goes on under Haskell. To make it very clear: In any science, when there are few people they probably understand the science. When the numbers explode, cargo-cult science happens. This does not change the fact that a few do still understand. Haskell is not exception. See below > >

Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-06 Thread rusi
On Jun 6, 9:08 pm, Robert Kern wrote: > On 2013-06-06 16:41, Chris Angelico wrote: > > > Anyway, regardless of your language, there's always some criteria that > > can't be coded. Suppose the valid input for a function were "integers > > whose square roots are integers but whose cube roots are not

Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-06 Thread rusi
On Jun 6, 8:26 pm, Chris Angelico wrote: > On Fri, Jun 7, 2013 at 12:09 AM, rusi wrote: > > When we switched from to python (via Scheme and a haskell- > > predecessor), I dont remember ever getting a segmentation fault. > > Oh, it's easy to segfault Python. > > im

Re: Bools and explicitness [was Re: PyWart: The problem with "print"]

2013-06-06 Thread rusi
On Jun 6, 6:45 am, Chris Angelico wrote: > On Thu, Jun 6, 2013 at 11:37 AM, Steven D'Aprano > > wrote: > > What prevents bugs is the skill of the people writing the code, not the > > compiler. > > +1 QOTW. In many Indian languages there is a saying: A poor dancer blames the crooked floor. [Yeah…

Re: Apache and suexec issue that wont let me run my python script

2013-06-05 Thread rusi
On Jun 5, 11:34 pm, Νικόλαος Κούρας wrote: > Here is the mails you sent to my customers for the other members to see. In the normal run of things, I would say Chris has done a horrible thing. In this case however, let us remember: Many people -- hardly exclusively Chris -- tried to educate you

Re: Source code to identify user through browser?

2013-06-05 Thread rusi
On Jun 5, 8:31 pm, Mark Lawrence wrote: > On 05/06/2013 16:18, rusi wrote: > > > > > > > > > > > On Jun 5, 8:10 pm, Carlos Nepomuceno > > wrote: > >>> From: nos...@nospam.com > >>> Subject: Source code to identify user through br

Re: Source code to identify user through browser?

2013-06-05 Thread rusi
On Jun 5, 8:10 pm, Carlos Nepomuceno wrote: > > From: nos...@nospam.com > > Subject: Source code to identify user through browser? > > Date: Wed, 5 Jun 2013 15:08:54 +0200 > > To: python-l...@python.org > > > Hello > > > I was wondering if some Python module were available to identify a > > user t

Re: create new python file

2013-06-04 Thread rusi
On Jun 4, 11:09 pm, kakararunachalserv...@gmail.com wrote: > Thank you so much! Why didn't i thought about that. So, can i program within > just by the print > statement? Or do i have to do something else. I'm sorry, i just learning > python. Thanks again! If you are just learning python, you al

Re: PyWart: The problem with "print"

2013-06-04 Thread rusi
On Jun 4, 5:23 pm, jmfauth wrote: > On 2 juin, 20:09, Rick Johnson wrote: > > > > > I never purposely inject ANY superfluous cycles in my code except in > > the case of testing or development. To me it's about professionalism. > > Let's consider a thought exercise shall we? > > > > The f

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-03 Thread rusi
On Jun 4, 3:37 am, Steven D'Aprano wrote: > (Note: this post is sent using UTF-8. If anyone reading this sees > mojibake, please make sure your email or news client is set to use UTF-8.) > > On Mon, 03 Jun 2013 05:54:30 -0700, rusi wrote: > > On Jun 3, 2:12 pm, Νικόλαος

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-03 Thread rusi
On Jun 3, 2:12 pm, Νικόλαος Κούρας wrote: > You are right Steven, i just renames the file 'Euxi tou Ihsou.mp3' => 'Eõ÷Þ > ôïõ Éçóïý.mp3' and… Is that how you renamed your file? In any case thats what I see!! [Dont whether to say: Its greek to me or its not greek to me!!] -- http://mail.python.

Re: Create a file in /etc/ as a non-root user

2013-06-01 Thread rusi
On Jun 2, 2:19 am, Denis McMahon wrote: > On Fri, 31 May 2013 02:12:58 -0700, BIBHU DAS wrote: > > Any Idea how to create a file in /etc as non-root user?Can i use umask > > or chmod...confused > > If you don't have root access, you probably shouldn't be trying to write > in /etc. If you need

Re: Can anyone please help me in understanding the following python code

2013-06-01 Thread rusi
On May 30, 2:48 pm, bhk...@gmail.com wrote: > Code : > - > def mergeSort(alist): >     print("Splitting ",alist) >     if len(alist)>1: >         mid = len(alist)//2 >         lefthalf = alist[:mid] >         righthalf = alist[mid:] > >         mergeSort(lefthalf) >         mergeSort(righthalf)

Re: Create a file in /etc/ as a non-root user

2013-05-31 Thread rusi
On May 31, 7:42 pm, Chris Angelico wrote: > On Sat, Jun 1, 2013 at 12:02 AM, Alister wrote: > > /etc is used to store configuration files for the operating system & if > > you inadvertently corrupt the wrong one then you could kill the system. > > Expanding on this: > > http://en.wikipedia.org/wi

Re: How clean/elegant is Python's syntax?

2013-05-31 Thread rusi
On May 31, 2:08 pm, Alister wrote: > On Thu, 30 May 2013 20:38:40 +0100, MRAB wrote: > > And additional argument (pun not intended) for putting sep second is > > that you can give it a default value: > > >     def join(iterable, sep=""): return sep.join(iterable) > > I think that is the winning ar

Re: How clean/elegant is Python's syntax?

2013-05-30 Thread rusi
p://blog.languager.org/2012/10/functional-programming-lost-booty.html > On Thu, 30 May 2013 10:12:22 -0700, rusi wrote: > > On Thu, May 30, 2013 at 9:34 AM, Ma Xiaojun > > wrote: > >> Wait a minute! Isn't the most nature way of doing/thinking "generating > >> 9x9 m

Re: How clean/elegant is Python's syntax?

2013-05-30 Thread rusi
On May 30, 11:36 pm, Ian Kelly wrote: > On Wed, May 29, 2013 at 8:49 PM, rusi wrote: > > On May 30, 6:14 am, Ma Xiaojun wrote: > >> What interest me is a one liner: > >> print '\n'.join(['\t'.join(['%d*%d=%d' % (j,i,i*j) for i in > &

Re: How clean/elegant is Python's syntax?

2013-05-30 Thread rusi
On May 30, 10:28 pm, Chris Angelico wrote: > On Fri, May 31, 2013 at 3:12 AM, rusi wrote: > > You associate the primal (f)act of thinking about programming with > > *doing* the generating. > > By contrast the functional programmer thinks about what *is* the > > resul

Re: How clean/elegant is Python's syntax?

2013-05-30 Thread rusi
On Thu, May 30, 2013 at 9:34 AM, Ma Xiaojun wrote: > > On Thu, May 30, 2013 at 10:49 AM, rusi wrote: > > Ha,Ha! The join method is one of the (for me) ugly features of python. > > You can sweep it under the carpet with a one-line join function and > > then wri

Re: Short-circuit Logic

2013-05-30 Thread rusi
On May 30, 5:58 pm, Chris Angelico wrote: > The alternative would be an infinite number of iterations, which is far far > worse. There was one heavyweight among programming teachers -- E.W. Dijkstra -- who had some rather extreme views on this. He taught that when writing a loop of the form i

Re: How clean/elegant is Python's syntax?

2013-05-29 Thread rusi
On May 30, 6:14 am, Ma Xiaojun wrote: > What interest me is a one liner: > print '\n'.join(['\t'.join(['%d*%d=%d' % (j,i,i*j) for i in > range(1,10)]) for j in range(1,10)]) Ha,Ha! The join method is one of the (for me) ugly features of python. You can sweep it under the carpet with a one-line jo

Re: Fatal Python error

2013-05-29 Thread rusi
On May 29, 5:43 pm, Joshua Landau wrote: > On 29 May 2013 13:25, Dave Angel wrote: > > > On 05/29/2013 07:48 AM, Joshua Landau wrote: > > >> Hello all, again. Instead of revising like I'm meant to be, I've been > >> delving into a bit of Python and I've come up with this code: > > > To start with

Re: detect key conflict in a JSON file

2013-05-29 Thread rusi
On May 29, 6:41 pm, Jabba Laci wrote: > > The real answer here is that JSON is probably not the best choice for > > large files that get hand-edited.  For data that you intend to hand-edit > > a lot, YAML might be a better choice. > > >> Currently the value of the second key silently overwrites th

Re: Short-circuit Logic

2013-05-29 Thread rusi
On May 29, 7:27 pm, Ahmed Abdulshafy wrote: > On Tuesday, May 28, 2013 3:48:17 PM UTC+2, Steven D'Aprano wrote: > > On Mon, 27 May 2013 13:11:28 -0700, Ahmed Abdulshafy wrote: > > > > That may be true for integers, but for floats, testing for equality is > > > > not always precise > > > Incorrect.

Re: Output is not coming with defined color

2013-05-29 Thread rusi
On May 29, 5:11 pm, Fábio Santos wrote: > On 29 May 2013 12:25, "Avnesh Shakya" wrote: > > > > > > > > > > > hi, > >    I am trying to display my output with different colour on terminal, > but it's > > coming with that colour code. > > Please help me how is it possible? > > > my code is - > > fr

Re: Text-to-Sound or Vice Versa (Method NOT the source code)

2013-05-29 Thread rusi
On May 29, 4:30 am, Dennis Lee Bieber wrote: > On Tue, 28 May 2013 15:10:03 + (UTC), Grant Edwards > declaimed the following in > gmane.comp.python.general: > > > On 2013-05-25, Rakshith Nayak wrote: > > > > Always wondered how sound is generated from text. Googling couldn't > > > help. Devs

Re: How to: Setuptools

2013-05-28 Thread rusi
On May 28, 6:40 pm, Mark Lawrence wrote: > On 28/05/2013 14:05, ray wrote: > > > > > The installation fails.  The report stated it could not find the file. > > Per: > > Looking down into the content of ez_setup.py, I find: > > 'setuptools-0.6c10-py2.6.egg': > > but there is no entry > > 'setuptool

Re: How to: Setuptools

2013-05-28 Thread rusi
On May 28, 6:05 pm, ray wrote: > On May 28, 7:26 am, Mark Lawrence wrote: > > > > > > > > > > > On 28/05/2013 13:03, rusi wrote: > > > > On May 28, 6:32 am, ray wrote: > > >> I would like to use easy_install, but can't figure out

Re: How to: Setuptools

2013-05-28 Thread rusi
On May 28, 6:32 am, ray wrote: > I would like to use easy_install, but can't figure out how to install it. > > I have 64-bit Python 2.7.5 on Windows 7. > > Following the instructions onhttps://pypi.python.org/pypi/setuptools, it says: > Download ez_setup.py and run it; it will download the appropr

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-28 Thread rusi
On May 28, 10:55 am, Νίκος Γκρ33κ wrote: > Ôç Ôñßôç, 28 ÌáÀïõ 2013 1:18:06 ð.ì. UTC+3, ï ÷ñÞóôçò Chris Angelico Ýãñáøå: > > > You're effectively asking people to put in a few minutes' work, > > sometimes quite a few minutes, to help you. Is it too much to hope > > that you'll spend one more minute

Re: How to: Setuptools

2013-05-27 Thread rusi
On May 28, 9:09 am, Carlos Nepomuceno wrote: > > > > Date: Mon, 27 May 2013 20:54:53 -0700 > > Subject: Re: How to: Setuptools > > From: rustompm...@gmail.com > [...] > > > Oooff! Talk of using sledgehammers to crack nuts... > > > All that is needed is to v

Re: How to: Setuptools

2013-05-27 Thread rusi
On May 28, 8:06 am, Carlos Nepomuceno wrote: > > > > Date: Mon, 27 May 2013 19:57:47 -0700 > > Subject: Re: How to: Setuptools > > From: rustompm...@gmail.com > > To: python-l...@python.org > > > On May 28, 6:45 am, Carlos Nepomuceno > > wrote: > >> curl -

Re: How to: Setuptools

2013-05-27 Thread rusi
On May 28, 6:45 am, Carlos Nepomuceno wrote: > curl -Ohttp://peak.telecommunity.com/dist/ez_setup.py > python ez_setup.py Curl comes built into windows?? Does not seem so... http://serverfault.com/questions/483754/is-there-a-built-in-command-line-tool-under-windows-like-wget-curl Also given that

Re: how to compare two json file line by line using python?

2013-05-26 Thread rusi
On May 27, 9:32 am, Avnesh Shakya wrote: > hi, >    how to compare two json file line by line using python? Actually I am > doing it in this way.. > > import simplejson as json > def compare(): >     newJsonFile= open('newData.json') >     lastJsonFile= open('version1.json') >     newLines = newJ

Re: Short-circuit Logic

2013-05-26 Thread rusi
On May 27, 5:40 am, Steven D'Aprano wrote: > On Sun, 26 May 2013 16:22:26 -0400, Roy Smith wrote: > > In article , > >  Terry Jan Reedy wrote: > > >> On 5/26/2013 7:11 AM, Ahmed Abdulshafy wrote: > > >> >       if not allow_zero and abs(x) < sys.float_info.epsilon: > >> >                  print("

Re: Text-to-Sound or Vice Versa (Method NOT the source code)

2013-05-25 Thread rusi
On May 25, 3:52 pm, Rakshith Nayak wrote: > Always wondered how sound is generated from text. Googling couldn't help. > Devs having knowledge about this could provide, the information, Links, URLs > or anything that could help. > > look for speech synthesis http://en.wikipedia.org/wiki/Speech

Re: help how to sort a list in order of 'n' in python without using inbuilt functions??

2013-05-24 Thread rusi
On May 25, 10:15 am, lokeshkopp...@gmail.com wrote: > On Friday, May 24, 2013 1:34:51 PM UTC+5:30, lokesh...@gmail.com wrote: > > i need to write a code which can sort the list in order of 'n' without use > > builtin functions > > > can anyone help me how to do? > >  Note: > the list only contains

Re: Utility to locate errors in regular expressions

2013-05-24 Thread rusi
On May 24, 5:58 pm, Malte Forkel wrote: > Finding out why a regular expression does not match a given string can > very tedious. I would like to write a utility that identifies the > sub-expression causing the non-match. My idea is to use a parser to > create a tree representing the complete regul

Python for philosophers

2013-05-19 Thread rusi
On May 17, 1:06 am, Citizen Kant wrote: > rusi said: > > > And let me suggest that you follow your own advise -- Can you say what > > you have to say in 1/10th the number of words? Ok if not 1/10th then > > 1/5th? 1-third? > > Thanks for the suggestion. I apologize f

Re: Software epigrams

2013-05-16 Thread rusi
On May 16, 7:37 pm, Chris Angelico wrote: > On Fri, May 17, 2013 at 12:23 AM, Neil Cerutti wrote: > > On 2013-05-16, F?bio Santos wrote: > >> And in Java we have factories, builders and builderfactories. > >> What's so relevant about them? Java is high level, no? > > > When I tried to pin down w

Re: Fwd: Fwd: Fwd: Python for philosophers

2013-05-16 Thread rusi
On May 16, 5:28 pm, Citizen Kant wrote: > > I'm just an honest and polite guy asking you guys a couple of simple out of > the box questions that are important for me. Everyone here has the freedom > to keep on with their own assumptions and beliefs. If someone's interested > on thinking outside th

Re: Python for philosophers

2013-05-15 Thread rusi
On May 16, 6:17 am, Tim Daneliuk wrote: > On 05/15/2013 08:01 PM, Ned Batchelder wrote: > > > On 5/11/2013 4:03 PM, Citizen Kant wrote: > >> Don't get me wrong. I can see the big picture and the amazing things that > >> programmers write on Python, it's just that my question points to the > >> l

Re: Software epigrams

2013-05-15 Thread rusi
On May 14, 8:08 am, Dan Sommers wrote: > On Tue, 14 May 2013 04:12:53 +1000, Chris Angelico wrote: > > On Tue, May 14, 2013 at 4:02 AM, Skip Montanaro wrote: > >>> 8. A programming language is low level when its programs require > >>> attention to the irrelevant. > >> I think "irrelevant" in this

Re: Python's sad, unimaginative Enum

2013-05-14 Thread rusi
On May 14, 2:24 pm, Jean-Michel Pichavant wrote: > - Original Message - > > On Mon, 13 May 2013 13:00:36 +0200, Jean-Michel Pichavant wrote: > > > > - Original Message - > > >> That's the title of this little beast > > >>http://www.acooke.org/cute/Pythonssad0.htmlif anybody's > > >

Re: Python for philosophers

2013-05-13 Thread rusi
On May 13, 9:24 pm, Chris Angelico wrote: > > Your final conclusion is of course correct; nothing we build can be > truly infinite. But we can certainly give some very good > approximations, if we're prepared to pay for them. The reality is, > though, that we usually do not want to pay for approxi

Re: Python for philosophers

2013-05-13 Thread rusi
On May 13, 7:41 am, Steven D'Aprano wrote: > Python is not well-modelled as a Finite State Machine. Python is > equivalent in computing power to a Turing Machine, while Finite State > Machines are much weaker, so there are things that Python can do that a > FSM cannot. Consider the following. Py

Re: Python for philosophers

2013-05-12 Thread rusi
On May 12, 7:17 pm, Citizen Kant wrote: > Maybe It'd be good if I explain myself a bit more. What I'm trying here is > to grasp Python from the game's abstraction point of view, as if it were, > for example, chess. That's why I need a real_player to point me to: (so to > speak, I wish I could expr

Re: Python for philosophers

2013-05-11 Thread rusi
On May 12, 9:22 am, rusi wrote: > On May 12, 3:16 am, alex23 wrote: > > > On 12 May, 06:10, Mark Janssen wrote: > > > > Wow.  You must be from another planet.  Find Socrates if you wish to > > > know these things.  He's from there also. > > > N

<    1   2   3   4   5   6   7   8   9   10   >