Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)

2012-06-11 Thread Rick Johnson
On Jun 11, 9:09 am, Mark Roseman wrote: > Second, there does exist at least one fairly good source of > documentation for new users wishing to do exactly this (according to > many, many comments I have received), though that documentation is > admittedly buried in a sea of out-of-date informatio

Re: Run Windows commands from Python console

2017-09-03 Thread Rick Johnson
On Sunday, September 3, 2017 at 7:57:14 AM UTC-5, g.mor...@gmail.com wrote: > Hello, > > I run Python console in Windows. Can I run cmd prompt commands there? > > If I run command dir I have: > > >>> dir > > > What does it means? It means that the expression `dir` (in python's universe) is a

Re: Can I use functions while defining paths?

2017-09-04 Thread Rick Johnson
> Trying to import my made module to python with helper function: > > import os.path.join > ("D","pyth_nonsens","workspace_python","PyhonTutorial","reader") There are esoteric methods by which one can import a python module from a filepath, but doing so is not considered good practice, and the

Re: meaning of [ ]

2017-09-04 Thread Rick Johnson
On Monday, September 4, 2017 at 9:27:23 AM UTC-5, Rustom Mody wrote: > On Monday, September 4, 2017 at 6:36:11 PM UTC+5:30, Ben Bacarisse wrote: > > Rustom Mody writes: > > > > > On Sunday, September 3, 2017 at 5:10:13 PM UTC+5:30, Rick Johnson wrote: > > >>

Re: Run Windows commands from Python console

2017-09-04 Thread Rick Johnson
Terry Reedy wrote: [...] > In IDLE, trackbacks *do* include source lines. > > >>> def f(): > return 1/0 > > >>> f() > Traceback (most recent call last): >File "", line 1, in > f() >File "", line 2, in f > return 1/0 > ZeroDivisionError: division by zero One of the few

Re: Case-insensitive string equality

2017-09-04 Thread Rick Johnson
Steven D'Aprano wrote: [...] > (1) Add a new string method, which performs a case- > insensitive equality test. Here is a potential > implementation, written in pure Python: > > def equal(self, other): > if self is other: > return True > if not isinstance(other, str): > rai

Re: Run Windows commands from Python console

2017-09-05 Thread Rick Johnson
Terry Reedy wrote: > Rick Johnson wrote: [...] > > When i'm away from an editor (like IDLE, for instance), > > one of the features i miss most is the ability to right > > click the line of the exception message (you know, the one > > that includes the off

Re: Design: method in class or general function?

2017-09-09 Thread Rick Johnson
On Thursday, September 7, 2017 at 7:16:25 AM UTC-5, Steve D'Aprano wrote: > Python 2.6 is ancient, Enough with your hyperbole! Python 2.6 is no where near being ancient. Python 2.6 is a stable version that gets the job done for many folks in this community. Folks who actually spend their time get

Re: Design: method in class or general function?

2017-09-09 Thread Rick Johnson
On Thursday, September 7, 2017 at 7:35:45 AM UTC-5, Ben Finney wrote: > Another, more compelling, reason to follow [Steven's] > advice: Python 2 is in maintenance-only mode and will > receive no support at all in a few years. So what? The OP may not be the type who needs to have his diaper change

Re: Design: method in class or general function?

2017-09-09 Thread Rick Johnson
Marko Rauhamaa wrote: > Ben Finney wrote: > > Another, more compelling, reason to follow that advice: > > Python 2 is in maintenance-only mode and will receive no > > support at all in a few years. It is a dead end. Python 3 > > is actively developed and will be supported indefinitely. > > This re

Re: Design: method in class or general function?

2017-09-09 Thread Rick Johnson
Ben Finney wrote: > leam hall writes: > > > > I've wrestled with that discussion for a while and Python > > 3 loses every time. > > The context of the thread you started was that you are a > *newcomer* to Python. Now you say you've considered Python > 2 versus Python 3 many times? What explains t

Re: Using Python 2

2017-09-09 Thread Rick Johnson
Marko Rauhamaa wrote: > The risk to Python will be whether the occasion is > exploited by fanboys of competing programming languages. > The migration from Python 2 might be to something else than > Python 3 in some circles. That has been my observation as well. Python-dev and Python- ideas have be

Re: Using Python 2

2017-09-09 Thread Rick Johnson
Chris Angelico wrote: > And the sky is going to fall on Chicken Little's head, any > day now. Let's see. You can port your code from Python 2.7 > to Python 3.6 by running a script and then checking the > results for bytes/text problems. This is an argument i find interesting: First, the Python3 j

Re: Using Python 2

2017-09-09 Thread Rick Johnson
On Friday, September 8, 2017 at 8:57:56 AM UTC-5, Ned Batchelder wrote: > On 9/8/17 6:12 AM, Leam Hall wrote: > > I've read comments about Python 3 moving from the Zen of Python. I'm a > > "plain and simple" person myself. Complexity to support what CompSci > > folks want, which was used to describ

Re: Using Python 2

2017-09-09 Thread Rick Johnson
On Friday, September 8, 2017 at 9:22:52 AM UTC-5, leam hall wrote: > To say Python 2 is old is true. Old? Yes. Ancient? BS! > What does it matter though? Unless Python 3 provides a > business value for spending lots of time and money to > change then "old" doesn't matter. If the code performs t

Re: Using Python 2

2017-09-09 Thread Rick Johnson
On Friday, September 8, 2017 at 9:41:55 AM UTC-5, Chris Angelico wrote: > False dichotomy. [Python3 was] not a total rewrite, but it > fixes certain long-standing issues. Compatibility had to be > broken in order to change certain behaviours. Namely: maintenance programmers who dared to take a bre

Re: Using Python 2

2017-09-09 Thread Rick Johnson
On Friday, September 8, 2017 at 10:42:44 AM UTC-5, Steve D'Aprano wrote: > To be perfectly rational, we *should* consider at least > three alternatives: > > (1) Stick with Python 2 and pay for support; > > (2) Migrate to Python 3; > > (3) Re-implement in some other language; > > and make a dis

Re: Using Python 2

2017-09-09 Thread Rick Johnson
Steve D'Aprano wrote: > Chris Angelico wrote: > But some of us can't resist the temptation to evangelise > about Python 3 :-) An error that did not pass silently. Even when explicitly requested. > > Also, be completely honest here: how much work would it > > take for you to move your "millions o

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-10 Thread Rick Johnson
Chris Angelico wrote: > Marko Rauhamaa wrote: [...] > > The clouds I see looming over Python's head are: > > > > * 2-to-3 migration > > If that was going to kill Python, it would have had some > impact by now. There are students learning Python *today* > who are never going to have to worry

Re: Using Python 2

2017-09-10 Thread Rick Johnson
Steve D'Aprano wrote: > Rick Johnson wrote: > > Marko Rauhamaa wrote: > > > > > > The risk to Python will be whether the occasion is > > > exploited by fanboys of competing programming languages. > > > The migration from Python 2 might be to

Re: Using Python 2

2017-09-10 Thread Rick Johnson
Ian wrote: > Rick Johnson wrote: > > Ned Batchelder wrote: > > > Leam Hall wrote: > > > > > > > > I've read comments about Python 3 moving from the Zen of > > > > Python. I'm a "plain and simple" person myself. > &

Re: Run Windows commands from Python console

2017-09-10 Thread Rick Johnson
Stephan Houben wrote: > Rick Johnson schreef: > > > One of the nice (current) features of Tkinter menus (that > > i sometimes miss on my windows box!) is the ability to > > "tear- off" a menu cascade and use it as a sort of "pseudo > > tool bar&

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-10 Thread Rick Johnson
On Sunday, September 10, 2017 at 12:36:52 PM UTC-5, Ned Batchelder wrote: > On 9/10/17 10:46 AM, Rick Johnson wrote: > > The stain of Python3's violent and radical changes to the > > core philosophy of the language may never be washed clean, > > and although we m

Re: [Tutor] beginning to code

2017-09-10 Thread Rick Johnson
On Sunday, September 10, 2017 at 1:14:40 PM UTC-5, leam hall wrote: > I will add my +1 to the careful editing of code. Python's > use of white space is pretty good once you get used to it. Python's mandate that all blocks must use whitespace is by far my favorite feature. A clean code structure is

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-12 Thread Rick Johnson
Steve D'Aprano wrote: > Chris Angelico wrote: > > [...] > > > > > > Yet look at your answer; "upgrade". For a person working > > > on a server there's usually no economic choice to do. The > > > OS python must stay in place and the newly installed > > > upgrade must be personally maintained, upda

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-12 Thread Rick Johnson
On Tuesday, September 12, 2017 at 7:26:40 AM UTC-5, Chris Angelico wrote: [...] > Okay, I get the picture. Fine. You can stay on a version as > old as you like - but I'm not going to help you with > 2.6-specific issues. Fair? Chris, now you're just being a jerk. And while the decision whether or n

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-12 Thread Rick Johnson
Steve D'Aprano wrote: > Leam Hall wrote: > > > But if someone comes onto the list, or IRC, and says they > > need to stay on Python 2 then please drop the dozens of > > e-mails and comments about upgrading. > [...] > > My recent experience with some people's inability to take > > "Sorry, I can't"

Re: [Tutor] beginning to code

2017-09-12 Thread Rick Johnson
Chris Angelico wrote: > Rick Johnson wrote: > > Ruby: > > farray = [1.5, 1.9, 2.0, 1.0] > > uniqueIntegers = farray.map{|f| f.to_i()}.uniq.length > > > > Python: > > flist = [1.5, 1.9, 2.0, 1.0] > > uniqueIntegers = len(set(map(lam

Re: Run Windows commands from Python console

2017-09-12 Thread Rick Johnson
Stephan Houben wrote: > Rick Johnson schreef: > > It seems to me the best solution is for the TCL/Tk folks > > to provide a configuration utility that stores user > > preferences in the registry, or some other OS provided > > mechanism, as to have these settings reset

Re: [Tutor] beginning to code

2017-09-12 Thread Rick Johnson
Chris Angelico wrote: > Rick Johnson wrote: > > Chris Angelico wrote: > > > Rick Johnson wrote: > > > > > > > > Ruby: > > > > farray = [1.5, 1.9, 2.0, 1.0] > > > > uniqueIntegers = farray.map{|f| f.to_i()}.uniq.leng

Re: [Tutor] beginning to code

2017-09-12 Thread Rick Johnson
Paul Moore wrote: [...] > Ignoring stylistic choices (variable naming, map vs > generator) then for me the key distinction here is "lambda > f: int(f)" vs just "int". Python's callables (of which the > integer constructor int is one) are first class objects, so > you should just pass them directly

Re: [Tutor] beginning to code

2017-09-12 Thread Rick Johnson
alister wrote: > [...] > were i to be less generous I would suggest that you had > deliberately picked the worst python method you could think > of to make the point Feel free to offer a better solution if you like. INADA Naoki offered a good solution for Python3 folks, but AFAIK, set comprehensio

Re: Python dress

2017-09-12 Thread Rick Johnson
On Tuesday, September 12, 2017 at 6:59:32 PM UTC-5, Gregory Ewing wrote: > Larry Martell wrote: > > https://svahausa.com/collections/shop-by-interest-1/products/python-code-fit-flare-dress > > The only disadvantage might be the GIL interfering with > parallel processing using multiple machines in

Re: [Tutor] beginning to code

2017-09-12 Thread Rick Johnson
Chris Angelico wrote: > Rick Johnson wrote: > > So, what are your answers to my four questions: > > > > (1) Is it a speed issue? Then prove it. > > > > (2) Is it a readability issue? If so, then that's an > > opinion _you_ get to have. >

Re: Using Python 2

2017-09-12 Thread Rick Johnson
Gregory Ewing wrote: > Rick Johnson wrote: > > Heck, when is the last time GvR participated in any > > discussion outside the hermetic bubble of Python-Dev or > > Python-Ideas? > > I'd hardly call python-ideas "hermetic". Anyone is free to > post ther

Re: Simple board game GUI framework

2017-09-12 Thread Rick Johnson
Terry Reedy wrote: > Paul Moore said: [...] > I was going to suggest tkinter. I would second Terry's advice here. If a low barrier and simplicity are what you want, then i would suggest tkinter first and Pygame second. You can do a lot with a tk.Canvas widget, and for proper image support make sur

Re: [Tutor] beginning to code

2017-09-12 Thread Rick Johnson
Steven D'Aprano wrote: > Rick Johnson wrote: > > > > > But just because we have been trained that the implicit > > `if x:` is shorthand for the reasonable `if bool(x) == > > True:` > > That's not reasonable. bool(x) already returns a True or >

Re: "tkinter"

2017-09-13 Thread Rick Johnson
leam hall wrote: >Stefan Ram wrote: > > > I presume that "tkinter" is intended to be pronounced > > "logically": > > > > T K inter (tee kay inter /ti keI In t%/) > > > > . But it would be faster to pronounce it > > > > T kinter (tee kinter /ti kIn t%/) Since [Tt]kinter is a wrapper around "

Re: "tkinter"

2017-09-13 Thread Rick Johnson
Grant Edwards wrote: > I've always heard "tickle" as the pronounciation for "TCL". I've > never heard anybody try to pronounce TCL/Tk. Oh that's easy: {TICKLE-TEE-KAY}. (insert giggle track here) -- https://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] beginning to code

2017-09-13 Thread Rick Johnson
Steven D'Aprano wrote: > Rick Johnson wrote: > > Steven D'Aprano wrote: > >> Rick Johnson wrote: > > > > > > > > But just because we have been trained that the implicit > > > > `if x:` is shorthand for the reasonable `if bool(x) == &g

Re: [Tutor] beginning to code

2017-09-17 Thread Rick Johnson
Larry Hudson wrote: > ROGER GRAYDON CHRISTMAN wrote: [Note: RODGER's reply is slightly modified for clarity] > > I have not yet mastered how to respond to a particular > > note in a thread with the mailer that I use, so this is not > > in response to anyone in particular, but just to some of

Re: [Tutor] beginning to code

2017-09-17 Thread Rick Johnson
ROGER GRAYDON CHRISTMAN wrote: [Note: RODGER's words have been edited for clarity, and hopefully he won't mind.] > I have not yet mastered how to respond to a particular note > in a thread with the mailer that I use, so this is not in > response to anyone in particular, but just to some of t

Re: [Tutor] beginning to code

2017-09-17 Thread Rick Johnson
Steve D'Aprano wrote: > ROGER GRAYDON CHRISTMAN wrote: [...] > > And most definitely if x is assigned outside my control, I > > would definitely want some way to test or verify x's type > > before I start using it, lest my random number generator > > with its (A + B * C) % D finds itself conc

Re: Old Man Yells At Cloud

2017-09-17 Thread Rick Johnson
On Sunday, September 17, 2017 at 9:42:34 AM UTC-5, Steve D'Aprano wrote: > On Sun, 17 Sep 2017 11:51 pm, Tim Golden wrote: > > [Snip: Reasons why print function is better than print statement] > > I've wanted to do all those things, and more. I love the > new print function. For the cost of one e

Re: Old Man Yells At Cloud

2017-09-17 Thread Rick Johnson
Tim Chase wrote: > Steve D'Aprano wrote: > > Tim Golden wrote: > > Presumably you've never wanted to print to something other > > than std.out. The syntax in Python 2 is horrid: > > > > print >>sys.stderr, args > > For those cases, the old syntax was sufficiently horrid > that indeed I didn't us

Re: Old Man Yells At Cloud

2017-09-17 Thread Rick Johnson
Steve D'Aprano wrote: > Tim Chase wrote: > > > On 2017-09-18 00:42, Steve D'Aprano wrote: > > > On Sun, 17 Sep 2017 11:51 pm, Tim Golden wrote: > > > Presumably you've never wanted to print to something > > > other than std.out. The syntax in Python 2 is horrid: > > > > > > print >>sys.stderr, ar

Re: Old Man Yells At Cloud

2017-09-17 Thread Rick Johnson
MRAB wrote: > Rick Johnson wrote: > > Steve D'Aprano wrote: > >> Tim Golden wrote: > > > > > > [Snip: Reasons why print function is better than print statement] > > > > > > I've wanted to do all those things, and more. I love t

Re: [Tutor] beginning to code

2017-09-18 Thread Rick Johnson
On Sunday, September 17, 2017 at 7:12:46 PM UTC-5, Terry Reedy wrote: > The coinage 'Executable pseudocode' was my description of Python on > comp.lang.python, mirrored to this list, in April 1997, long before > I became a Python (core) dev. Guido did say things like 'human > readable' before th

Re: [Tutor] beginning to code

2017-09-18 Thread Rick Johnson
On Sunday, September 17, 2017 at 8:51:38 PM UTC-5, INADA Naoki wrote: > > > > > > > > I would agree that testing any of those for '== True' or > > > the like is pointless redundancy, > > > > But what's wrong with syntactical redundancy when it brings > > _clarity_ to the source code? And why can't

Re: [Tutor] beginning to code

2017-09-18 Thread Rick Johnson
Steve D'Aprano wrote: > [snip: offensive statements] > > Your insistence on adding the entirely superfluous, unnecessary Please acquaint yourself with the definition of superfluous, as in most i have seen, the actual word "unnecessary" is part of the definition. > and distracting "== True" at th

Re: Research paper "Energy Efficiency across Programming Languages: How does energy, time, and memory relate?"

2017-09-18 Thread Rick Johnson
On Saturday, September 16, 2017 at 9:01:41 PM UTC-5, Steve D'Aprano wrote: > [...] > - a giant down-pointing arrowhead, about three inches tall, > which turns grey when you mouse-over it but doesn't do > anything when clicked; Oh, it does something, just not an _obvious_ something. LOL. I tried to

Re: [Tutor] beginning to code

2017-09-19 Thread Rick Johnson
INADA Naoki wrote: > Rick Johnson wrote: > > INADA Naoki wrote: > > > > > > I can't agree with you. It's too redundant. It doesn't > > > provide any information about what coder think. > > > > It's not about what the "

Re: Old Man Yells At Cloud

2017-09-19 Thread Rick Johnson
On Tuesday, September 19, 2017 at 2:08:05 AM UTC-5, Steven D'Aprano wrote: > [...] > 5.6775 is a much more useful answer than Fraction(2271, 400). ("What's > that in real money?") Steven, you're not using floats for currency are you? Tsk tsk! Besides, if Python division returned a useless frac

Re: Old Man Yells At Cloud

2017-09-19 Thread Rick Johnson
On Tuesday, September 19, 2017 at 12:55:14 PM UTC-5, Chris Angelico wrote: > On Wed, Sep 20, 2017 at 3:44 AM, Stefan Ram wrote: > > Steve D'Aprano did *not* write > > [it was edited/abbreviated by me - S. R.]: > > |disadvantages: > > |0 - it makes print a special thing No more "special" than any

Re: Old Man Yells At Cloud

2017-09-19 Thread Rick Johnson
On Tuesday, September 19, 2017 at 1:31:52 PM UTC-5, bartc wrote: [...] > Can't you get around all those with things like > sys.stdout.write? Yes. > If so, what was the point of having a discrete print > statement/function at all? I believe the original intent was to create a universal symbo

Re: Greater and less than operators [was Re: [Tutor] beginning to code]

2017-09-20 Thread Rick Johnson
Steven D'Aprano wrote: > Rick Johnson wrote: > > > Of course, allowing all objects to use the `==`, `!=` > > sugars makes perfect sense, but `<`, `>`, `<=`, `>=` are > > meaningless outside of numeric-ish types. > > You've never wanted to sort

Re: [Tutor] beginning to code

2017-09-21 Thread Rick Johnson
Bill wrote: > Rick Johnson wrote: > > I think for most languages an intuitive syntax is not > > important -- C is such a language, Lisp is such a > > language, Perl is such a language, and there are many more > > -- but for Python, intuitiveness is very important. >

Re: [Tutor] beginning to code

2017-09-21 Thread Rick Johnson
INADA Naoki wrote: > Rick Johnson wrote [...] > > Of course, allowing all objects to use the `==`, `!=` > > sugars makes perfect sense, but `<`, `>`, `<=`, `>=` are > > meaningless outside of numeric-ish types. > > Now you know why Python 3 was born! It

Re: Old Man Yells At Cloud

2017-09-21 Thread Rick Johnson
On Thursday, September 21, 2017 at 10:12:25 AM UTC-5, Steve D'Aprano wrote: > [...] > And remember that the Python core developers feel your pain > too. They had to migrate a large code base (the Python std > library) from 2 to 3. They had to write the 2to3 > translator. And they have to maintain t

Re: Python Boolean Logic

2017-09-22 Thread Rick Johnson
On Friday, September 22, 2017 at 11:46:59 PM UTC-5, Cai Gengyang wrote: > Input : > > # Assign True or False as appropriate on the lines below! > > # (20 - 10) > 15 > bool_one = False# We did this one for you! > > # (10 + 17) == 3**16 > # Remember that ** can be read as 'to the power of'. 3*

Re: Old Man Yells At Cloud

2017-09-23 Thread Rick Johnson
Steve D'Aprano wrote: > Paul Rubin wrote: > > Steve D'Aprano writes: > > > Having to spend a few hours being paid to migrate code > > > using "print x" to "print(x)", or even a few months, is > > > not a life-changing experience. > > > > Didn't someone further up the thread mention some company >

Re: [Tutor] beginning to code

2017-09-23 Thread Rick Johnson
Mark Lawrence wrote: > [...] > I have no interest it what the C++ does, looks like or > anything else. All I'm bothered about is that two highly > respected members of the Python community have stated quite > clearly that Python is call by object. Many other people > have stated the same in this

Re: Printing a Chunk Of Words

2017-09-25 Thread Rick Johnson
On Monday, September 25, 2017 at 7:15:41 PM UTC-5, Cai Gengyang wrote: > """ > Boolean Operators > > True and True is True > True and False is False > False and True is False > False and False is False > > True or True is True > True or False is True > False or

Re: What use is of this 'cast=float ,'?

2017-10-28 Thread Rick Johnson
On Friday, October 27, 2017 at 3:35:45 PM UTC-5, Robert wrote: > I read below code snippet on line. I am interested in the > second of the last line: `cast=float`. I've tried it in > Python. Even simply with: `float` It has no error, but what > use is it? > > self.freqslider=forms.slider( >

Re: Coding style in CPython implementation

2017-10-29 Thread Rick Johnson
On Sunday, October 29, 2017 at 4:00:59 AM UTC-5, Στέφανος Σωφρονίου wrote: [...] > I guess the following parts from "Zen of Python" apply to this case: > > - Beautiful is better than ugly. > - Explicit is better than implicit. > - Simple is better than complex. > - Readability counts. Now go

Re: Invoking return through a function?

2017-10-29 Thread Rick Johnson
On Sunday, October 29, 2017 at 9:19:03 AM UTC-5, Alberto Riva wrote: > Hello, > > I'm wondering if there is a way of writing a function that > causes a return from the function that called it. To > explain with an example, let's say that I want to exit my > function if a dict does not contain a gi

Re: Invoking return through a function?

2017-10-29 Thread Rick Johnson
Alberto Riva wrote: > Rick Johnson wrote: > > Alberto Riva wrote: [...] > >> In a language like Lisp > > > > Python is nothing like Lisp, and for good reason! > > I would disagree with this. Actually, it's the most Lisp- > like language I've

Re: Invoking return through a function?

2017-10-29 Thread Rick Johnson
Alberto Riva wrote: > Rick Johnson wrote: > > Alberto Riva wrote: > >> Rick Johnson wrote: > >>> Alberto Riva wrote: > > [...] > > > > > > > > > > In a language like Lisp > > > > > > > > Python is noth

Re: Invoking return through a function?

2017-10-30 Thread Rick Johnson
Steve D'Aprano wrote: > > [...] > > I suppose it wouldn't be too awful if macros required > dedicated syntax, so at least you could distinguish between > "this is a safe, ordinary function" and "this is a macro, > it could mean anything". In the same spirit, i've been trying in vain for *YEARS*

Re: The syntax of replacement fields in format strings

2017-10-31 Thread Rick Johnson
On Tuesday, October 31, 2017 at 1:35:33 PM UTC-5, John Smith wrote: > If we keep the current implementation as is, perhaps the > documentation should at least be altered ? You should supply a concise code example that showcases why _you_ feel the docs are not satisfactory. It would help. -- https

Re: How to modify this from Python 2.x to v3.4?

2017-11-11 Thread Rick Johnson
On Saturday, November 11, 2017 at 8:07:06 PM UTC-6, jf...@ms4.hinet.net wrote: [...] > By the way, does anyone know what the following codes does? > (in printer.py file) and how to convert it to v3.x? > > class WrapperPrinter: > def __init__(self,outpath,options,data): > ... >

Re: from xx import yy

2017-11-13 Thread Rick Johnson
On Sunday, November 12, 2017 at 8:18:04 PM UTC-6, bvdp wrote: > I'm having a conceptual mind-fart today. I just modified a bunch of code to > use "from xx import variable" when variable is a global in xx.py. But, when I > change/read 'variable' it doesn't appear to change. I've written a bit of

Re: from xx import yy

2017-11-13 Thread Rick Johnson
On Monday, November 13, 2017 at 10:59:06 AM UTC-6, bvdp wrote: > Thanks all for confirming that I was wrong to use "from .. > import". In this case, but i wouldn't extrapolate that advice to mean that the form `from X import Y` is _always_ bad. You just need to understand the consequences of each

Re: matchpy

2017-11-13 Thread Rick Johnson
Chris Angelico wrote: > Edward Montague wrote: > > After successfully installing python 3.6.3 and the > > appropriate version of IDLE , I attempted to run a matchpy > > example , to no avail . I'm using a debian distribution , > > 8.x or greater , is there something I need to be aware of > > . The

Re: ANN: obfuscate 0.2.2

2017-11-13 Thread Rick Johnson
On Monday, November 13, 2017 at 6:03:23 PM UTC-6, joshj...@gmail.com wrote: > for importing obfuscate do we just type in import obfuscate > or import obfuscate 0.2.2 Oh boy. I had forgotten about this little community "gem" dating back to 2010. And unfortunately for comrade Steven, there is no way

Re: Time travel - how to simplify?

2017-11-14 Thread Rick Johnson
On Tuesday, November 14, 2017 at 1:44:17 PM UTC-6, Ben Finney wrote: > Andrew Z writes: > > > Now i want to get certain number of months. Say, i need 3 months duration > > starting from any month in dict. > > > > so if i start @ 7th: > > my_choice =7 > > for mnth, value in fut_suffix: > > i

Re: Artificial creating of [Lists], is it possible? the best way...

2017-11-17 Thread Rick Johnson
On Thursday, November 16, 2017 at 12:48:05 PM UTC-6, Jakub Raj ok wrote: > Artificial creating of [Lists], is it possible? the best way... There is nothing "artificial" about creating any object. Much less python lists. And i believe the usage of such word in the title of this thread was unfortun

Re: How to Generate dynamic HTML Report using Python

2017-11-21 Thread Rick Johnson
On Tuesday, November 21, 2017 at 5:57:42 AM UTC-6, Ned Batchelder wrote: [...] > [...] > I don't understand the motivation for limiting how words > are distributed, but others on this list also do it. For > example, Dennis Lee Bieber's messages are not in the > Python-List archives either. I call

Re: Student can't get if elif final statement to print for discussion post for python

2017-11-22 Thread Rick Johnson
Richard Damon wrote: > Cheri Castro wrote: > > I've tried several variations but haven't been able to > > figure out why my final if elif statement won't print. I > > tried using return, I tried using 1's and 0's rather than > > yes and no. Not sure what the issue is. Please, help. > > > > > > #Thi

Re: How to Generate dynamic HTML Report using Python

2017-11-22 Thread Rick Johnson
Chris Angelico wrote: > Gregory Ewing > > > > It looks like I'm going to have to filter Mr. Ram's posts > > out of my usenet feed as well, lest I accidentally show > > one of his URIs as a link on my screen. > > Or, just ignore his copyright altogether, and let him prove > its defensibility in co

Re: Increasing the diversity of people who write Python (was: Benefits of unicode identifiers)

2017-11-24 Thread Rick Johnson
On Thursday, November 23, 2017 at 9:57:12 PM UTC-6, Ben Finney wrote: [...] > This is a necessary consequence of increasing the diversity > of people able to program in Python: people will express > ideas originating in their own language, in Python code. > For that diversity to increase, we Englis

Re: Benefits of unicode identifiers (was: Allow additional separator in identifiers)

2017-11-24 Thread Rick Johnson
On Thursday, November 23, 2017 at 3:06:00 PM UTC-6, Chris Angelico wrote: > Seriously? Do I need to wrench this part out of you? This > was supposed to be the EASY question that everyone can > agree on, from which I can then draw my line of argument. Translation: "Dag-nab-it! You're supposed

Re: How to use a regexp here

2017-12-04 Thread Rick Johnson
Cecil Westerhof wrote: > Joel Goldstick writes: [...] > > I like Ned's clear answer, but I'm wondering why the > > original code would fail because the substring is at the > > start of the line, since 'in' would still be true no > > matter where the desired string is placed. It would be > >

Re: Please tell me how to execute python file in Ubuntu by double clicking on file.

2017-12-04 Thread Rick Johnson
On Monday, December 4, 2017 at 3:49:11 AM UTC-6, dhananjays...@gmail.com wrote: > I am Dhananjay Singh,Student of IIIT Manipur. Sir/Mam when > i am double click in python program (Dhananjay.py),it is > opening in Text Editor by Default in Ubuntu.I want to run > this program when i double click on i

Re: why won't slicing lists raise IndexError?

2017-12-04 Thread Rick Johnson
On Monday, December 4, 2017 at 1:10:01 PM UTC-6, Jason Maldonis wrote: > I was extending a `list` and am wondering why slicing lists will never > raise an IndexError, even if the `slice.stop` value if greater than the > list length. > > Quick example: > > my_list = [1, 2, 3] > my_list[:100] # does

Re: why won't slicing lists raise IndexError?

2017-12-04 Thread Rick Johnson
Terry Reedy wrote: [...] > try: > item = seq[n] > except IndexError > do_without_item() > else: > process(item) > > item = seq[n:n+1] > if item: > process(item) > else: > do_without_item() > > Many prefer the second. And they'll prefer it even more when they real

Re: why won't slicing lists raise IndexError?

2017-12-04 Thread Rick Johnson
Chris Angelico wrote: > wrote: > > Terry Reedy wrote: > > > > [...] > > > >> try: > >> item = seq[n] > >> except IndexError > >> do_without_item() > >> else: > >> process(item) > >> > >> item = seq[n:n+1] > >> if item: > >> process(item) > >> else: > >> do_without_item() >

Re: why won't slicing lists raise IndexError?

2017-12-04 Thread Rick Johnson
On Monday, December 4, 2017 at 6:13:19 PM UTC-6, Chris Angelico wrote: [...] > Ahhh, I see how it is. You didn't run the code, ergo you > don't understand it. Makes perfect sense. :) Being that Terry didn't offer any declarations or defintions for his variables or functions, i assumed,

Re: why won't slicing lists raise IndexError?

2017-12-04 Thread Rick Johnson
On Monday, December 4, 2017 at 7:47:20 PM UTC-6, Ned Batchelder wrote: [...] > Here are details filled in: > > $ python3.6 > Python 3.6.3 (default, Oct 4 2017, 06:03:25) > [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwin > Type "help", "copyright", "credits

Re: why won't slicing lists raise IndexError?

2017-12-04 Thread Rick Johnson
Ned Batchelder wrote: [...] > The point of the example was to demonstrate what happens > when slicing beyond the bounds of the list. It's beyond > the scope of the thread to debate whether you might want to > perform an action in that case. But, nevertheless, the else-clause is there! And th

Re: why won't slicing lists raise IndexError?

2017-12-05 Thread Rick Johnson
Ned Batchelder wrote: [...] > Your original statement sounded like, "The else clause can > never be executed," No. Of course not. Note that i mentioned _pragmatism_. My complaint about the else-clause was not that it could _never_ be executed, my complaint that was that the else- clause (in Terry

Re: Please tell me how to execute python file in Ubuntu by double clicking on file. (Posting On Python-List Prohibited)

2017-12-05 Thread Rick Johnson
On Tuesday, December 5, 2017 at 2:58:44 AM UTC-6, Lawrence D'Oliveiro wrote: > On Tuesday, December 5, 2017 at 3:39:26 AM UTC+13, Rick Johnson wrote: > > > > Sounds like your OS file associations are all botched-up ... > > Linux doesn't do "OS file associations

Re: why won't slicing lists raise IndexError?

2017-12-05 Thread Rick Johnson
Steve D'Aprano wrote: [...] > You've already been told that there's no indication or > reason to believe that it is a non-action. You've already > been given at least one possible action. It isn't a non- > action, it is two distinct actions: > > - the action you take when the slice is non-empty;

Re: we want python software

2017-12-06 Thread Rick Johnson
On Wednesday, December 6, 2017 at 2:14:40 AM UTC-6, Percival John Hackworth wrote: [...] > [...] > The good people (e.g. the friends I asked for advice) are > to busy to do such little projects to bother. Good work is not cheap. And cheap work is not good. > So the market is left with Junior p

Re: we want python software

2017-12-06 Thread Rick Johnson
On Wednesday, December 6, 2017 at 12:11:47 AM UTC-6, Chris Angelico wrote: [...] > To the OP: [...] The best thing to do here is to type > "python" into your favourite search engine (Google, > DuckDuckGo, Bing, AltaVista, etc), and then read the web > page for a download link. I don't think

Re: Politeness (was: we want python software)

2017-12-06 Thread Rick Johnson
Steve D'Aprano wrote: [...] > And yes, I'm aware of the irony of me taking this position > only a couple of posts after I asked the group to run some > code for me without explaining why I couldn't run it > myself.[1] [...] But if somebody wants to take me to task > for Your virtue signaling he

Re: why won't slicing lists raise IndexError?

2017-12-06 Thread Rick Johnson
On Wednesday, December 6, 2017 at 3:13:41 PM UTC-6, Python wrote: [...] > Geez, seriously? The snippet is purely academic, obviously > not a complete or useful program, Who ever made the claim that it was? > intended to illustrate that python can take two different > branches depending on whethe

Re: why won't slicing lists raise IndexError?

2017-12-06 Thread Rick Johnson
Terry Reedy wrote: [...] > Rick, cut the crap. If you do not understand that > 'something_else()' != 'pass', re-read the tutorial. How is the official tutorial going to give me any insight into an undefined symbol that you invented? Of course, we all understand that "something_else()" is merel

Re: why won't slicing lists raise IndexError?

2017-12-06 Thread Rick Johnson
Python wrote: [...] > THIS IS FALSE. CALLING A FUNCTION What *FUNCTION*? You think you can just slap a function-y looking symbol willy-nilly in the middle of a chunk of code and then have it "magically" transform into a python function object? >>> do_without_item() Traceback (most re

Re: we want python software

2017-12-06 Thread Rick Johnson
Gregory Ewing wrote: [...] > To be fair to this person, for someone who has a natural > aptitude for programming, it can be difficult to appreciate > how hard it is for people who don't. When I first started > programming, in my early teens, the basic ideas all seemed > very straightforward,

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