Re: Need help deriving a convertion function on python

2013-03-07 Thread Rick Johnson
On Thursday, March 7, 2013 2:25:42 PM UTC-6, johnn...@gmail.com wrote: > I have a computer programming assignment. I am completely > lost and i need some help. These are the questions that > are confusing me > > (a) Write a function which converts from gallons to cups2 How can we help you if we ha

Re: Why is Ruby on Rails more popular than Django?

2013-03-08 Thread Rick Johnson
On Thursday, March 7, 2013 10:50:52 PM UTC-6, rh wrote: > Choices are good. [...] Having one choice is a mess. And > look back at history and current events Sometimes "choices" are forced upon you without your consent or even without regard for the end users' well-being. In this case "choices" ar

Re: Any other screenwriters?

2013-03-08 Thread Rick Johnson
On Friday, March 8, 2013 3:07:59 PM UTC-6, Rick Dooling wrote: > I am an amateur Python person, and I usually learn just > enough to make one writing tool or another as I go, > because mainly I'm a writer, not a programmer. Recently, > I've been exploring a markdown syntax called Fountain for > scr

Re: Running external module and accessing the created objects

2013-03-09 Thread Rick Johnson
On Saturday, March 9, 2013 9:34:53 AM UTC-6, Kene Meniru wrote: > OK. Sorry to have caused all the confusion. Let me try > this again. Sounds to me like you should solve this problem in two manners: Interactive Input ==

Re: Running external module and accessing the created objects

2013-03-09 Thread Rick Johnson
On Saturday, March 9, 2013 11:21:20 AM UTC-6, Kene Meniru wrote: > Please see my last response to Dave Angel. I think it is > possible for a program to watch a file. I am not > interested in menus which is why I am going this route. I > could easily use PyQt to make this but I am not interested >

Re: how to déplace a circle in canvas python?

2013-03-09 Thread Rick Johnson
On Saturday, March 9, 2013 1:47:43 PM UTC-6, olsr@gmail.com wrote: > how to [translate] a circle in canvas tkinter python from > [one] position to an [another] position Well "translation" is by definition: "changing an objects position" > by a mouse click 'press' ['release'] or by delete the

Re: Any other screenwriters?

2013-03-09 Thread Rick Johnson
On Friday, March 8, 2013 11:36:05 PM UTC-6, richard...@gmail.com wrote: > Noted. But it seems to be the syntax the screenwriters and > their programmers have settled on for now. It's all > working pretty well. Just no Python or command-line > implementations yet. I didn't post seeking help to make

Re: how to get id of a line from his coordonée in tkinter python?

2013-03-09 Thread Rick Johnson
On Saturday, March 9, 2013 4:46:40 PM UTC-6, olsr@gmail.com wrote: > how to get id of a line from his coordonée in tkinter python? Each time you create a "canvas item", be it a rectangle, line, circle, or whatever..., the id of that object is returned as an integer. All you have to do is sav

Re: Running external module and accessing the created objects

2013-03-11 Thread Rick Johnson
On Monday, March 11, 2013 6:57:28 PM UTC-5, Kene Meniru wrote: > > -- > # contents of myapp.py > import math > > class MyApp(object): > def __init__(self): > super(MyApp, self).__init__() > self.name = "MyAppName" > > > def testFunction():

Re: how to couper contenier of a canvas in an outer canvas???

2013-03-14 Thread Rick Johnson
On Thursday, March 14, 2013 7:16:05 AM UTC-5, olsr@gmail.com wrote: > how to couper all the obejcts in a canvas in an auther canvas? Hmm, well before i can even start solving your problem, i'll need to spend some time figuring out what the hell you're problem is. o_O. "Maybe" you meant to sa

Re: how to couper contenier of a canvas in an outer canvas???

2013-03-15 Thread Rick Johnson
On Friday, March 15, 2013 7:00:15 AM UTC-5, olsr@gmail.com wrote: > i maybe don't talk english very well but at least i am not > a Rude,and you are not obligated to answering me much > less Mocking me ,i assure you that i will not post > anything anymore jackass > > thank you alex23 Wel

Re: how to couper contenier of a canvas in an outer canvas???

2013-03-15 Thread Rick Johnson
how to couper all the obejcts in a canvas in an auther canvas? On Friday, March 15, 2013 9:09:41 AM UTC-5, rusi wrote: > I dont usually bother about spelling/grammar etc. And I > think it silly to do so on a python list. However with > this question: > > On Mar 14, 5:16 pm, olsr.ka...@gmail.com w

PyWart: NameError trackbacks are superfluous

2013-03-16 Thread Rick Johnson
Sometimes many levels of trace messages can be helpful when detecting bugs, however, in the case of NameErrors, these "nuggets" ejected from deep within the bowls of the Python interpreter are nothing more than steaming piles of incomprehensible crap! We don't need multiple layers of traces f

Re: PyWart: NameError trackbacks are superfluous

2013-03-16 Thread Rick Johnson
On Saturday, March 16, 2013 4:19:34 PM UTC-5, Oscar Benjamin wrote: > > NameErrors can occur conditionally depending on e.g. the > arguments to a function. Consider the following script: > > # tmp.py > def broken(x): > if x > 2: > print(x) > else: > print(undefi

Re: PyWart: NameError trackbacks are superfluous

2013-03-16 Thread Rick Johnson
On Saturday, March 16, 2013 6:29:52 PM UTC-5, Oscar Benjamin wrote: > I wasn't looking to convince *you*, just to set the record > straight that this behaviour is sometimes useful. And you claim to "set the record strait" by posting code that *purposely* raises a NameError when some function para

Re: PyWart: NameError trackbacks are superfluous

2013-03-16 Thread Rick Johnson
On Saturday, March 16, 2013 6:48:01 PM UTC-5, Steven D'Aprano wrote: > On Sat, 16 Mar 2013 21:19:34 +, Oscar Benjamin wrote: > > [...] > > NameErrors can occur conditionally depending on e.g. the > > arguments to a function. Consider the following script: > [...] > > Correct, although in your e

Re: Python GUI questions

2013-03-19 Thread Rick Johnson
On Tuesday, March 19, 2013 2:01:24 PM UTC-5, maiden129 wrote: > Hello, > > I'm using python 3.2.3 and I'm making a program that show > the of occurrences of the character in the string in > Tkinter. > > My questions are: > > How can I make an empty Entry object that will hold a word > that a use

Re: Python GUI questions

2013-03-19 Thread Rick Johnson
On Tuesday, March 19, 2013 9:36:28 PM UTC-5, maiden129 wrote: > So should I redo my other code that I created with > the radioButtons to change the colors of a text? I believe so. Although you really should explain what your trying to achieve with this code. There is nothing wrong with wrapping

Re: Python GUI questions

2013-03-20 Thread Rick Johnson
On Tuesday, March 19, 2013 10:21:06 PM UTC-5, Terry Reedy wrote: > On 3/19/2013 10:16 PM, Ranting Rick wrote: > > [snip code] > > when I run this, and click the button, I get: > >TypeError: cbButton() missing 1 required positional argument: 'self' > > ...when I remove 'self' from cbButton, I

Re: Global NameError Fix?

2013-03-22 Thread Rick Johnson
On Thursday, March 21, 2013 7:24:17 PM UTC-5, Dave Angel wrote: > On 03/21/2013 07:43 PM, maiden129 wrote: > > Hello, > > > I'm using the version 3.2.3 of Python and I am having an > > issue in my program and I don't know how to fix it: > > > counterLabel["text"] = str(counter) > > NameError: glo

Re: Python IDLE

2013-03-22 Thread Rick Johnson
On Friday, March 22, 2013 12:11:32 PM UTC-5, Steve DeMicoli wrote: > Dear Sir, Madame, > > [...message body removed for fear of legal reprisals...] > > The information in this email and any attachments are > confidential and intended solely for the use of the > individual or entity to whom they a

Re: how does the % work?

2013-03-22 Thread Rick Johnson
On Friday, March 22, 2013 12:06:18 PM UTC-5, leonardo selmi wrote: > hi guys > > i wrote this example : > > name = raw_input("What is your name?") > quest = raw_input("What is your quest?") > color = raw_input("What is your favorite color?") > > print """Ah, so your name is %s, your quest is %s,

Re: how does the % work?

2013-03-23 Thread Rick Johnson
On Friday, March 22, 2013 11:29:48 PM UTC-5, Tim Roberts wrote: > You are using Python 3. In Python 3, "print" is a function that returns > None. So, the error is exactly correct. Wait a second... if he is in-fact using Python 3, then why did the call to a non-existent function named "raw_in

Re: how does the % work?

2013-03-23 Thread Rick Johnson
On Saturday, March 23, 2013 2:38:23 AM UTC-5, Steven D'Aprano wrote: > On Fri, 22 Mar 2013 21:29:48 -0700, Tim Roberts wrote: > > print('''Ah, so your name is %s, your quest is %s, and your > > favorite color is %s.''') % (name, quest, color) > > The difference between those two statements ma

Re: Crappy Python code of the day

2017-02-28 Thread Rick Johnson
On Wednesday, February 15, 2017 at 10:16:14 PM UTC-6, Steven D'Aprano wrote: > Oh, we know why the code is failing. We don't need help > diagnosing the UnboundLocalError exception. You're right: > there's an except pass around an assignment, so if the > assignment fails, `result` never gets set. >

Re: Exposing all methods of a class

2017-02-28 Thread Rick Johnson
On Sunday, February 26, 2017 at 2:15:58 PM UTC-6, Pete Dowdell wrote: > I use Python, mainly with Django, for work. I was wondering > if anyone has encountered an editor that could display a > class with all inherited methods included in the editor's > view of the class code. Personally, i'm a min

Re: Exposing all methods of a class

2017-03-01 Thread Rick Johnson
On Wednesday, March 1, 2017 at 4:51:34 AM UTC-6, Terry Reedy wrote: > The class listing provided by the pydoc module browser, > also in help(someclass), do list all methods. Try > >>> import tkinter > >>> help(tkinter.Text) > for instance. > > On 2/28/201

Re: FYI: Removing posts with All Cap Authors

2017-03-04 Thread Rick Johnson
On Saturday, March 4, 2017 at 3:05:57 PM UTC-6, Peter Pearson wrote: > I suspect I'm not the only fossil here who gets kinda > misty contemplating NNTP's history. Yeah. Well... Python-list has developed quite a reputation within usenet antiquities circles for its highly coveted collection of rare

Re: newbie question re classes and self

2017-03-29 Thread Rick Johnson
On Tuesday, March 28, 2017 at 3:09:45 AM UTC-5, loial wrote: > Can I pass self(or all its variables) to a class? > Basically, how do I make all the variables defined in self > in the calling python script available to the python class > I want to call? Your question, as presented, is difficult to

Re: Program uses twice as much memory in Python 3.6 than in Python 3.5

2017-03-29 Thread Rick Johnson
On Wednesday, March 29, 2017 at 8:17:01 PM UTC-5, Jan Gosmann wrote: > On 29 Mar 2017, at 20:12, Steve D'Aprano wrote: > > > If you can demonstrate this effect using simple example > > code without the external dependencies (using nothing but > > the standard library) and people can replicate it,

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-29 Thread Rick Johnson
On Sunday, March 26, 2017 at 1:21:18 PM UTC-5, Chris Angelico wrote: > On Mon, Mar 27, 2017 at 4:43 AM, Steve D'Aprano > wrote: > [...] So, for instance, Eryk Sun commented that my rounded > box example didn't render correctly in all fonts - but in > the future, a new version of those fonts could

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-29 Thread Rick Johnson
On Sunday, March 26, 2017 at 2:53:49 PM UTC-5, Chris Angelico wrote: > On Mon, Mar 27, 2017 at 6:25 AM, Mikhail V wrote: > > On 26 March 2017 at 20:10, Steve D'Aprano > > wrote: > >> On Mon, 27 Mar 2017 03:57 am, Mikhail V wrote: > I generally find that when people say that Unicode doesn't > so

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-29 Thread Rick Johnson
On Sunday, March 26, 2017 at 6:42:36 PM UTC-5, Mikhail V wrote: > And all text I currently read on my monitor are prerendered > bitmaps, refined manually for frequently used sizes, and > that is how it should be made. IOW there are much more > important aspects than the ability to scale a text lin

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-31 Thread Rick Johnson
On Thursday, March 30, 2017 at 12:43:59 AM UTC-5, Chris Angelico wrote: > Except that it doesn't actually take very much work to call > on someone else's library, which is what you get when you > use Unicode properly. (At least, assuming you're using a > decent language like Python, which comes wit

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-31 Thread Rick Johnson
On Thursday, March 30, 2017 at 2:58:53 AM UTC-5, Steven D'Aprano wrote: > On Wed, 29 Mar 2017 20:53:35 -0700, Rick Johnson wrote: > > > On Sunday, March 26, 2017 at 1:21:18 PM UTC-5, Chris Angelico wrote: > >> On Mon, Mar 27, 2017 at 4:43 AM, Steve D'Aprano >

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-03-31 Thread Rick Johnson
On Thursday, March 30, 2017 at 9:14:54 AM UTC-5, Steve D'Aprano wrote: > On Thu, 30 Mar 2017 03:21 pm, Rick Johnson wrote: > > > On Sunday, March 26, 2017 at 2:53:49 PM UTC-5, Chris Angelico wrote: > >> On Mon, Mar 27, 2017 at 6:25 AM, Mikhail V wrote: > >>

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Rick Johnson
On Saturday, April 1, 2017 at 11:01:03 AM UTC-5, Steve D'Aprano wrote: > On Sat, 1 Apr 2017 12:17 pm, Rick Johnson wrote: > > > Most people just quietly change the filename and move on > > There are over a billion people in China, almost a billion > more in India, a

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Rick Johnson
On Saturday, April 1, 2017 at 3:08:20 PM UTC-5, Mikhail V wrote: > On 1 April 2017 at 06:38, Rick Johnson wrote: > > On Thursday, March 30, 2017 at 9:14:54 AM UTC-5, Steve D'Aprano wrote: > > > > - and making band names look ǨØØĻ and annoy old fuddy- > > >

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Rick Johnson
On Saturday, April 1, 2017 at 9:18:14 PM UTC-5, Steve D'Aprano wrote: [...] > Even India has a literacy rate of 74%, which is not far off > the functional literacy rate in the US of 86%. > > http://www.huffingtonpost.com/2013/09/06/illiteracy-rate_n_3880355.html And your source is the HuffPo? Seri

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-03 Thread Rick Johnson
On Saturday, April 1, 2017 at 9:32:17 PM UTC-5, MRAB wrote: > Sometimes he mentions MUDs, sometimes he mentions Pike, but at least he > doesn't rant. I have not even _begun_ to rant. Yet... -- https://mail.python.org/mailman/listinfo/python-list

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-03 Thread Rick Johnson
On Sunday, April 2, 2017 at 11:26:50 AM UTC-5, Steve D'Aprano wrote: > On Sun, 2 Apr 2017 04:41 pm, Terry Reedy wrote: > > On 4/1/2017 12:00 PM, Steve D'Aprano wrote: > > > > > example of the Ugly American. > > > > As an American I resent your promotion and perpetuation of > > an ugly ethno-centr

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-03 Thread Rick Johnson
On Sunday, April 2, 2017 at 3:49:43 PM UTC-5, Gene Heskett wrote: > On Sunday 02 April 2017 12:26:40 Steve D'Aprano wrote: > > On Sun, 2 Apr 2017 04:41 pm, Terry Reedy wrote: > > > On 4/1/2017 12:00 PM, Steve D'Aprano wrote: > > > > > > > > example of the Ugly American. > > > > > > As an American

Re: Find out which module a class came from

2017-04-07 Thread Rick Johnson
On Friday, April 7, 2017 at 7:49:11 PM UTC-5, Steve D'Aprano wrote: > But for merely ordinary obfuscation caused by poor design, > your best bet is probably to inspect Foo.__module__. > > You can also try: > > inspect.getsource(FooClass) > inspect.getsourcefile(FooClass) Hmm, I tried that code b

Re: read in a list in a file to list

2017-04-08 Thread Rick Johnson
@John General debugging methodology dictates that when your output does not match your expectation, you must never assume anything. Here you made the fatal mistake of assuming that: (1) files are stored as list objects, or (2) Python automatically converts file data to list objects, or (3) that py

Re: Python and the need for speed

2017-04-09 Thread Rick Johnson
On Sunday, April 9, 2017 at 2:39:18 AM UTC-5, Steven D'Aprano wrote: > On Sun, 09 Apr 2017 13:57:28 +1000, Chris Angelico wrote: > > I don't know anyone who has ever said "this interpreter is > too fast, can you make it run slower?" LOL! > [...] > > Well, maybe. As is pointed out many, many times

Re: Python and the need for speed

2017-04-09 Thread Rick Johnson
On Sunday, April 9, 2017 at 4:05:57 AM UTC-5, Chris Angelico wrote: > On Sun, Apr 9, 2017 at 5:39 PM, Steven D'Aprano wrote: > > Even better would be if the compiler was smart enough to > > use the optimized, fast runtime when the dynamic features > > aren't used, and fall back on a slower implem

Re: Python and the need for speed

2017-04-09 Thread Rick Johnson
On Sunday, April 9, 2017 at 1:34:39 PM UTC-5, bartc wrote: > On 09/04/2017 04:57, Chris Angelico wrote: > > On Sun, Apr 9, 2017 at 10:20 AM, wrote: > > > I've an idea that > > > http://www.mos6581.org/python_need_for_speed is a week > > > late for April Fool's but just in case I'm sure that some

Re: Python and the need for speed

2017-04-09 Thread Rick Johnson
On Sunday, April 9, 2017 at 7:21:21 PM UTC-5, Gregory Ewing wrote: > My take on the idea of making Python less dynamic in order > to improve speed is that you'll end up with a language > that, while it may superficially resemble Python, doesn't > really feel like Python. Boo is an example of that.

Re: Python and the need for speed

2017-04-09 Thread Rick Johnson
On Saturday, April 8, 2017 at 7:20:35 PM UTC-5, bream...@gmail.com wrote: > I've an idea that > http://www.mos6581.org/python_need_for_speed is a week late > for April Fool's but just in case I'm sure that some of you > may wish to comment. Might be a bit too late to dub this "April fools", but ne

Re: Swiss Ephemeris

2017-04-09 Thread Rick Johnson
On Sunday, April 9, 2017 at 8:52:44 PM UTC-5, Deborah Swanson wrote: > PS. I've been using medical astrology to look ahead at my > medical condition for years in advance. And being off by a > day or so doesn't matter that much when you're looking at > trends over the course of years and decades. I

Re: Python and the need for speed

2017-04-11 Thread Rick Johnson
On Monday, April 10, 2017 at 4:43:52 AM UTC-5, bartc wrote: > On 10/04/2017 03:40, Rick Johnson wrote: > > On Sunday, April 9, 2017 at 1:34:39 PM UTC-5, bartc wrote: > > > > I have my own interpreted language which I call > > > 'dynamic', but compared with P

Re: Python and the need for speed

2017-04-11 Thread Rick Johnson
On Monday, April 10, 2017 at 7:25:48 AM UTC-5, Mikhail V wrote: > Still I miss some old school features in Python, e.g. > "goto" statement would be very useful in some cases. Are you serious? > I know it is considered bad style to use goto, but in some > cases it is just most natural thing to us

Re: Python and the need for speed

2017-04-11 Thread Rick Johnson
On Monday, April 10, 2017 at 5:48:30 PM UTC-5, Erik wrote: > On 10/04/17 03:23, Chris Angelico wrote: > > Okay, I have a pretty thick skin, but this is getting a > > bit obnoxious. Can you PLEASE post something that isn't > > just insulting me? Thanks. > > Are you suggesting he should post somethi

Re: Python and the need for speed

2017-04-11 Thread Rick Johnson
On Tuesday, April 11, 2017 at 4:56:27 AM UTC-5, Brecht Machiels wrote: > On 2017-04-11 08:19:31 +, Steven D'Aprano said: > > > On Sun, 09 Apr 2017 19:05:35 +1000, Chris Angelico wrote: [...] > > The Python ecosystem is actually quite healthy, if you > > need to speed up code there are lots of

Re: Python and the need for speed

2017-04-11 Thread Rick Johnson
On Tuesday, April 11, 2017 at 9:56:45 AM UTC-5, Steve D'Aprano wrote: > On Tue, 11 Apr 2017 07:56 pm, Brecht Machiels wrote: > > On 2017-04-11 08:19:31 +, Steven D'Aprano said: > > > > I understand that high performance was never a goal in > > CPython development (and Python language design!),

Re: Python and the need for speed

2017-04-11 Thread Rick Johnson
On Tuesday, April 11, 2017 at 10:31:16 AM UTC-5, bartc wrote: > On 11/04/2017 15:56, Steve D'Aprano wrote: > > > The truth is, all of us in this discussion -- including me > > -- are "random, ignorant commentators". I don't believe > > that any of us are experts at writing compilers. Bart is > > a

Re: Swiss Ephemeris

2017-04-11 Thread Rick Johnson
On Monday, April 10, 2017 at 12:56:47 AM UTC-5, Deborah Swanson wrote: > Fully recognizing that most of what you wrote was tongue- > in-cheek, I just want to say that regardless of the wonders > of modern medicine, it's a pity they learn so little about > successful medicines other than their own.

Re: read in a list in a file to list

2017-04-11 Thread Rick Johnson
x27;s conduct an experiment... ## START INTERACTIVE SESSION (Python2.x) ## >>> aList = [1,2,3] >>> 'split' in dir(aList) False ## END INTERACTIVE SESSION (Python2.x) ## > The new attempt gives me a list, now I have to figure out > how to dea

Re: Python and the need for speed

2017-04-11 Thread Rick Johnson
On Tuesday, April 11, 2017 at 7:10:00 PM UTC-5, Mikhail V wrote: > On 12 April 2017 at 00:02, Rick Johnson wrote: > > On Monday, April 10, 2017 at 7:25:48 AM UTC-5, Mikhail V wrote: > > > Still I miss some old school features in Python, e.g. > > > "goto" s

Re: Python and the need for speed

2017-04-11 Thread Rick Johnson
On Tuesday, April 11, 2017 at 7:28:46 PM UTC-5, Nathan Ernst wrote: > > [...] > > Writing performant Python code is possible, but like > writing performant code in any other language, you need to > be aware of what's happening. This means paying attention > to things that may cause memory allocatio

Re: Python and the need for speed

2017-04-11 Thread Rick Johnson
On Tuesday, April 11, 2017 at 7:44:49 PM UTC-5, Nathan Ernst wrote: > goto is a misunderstood and much misaligned creature. It is > a very useful feature, but like nearly any programming > construct can be abused. Constructs like 'break', > 'continue' or 'next' in languages like Python or C/C++ ar

Re: Python and the need for speed

2017-04-14 Thread Rick Johnson
On Wednesday, April 12, 2017 at 1:48:57 AM UTC-5, Steven D'Aprano wrote: > On Tue, 11 Apr 2017 21:10:56 -0700, Rick Johnson wrote: > > > high level languages like Python should make it difficult, > > if not impossible, to write sub- optimal code (at least in > >

Re: Python and the need for speed

2017-04-14 Thread Rick Johnson
On Wednesday, April 12, 2017 at 4:30:16 AM UTC-5, alister wrote: > On Tue, 11 Apr 2017 16:31:16 -0700, Rick Johnson wrote: > > On Tuesday, April 11, 2017 at 9:56:45 AM UTC-5, Steve D'Aprano wrote: > >> On Tue, 11 Apr 2017 07:56 pm, Brecht Machiels wrote: > >> > O

Re: Python and the need for speed

2017-04-14 Thread Rick Johnson
On Wednesday, April 12, 2017 at 4:34:00 AM UTC-5, Brecht Machiels wrote: > On 2017-04-11 14:56:33 +, Steve D'Aprano said: > > On Tue, 11 Apr 2017 07:56 pm, Brecht Machiels wrote: > [...] > However, we don't really know how Python's performance is > affecting its popularity. It would be good to

Re: Python and the need for speed

2017-04-14 Thread Rick Johnson
On Wednesday, April 12, 2017 at 4:57:10 AM UTC-5, bart...@gmail.com wrote: > On Wednesday, 12 April 2017 07:48:57 UTC+1, Steven D'Aprano wrote: > > On Tue, 11 Apr 2017 21:10:56 -0700, Rick Johnson wrote: > > > > > > high level languages like Python should

Re: Python and the need for speed

2017-04-14 Thread Rick Johnson
On Wednesday, April 12, 2017 at 8:44:30 AM UTC-5, bart...@gmail.com wrote: > On Wednesday, 12 April 2017 12:56:32 UTC+1, Jussi Piitulainen wrote: > > bartc writes: > > > > > > These are straightforward language enhancements. > > > > FYI, the question is not how to optimize the code but how > > to

Re: Python and the need for speed

2017-04-14 Thread Rick Johnson
On Thursday, April 13, 2017 at 1:32:29 AM UTC-5, Gregory Ewing wrote: > Jussi Piitulainen wrote: > > Traceback (most recent call last): > > File "/dev/fd/63", line 37, in > > SanityClauseException: code is blatantly sub-optimal > > > > As far as I know, no language does that. Because reasons? >

Re: Python and the need for speed

2017-04-14 Thread Rick Johnson
On Thursday, April 13, 2017 at 1:32:28 AM UTC-5, Steven D'Aprano wrote: > On Wed, 12 Apr 2017 14:38:52 +0100, Ben Bacarisse wrote: > > Steve D'Aprano writes: > >> On Wed, 12 Apr 2017 03:39 am, Paul Rubin wrote: > > [...] Indeed, and this is a very common phenomenon: > features which "ordinary" prog

Re: Swiss Ephemeris

2017-04-14 Thread Rick Johnson
On Thursday, April 13, 2017 at 7:39:38 AM UTC-5, Rustom Mody wrote: > Quote from Peter Landin, one of the precursors of modern > functional programming: Most papers in computer science > describe how their author learned what someone else already > knew [And this dates from 60s/70s] Applies beyo

Re: Calling dunder methods manually

2017-04-15 Thread Rick Johnson
On Thursday, April 13, 2017 at 2:01:41 AM UTC-5, Serhiy Storchaka wrote: > > __init__ is perhaps the most called dunder method. It is > often called from the __init__ method of subclasses. Yes, that would be one of the exceptions to the rule, but not because the rule is unsound, but because Python

Re: Python and the need for speed

2017-04-15 Thread Rick Johnson
On Saturday, April 15, 2017 at 7:17:55 AM UTC-5, bartc wrote: > On 15/04/2017 03:35, Rick Johnson wrote: > > On Wednesday, April 12, 2017 at 8:44:30 AM UTC-5, bart...@gmail.com wrote: > > > At a minimum, every language should offer > > the following four loop-forms

Re: Teaching the "range" function in Python 3

2017-06-29 Thread Rick Johnson
On Thursday, June 29, 2017 at 4:01:07 PM UTC-5, Irv Kalb wrote: > > [...] > > But Python 3's version of the range function has been > turned into a generator. Again, I understand why this > happened, and I agree that this is a good change. The > problem is, how can I explain this concept to stude

Re: Converting sentences to vector form

2017-06-29 Thread Rick Johnson
On Tuesday, June 27, 2017 at 6:15:31 AM UTC-5, Bhaskar Dhariyal wrote: > You can't train a model on words. https://youtu.be/dSIKBliboIo?t=52 -- https://mail.python.org/mailman/listinfo/python-list

Re: Can we please dump google groups completely?

2017-07-01 Thread Rick Johnson
On Saturday, July 1, 2017 at 4:19:47 PM UTC-5, bream...@gmail.com wrote: > Yes I know it's daft that it's where I'm posting from, but > I'm still banned from using the main mailing list. Why are you banned from Python-list? What did you do? And is that why you have moved to the "Bream" nym? > I'v

Re: Teaching the "range" function in Python 3

2017-07-02 Thread Rick Johnson
On Thursday, June 29, 2017 at 9:58:23 PM UTC-5, Chris Angelico wrote: > On Fri, Jun 30, 2017 at 12:33 PM, Rick Johnson > > A better *FIRST* example would be something like this: > > > > def add(x, y): > > return x + y > > > > When teaching a stu

Re: Teaching the "range" function in Python 3

2017-07-02 Thread Rick Johnson
On Saturday, July 1, 2017 at 12:48:39 AM UTC-5, Christian Gollwitzer wrote: > Am 30.06.17 um 04:33 schrieb Rick Johnson: > > And to further drive home the point, you can manually > > insert a list literal to prove this: > > > > >>> range(10) &g

Re: get value from list using widget

2017-07-06 Thread Rick Johnson
On Wednesday, July 5, 2017 at 4:15:34 PM UTC-5, Terry Reedy wrote: > On 7/5/2017 12:34 PM, jorge.conr...@cptec.inpe.br wrote: > > > I would like know dow can I select and get the value from > > a list of values uisng widgets. > > One way is to learn tkinter and then learn to use the > Listbox wid

Re: Test 0 and false since false is 0

2017-07-06 Thread Rick Johnson
On Thursday, July 6, 2017 at 9:29:29 PM UTC-5, Sayth Renshaw wrote: > I was trying to solve a problem and cannot determine how to filter 0's but > not false. > > Given a list like this > ["a",0,0,"b",None,"c","d",0,1,False,0,1,0,3,[],0,1,9,0,0,{},0,0,9] > > I want to be able to return this list

Re: Test 0 and false since false is 0

2017-07-06 Thread Rick Johnson
On Thursday, July 6, 2017 at 10:00:36 PM UTC-5, Sayth Renshaw wrote: > Is there an "is not" method that's not != so I can check is not false. Maybe. Or maybe /not/. :-P" One way to find out would be to fire up your python interpretor, and do some interactive testing. Here, allow me to cinge my ey

Re: Test 0 and false since false is 0

2017-07-06 Thread Rick Johnson
On Thursday, July 6, 2017 at 9:57:43 PM UTC-5, Skip Montanaro wrote: > I was trying to solve a problem and cannot determine how to filter 0's but > not false. > > > I'm typing on my phone so can't paste a session [...] I have not tried any for myself, but there are a few Python installations avail

Re: Check Python version from inside script? Run Pythons script in v2 compatibility mode?

2017-07-07 Thread Rick Johnson
On Friday, July 7, 2017 at 2:54:04 AM UTC-5, Steve D'Aprano wrote: > [...] That's now not only backwards compatible, but it is > forward compatible: if Python changes in the future to > bring reduce back into the built-in functions, your code > will automatically keep working. If python starts goi

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Rick Johnson
On Friday, July 14, 2017 at 2:40:43 AM UTC-5, Chris Angelico wrote: [...] > IMO the Python str type is adequate as a core data type. What we may > need, though, is additional utility functions, eg: > > * unicodedata.grapheme_clusters(str) - split str into a sequence of > grapheme clusters > * pang

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Rick Johnson
On Friday, July 14, 2017 at 2:40:43 AM UTC-5, Chris Angelico wrote: > [...] > What is the length of a string? How often do you actually > care about the number of grapheme clusters - and not, for > example, about the pixel width? (To columnate text, for > instance, you need to know about its width

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Rick Johnson
On Friday, July 14, 2017 at 12:43:50 PM UTC-5, Steve D'Aprano wrote: > Before you answer, does your answer apply to Arabic and > Thai as well as Western European languages? I find it interesting that those who bellyache the loudest about the "inclusivity of regional charator encodings" never dabbl

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Rick Johnson
On Saturday, July 15, 2017 at 7:29:14 PM UTC-5, Chris Angelico wrote: > [...] Also, that doesn't deal with > U+200B or U+180E, which have well-defined widths *smaller* than > typical Latin letters. (200B is a zero-width space. Is it a > character?) Of *COURSE* it's a character. Would you also con

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Rick Johnson
On Saturday, July 15, 2017 at 7:55:46 PM UTC-5, Steve D'Aprano wrote: > On Sun, 16 Jul 2017 12:31 am, Rick Johnson wrote: > > > I never hear Chinese or eastern Europeans > > bellyaching > > Do you speak much to Chinese and Eastern Europeans who > don't speak

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Rick Johnson
On Saturday, July 15, 2017 at 8:54:40 PM UTC-5, MRAB wrote: > You need to be careful about the terminology. You are correct. I admit I was a little loose with my terms there. > Is linefeed a character? Since LineFeed is the same as NewLine, then yes, IMO, linefeed is a character. > You might c

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Rick Johnson
On Saturday, July 15, 2017 at 9:33:49 PM UTC-5, Ben Finney wrote: > MRAB writes: [...] > > Is linefeed a character? You might call it a "control > > character", but it's not really a _character_, it's > > control/format _code_. > > And yet the ASCII and Unicode standard says code point 0x0A

Re: "Edit with IDLE" doesn't work any more ?

2017-07-15 Thread Rick Johnson
On Friday, April 28, 2017 at 8:23:43 AM UTC-5, Peter Otten wrote: > Stefan Ram wrote: > > > Peter Otten <__pete...@web.de> writes: > >>one of the modules in Python's standard library IDLE will try to run with > >>your module rather than the one it actually needs. Common candidates are > >>code.py

Re: Grapheme clusters, a.k.a.real characters

2017-07-16 Thread Rick Johnson
On Sunday, July 16, 2017 at 2:55:57 AM UTC-5, Marko Rauhamaa wrote: > Mikhail V : > > On Sat, 15 Jul 2017 05:50 pm, Marko Rauhamaa wrote: > > > > > > Random access to code points is as uninteresting as > > > random access to UTF-8 bytes. I might want random access > > > to the "Grapheme clusters, a

Re: Grapheme clusters, a.k.a.real characters

2017-07-16 Thread Rick Johnson
On Sunday, July 16, 2017 at 10:41:02 AM UTC-5, Rustom Mody wrote: > On Sunday, July 16, 2017 at 8:10:41 PM UTC+5:30, Rick Johnson wrote: > > On Sunday, July 16, 2017 at 2:55:57 AM UTC-5, Marko Rauhamaa wrote: > > > Mikhail V : > > > > On Sat, 15 Jul 2017

Re: Grapheme clusters, a.k.a.real characters

2017-07-16 Thread Rick Johnson
On Sunday, July 16, 2017 at 8:28:57 PM UTC-5, Steve D'Aprano wrote: > On Mon, 17 Jul 2017 01:40 am, Rustom Mody wrote: > > > On Sunday, July 16, 2017 at 8:10:41 PM UTC+5:30, Rick Johnson wrote: > [...] > > $ python > > Python 3.6.0 |Anaconda 4.3.1 (64-bit)|

Re: Combining every pair of list items and creating a new list.

2017-07-17 Thread Rick Johnson
On Monday, July 17, 2017 at 3:10:51 PM UTC-5, aaron.m@gmail.com wrote: > Hi, > > I'm having difficulty thinking about how to do this as a Python beginner. > > But I have a list that is represented as: > > [1,2,3,4,5,6,7,8] > > and I would like the following results: > > [1,2] [3,4] [5,6]

Re: Users of namedtuple: do you use the _source attribute?

2017-07-17 Thread Rick Johnson
On Monday, July 17, 2017 at 12:20:04 PM UTC-5, Steve D'Aprano wrote: > collections.namedtuple generates a new class using exec, > and records the source code for the class as a _source > attribute. Although it has a leading underscore, it is > actually a public attribute. The leading underscore >

Re: Grapheme clusters, a.k.a.real characters

2017-07-19 Thread Rick Johnson
On Tuesday, July 18, 2017 at 10:07:41 PM UTC-5, Steve D'Aprano wrote: > On Wed, 19 Jul 2017 12:10 am, Rustom Mody wrote: [...] > > Einstein: If you can't explain something to a six-year- > > old, you really don't understand it yourself. > > > > [...] > > Think about it: it simply is nonsense. If

Re: Grapheme clusters, a.k.a.real characters

2017-07-19 Thread Rick Johnson
On Tuesday, July 18, 2017 at 10:24:54 PM UTC-5, Steve D'Aprano wrote: > On Wed, 19 Jul 2017 10:08 am, Ben Finney wrote: > > > Gregory Ewing writes: > > > > > The term "emoji" is becoming rather strained these days. > > > The idea of "woman" and "personal computer" being > > > emotions is an inte

Re: Grapheme clusters, a.k.a.real characters

2017-07-19 Thread Rick Johnson
On Tuesday, July 18, 2017 at 7:35:13 PM UTC-5, Mikhail V wrote: > ChrisA wrote: > >On Wed, Jul 19, 2017 at 6:05 AM, Mikhail V wrote: > >> On 2017-07-18, Steve D'Aprano wrote: > > > > _Neither system is right or wrong, or better than the > > > > other._ > > > > > > If that is said just "not to hu

Re: Grapheme clusters, a.k.a.real characters

2017-07-19 Thread Rick Johnson
On Tuesday, July 18, 2017 at 10:37:18 PM UTC-5, Steve D'Aprano wrote: > On Wed, 19 Jul 2017 10:34 am, Mikhail V wrote: > > > Ok, in this narrow context I can also agree. > > But in slightly wider context that phrase may sound almost like: > > "neither geometrical shape is better than the other as

Re: Grapheme clusters, a.k.a.real characters

2017-07-19 Thread Rick Johnson
On Wednesday, July 19, 2017 at 1:57:47 AM UTC-5, Steven D'Aprano wrote: > On Wed, 19 Jul 2017 17:51:49 +1200, Gregory Ewing wrote: > > > Chris Angelico wrote: > >> Once you NFC or NFD normalize both strings, identical strings will > >> generally have identical codepoints... You should then be able

Re: Grapheme clusters, a.k.a.real characters

2017-07-19 Thread Rick Johnson
On Wednesday, July 19, 2017 at 5:29:23 AM UTC-5, Rhodri James wrote: > when Acorn were developing their version of extended ASCII > in the late 80s, they asked three different University > lecturers in Welsh what extra characters they needed, and > got three different answers. And who would have g

<    5   6   7   8   9   10   11   >