Re: PyWart: Language missing maximum constant of numeric types!

2012-02-24 Thread Rick Johnson
On Feb 24, 7:55 am, Mark Lawrence wrote: > Do you want to test for something that is larger than infinity? Not exactly. I want to set a constant that has a value of infinity and then do comparisons against the constant. ## # Hypothetical 1 # ## def confine(string

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-25 Thread Rick Johnson
On Feb 24, 6:35 pm, Mark Lawrence wrote: > I understand that a Python integer can run to infinity.  Quite how the > illustrious rr manages to test for the length of a string that's already > used all of the memory on his system has baffled me, When did i ever say that i would need a string who's

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-25 Thread Rick Johnson
On Feb 25, 11:54 am, MRAB wrote: > [...] > That should be: > if maxlength is not None and len(string) <= maxlength: Using "imaginary" infinity values defiles the intuitive nature of your code. What is more intuitive? def confine_length(string, maxlength=INFINITY): if string.length < maxlengt

Re: PyWart: Language missing maximum constant of numeric types!

2012-02-25 Thread Rick Johnson
On Feb 24, 7:50 pm, Steven D'Aprano wrote: > But it would also be rejected, and rightly so, as unnecessary complexity > for the int type. There are already Decimal and float infinities, just > use one of them. Sure there are float INFINITIES that work fine for ints and floats, but where is the c

Re: OT: Entitlements [was Re: Python usage numbers]

2012-02-26 Thread Rick Johnson
On Feb 26, 6:44 am, Albert van der Horst wrote: > I don't blame them for the attitude of "live to fight another day" > or even for plain survival. If the Jews hadn't allow themselves > to be subjected, there would be no Jews. And may i borrow your time machine now that you are finished researchin

Re: OT: Entitlements [was Re: Python usage numbers]

2012-02-26 Thread Rick Johnson
On Feb 26, 2:50 pm, Chris Angelico wrote: > Hmm, I wonder how you go about adopting that policy... oh! I know! By > fighting each bully on a case-by-case basis! Funny though, you just > said that won't work. It's a two-pronged solution Chris. Compound. -- http://mail.python.org/mailman/listinfo

Re: A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

2012-02-28 Thread Rick Johnson
On Feb 24, 8:54 am, Steven D'Aprano wrote: > for...else is a very useful construct, but the name is misleading. It > took me a long time to stop thinking that the else clause executes when > the for loop was empty. Agreed. This is a major stumbling block for neophytes. > In Python 4000, I think

Re: GUI for pickle read

2012-02-28 Thread Rick Johnson
On Feb 28, 12:13 pm, Jerry Hill wrote: > On Tue, Feb 28, 2012 at 12:51 PM, Smiley 4321 wrote: > > Can I have some thoughts about - building a GUI to display the results of > > the pickle read? Sure. But first can you show us some code that reads a pickled file and prints the contents? Hint: Why

Re: Is it necessary to call Tk() when writing a GUI app with Tkinter?

2012-02-29 Thread Rick Johnson
On Feb 28, 11:06 pm, John Salerno wrote: > The book I'm reading about using Tkinter only does this when creating the > top-level window: > > app = Application() > app.mainloop() > > and of course the Application class has subclassed the tkinter.Frame class. > > However, in the Python documentatio

Re: Is it necessary to call Tk() when writing a GUI app with Tkinter?

2012-02-29 Thread Rick Johnson
On Feb 29, 6:17 pm, Terry Reedy wrote: > On 2/29/2012 9:24 AM, Rick Johnson wrote: > > On Feb 28, 11:06 pm, John Salerno  wrote: > >> However, in the Python documentation, I see this: > > >> root = Tk() > >> app = Application(master=root) > >> app

PyTut: Tkinter #1

2012-02-29 Thread Rick Johnson
PyTut: Tkinter #1 Graciously donated by the benevolent professor Richard Johnson The first step to creating a Tkinter GUI is to create a blank window. Tkinter has two classes that represent a GUI window: Toplevel and Tk. Both the classes are basically the same, but since a GUI can have an unlimite

Re: Is it necessary to call Tk() when writing a GUI app with Tkinter?

2012-03-01 Thread Rick Johnson
On Feb 29, 10:41 pm, John Salerno wrote: > I'm not sure I understand which method you are advocating. It > sounded like you said calling Tk() explicitly is a bug. I am saying just the opposite: Allowing the module "Tkinter" to implicitly create a root window IF the programmer was too lazy to cre

Re: Is it necessary to call Tk() when writing a GUI app with Tkinter?

2012-03-01 Thread Rick Johnson
On Feb 29, 11:24 pm, Terry Reedy wrote: > On 2/29/2012 10:22 PM, Rick Johnson wrote: > > PS: I would highly suggest against using the "from Tkinter import *". > > Instead, use "import Tkinter as tk" and prefix all module contents > > with "tk."

Re: Is it necessary to call Tk() when writing a GUI app with Tkinter?

2012-03-01 Thread Rick Johnson
s like these broken docs tell you to, than after you become proficient you will understand. You will say: "That Rick really knew what he was talking about after all!" -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it necessary to call Tk() when writing a GUI app with Tkinter?

2012-03-01 Thread Rick Johnson
On Feb 29, 11:40 pm, John Salerno wrote: > The faulty code is not my own, which is part of the reason I asked > the question. The book I'm reading (The Quick Python Book) does not > use it, but I saw in the Python docs that it is there, under > "tkinter" in the Global Module Docs, "24.1.2.2. A Sim

Re: Is it necessary to call Tk() when writing a GUI app with Tkinter?

2012-03-01 Thread Rick Johnson
On Mar 1, 9:15 pm, John Salerno wrote: > > EXAMPLE 1: (this works, but is flawed!) > >  root = tk.Tk() > >  b = tk.Button(master=None, text='Sloppy Coder') > >  b.pack() > >  root.mainloop() > > > EXAMPLE 2: (This is how to write code!) > >  root = tk.Tk() > >  widgetframe = tk.Frame(root) > >  b

Re: Is it necessary to call Tk() when writing a GUI app with Tkinter?

2012-03-01 Thread Rick Johnson
On Mar 1, 8:49 pm, Rick Johnson wrote: > On Feb 29, 11:24 pm, Terry Reedy wrote: > > > On 2/29/2012 10:22 PM, Rick Johnson wrote: > > > PS: I would highly suggest against using the "from Tkinter import *". > > > Instead, use "import Tkinter as tk&q

Re: Is it necessary to call Tk() when writing a GUI app with Tkinter?

2012-03-03 Thread Rick Johnson
On Mar 2, 4:16 pm, John Salerno wrote: > what is the point of creating a Frame object at all? I tried NOT > doing it, like you said, and it seemed to work fine with my simple > example. But is there a benefit to using a Frame object to group the > widgets together? Or is it cleaner to just use the

Re: How do you use the widgets in tkinter.ttk if you want to "import tkinter as tk"?

2012-03-04 Thread Rick Johnson
On Mar 2, 11:06 pm, John Salerno wrote: > I'm tempted just to go back to wxPython. Two sets of widgets in Tkinter is a > little annoying. Your complaint is justified. The Tkinter API is a disgrace. IDLE's source is just as bad. Luckily i have not made the jump to py3000 full- time yet, but when

Re: Tkinter: Why aren't my widgets expanding when I resize the window?

2012-03-05 Thread Rick Johnson
On Mar 5, 1:12 am, John Salerno wrote: > I can't seem to wrap my head around all the necessary arguments > for making a widget expand when a window is resized. You will need to configure the root columns and rows also because the configurations DO NOT propagate up the widget hierarchy! Actually,

Re: Tkinter: Why aren't my widgets expanding when I resize the window?

2012-03-05 Thread Rick Johnson
On Mar 5, 11:31 am, John Salerno wrote: > Ok, so use pack when putting the frame into the root, since that's > all that goes into the root directly. But just out of curiosity, > what did I do wrong with using grid? How would it work with grid? If you read my post carefully, i said: "You need to u

Re: Tkinter: Why aren't my widgets expanding when I resize the window?

2012-03-05 Thread Rick Johnson
On Mar 5, 7:10 pm, Steven D'Aprano wrote: > John, it is polite to leave attributions in place when you quote > somebody. I don't know who you are quoting above, > [...] > Which is a pity, because I gather that Rick actually does know Tkinter > well. My, my. Between you

Re: Tkinter: Why aren't my widgets expanding when I resize the window?

2012-03-05 Thread Rick Johnson
On Mar 5, 8:33 pm, Mark Lawrence wrote: > please stick with the > Light rather than the Dark Side. You're correct. I need to ignore these negative distractions. Thanks for re-focusing the conversation. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is readable

2012-03-14 Thread Rick Johnson
On Mar 14, 7:27 pm, Chris Angelico wrote: > Okay, here's something for debate. > > Should the readability of a language be gauged on the basis of its > standard library, or should you be comparing actual code? I think the library matters greatly. Yes, one could argue that the same functionality "

Re: Nexus Programming Language

2012-06-10 Thread Rick Johnson
On Jun 10, 7:21 am, "Colin J. Williams" wrote: > On 10/06/2012 1:45 AM, rusi wrote: > > What does nexus have that python doesn't? > > Yeah I know this kind of question leads to flames but a brief glance > > at the about page does not tell me anything in this direction. > > It has a more complex bl

Re: Nexus Programming Language

2012-06-10 Thread Rick Johnson
On Jun 10, 12:45 am, rusi wrote: > On Jun 10, 7:46 am, Adam Campbell wrote: > > > The Nexus programming language version 0.5.0 has been released. It is > > an "object-oriented, dynamically-typed, reflective programming > > language", drawing from Lua and Ruby.www.nexuslang.org > > What does nexus

Re: what gui designer is everyone using

2012-06-10 Thread Rick Johnson
On Jun 7, 4:18 pm, Kevin Walzer wrote: > On 6/5/12 10:10 AM, Mark R Rivet wrote: > > > I want a gui designer that writes the gui code for me. I don't want to > > write gui code. what is the gui designer that is most popular? > None. I write GUI code by hand (Tkinter). I second that notion. Writi

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

2012-06-10 Thread Rick Johnson
On Jun 8, 7:27 am, Wolfgang Keller wrote: > This whole cycle of "design GUI"->"generate code"->add own code to > generated code"->"run application with GUI" has always seemed very > un-pythonic to me. A dynamic, interpreted language should allow to work > in a more "lively", "direct" way to build

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

2012-06-10 Thread Rick Johnson
On Jun 9, 8:25 am, Dietmar Schwertberger wrote: > Before anyone now writes "Good GUIs are coded by hand": > I agree, but for many purposes only simple GUIs are required > and it should be possible to create these without studying manuals > (on toolkit and GUI editor). It is possible. Try Tkinte

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

2012-06-10 Thread Rick Johnson
On Jun 10, 2:36 pm, Rick Johnson wrote: > # > # Or become a pro and create reusable objects! > # > class LE(tk.Frame): >     def __init__(self, master, **kw): >         tk.Frame.__init__(self, master) >         self.l = tk.Label(self, **kw) >         self.

Re: Passing ints to a function

2012-06-10 Thread Rick Johnson
On Jun 9, 3:29 am, Jussi Piitulainen wrote: > Here's something you could have thought of for yourself even when you > didn't remember that Python does have special built-in support for > applying a function to a list of arguments: > > def five(func, args): >    a, b, c, d, e = args >    return fu

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

2012-06-11 Thread Rick Johnson
On Jun 10, 11:05 pm, rusi wrote: > If python is really a "language maven's" language then it does not do > very well: > - its not as object-oriented as Ruby (or other arcana like Eiffel) if it were object-oreiented as Ruby, then why not use Ruby? > - its not as functional as Haskell if it were

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

controlling Python script with usb midi controller tia sal22

2011-06-30 Thread Rick T
Greetings All I have a usb midi controller (uc-33e) and I have a working python script see below. I would like to be able to control the variables of the python script using my usb controller does anyone have an example of this? I would like to use the "midi learn" function to automatically map a

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
tem... Superficially, such a task seems easy, but if the script is located deep in the abyssal plane of your file system, you'll be typing or clicking for what seems like an eternity to get there... (seconds tick away as rick rapid fires his way through a mountain of nested data structures wi

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: Printing to a file and a terminal at the same time

2017-10-10 Thread Vail, Rick
screen only. This prints to a file filename = open("outputfile",'w') sys.stdout = filename print ("Anything printed will go to the output file") Remove the above and it prints to the terminal, help Rick Vail | Network Engineer Presidio (NASDAQ: PSDO) | www.presid

FW: Printing to a file and a terminal at the same time

2017-10-10 Thread Vail, Rick
Rick Vail | Network Engineer Presidio (NASDAQ: PSDO) | www.presidio.com<http://www.presidio.com> 12272 Hancock St, Carmel, IN 46032 D: 317.428.6399 | C: 317.847.0493 | rv...@presidio.com<mailto:rv...@presidio.com> [Future. Built.]<http://www.presidio.com> Follow us: [

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

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