Re: PyMyth: Global variables are evil... WRONG!

2013-11-11 Thread Rick Johnson
On Monday, November 11, 2013 8:47:09 PM UTC-6, Tim Daneliuk wrote: > I think this is certainly the use case most people would > suggest. But I think you may have missed the real reason > most modern designers object to inter-module globals: The > presence of such entities almost always means the c

Re: Creating a function for a directory

2013-11-11 Thread Rick Johnson
On Monday, November 11, 2013 5:11:52 PM UTC-6, Chris Angelico wrote: > On Tue, Nov 12, 2013 at 9:51 AM, Rick Johnson > > 1. i believe win32 file paths require a qualifying volume > > letter. > They do not; omitting the drive letter makes the path relative to the > curren

Re: PyMyth: Global variables are evil... WRONG!

2013-11-12 Thread Rick Johnson
On Tuesday, November 12, 2013 8:12:10 AM UTC-6, jongiddy wrote: > Can you please give an example where having a module > provide a global variable would work better than any of: > [snip] Well my point is that the attributes of any Python module are "emulating" globals already. The fact that we ha

Re: PyMyth: Global variables are evil... WRONG!

2013-11-12 Thread Rick Johnson
On Tuesday, November 12, 2013 9:33:50 AM UTC-6, jongiddy wrote: > I'm not sure where you get the feeling you're accessing an > interface. Because the constant PI should never change. Sure we can argue about granularity of PI, but that argument has no weight on the fact that PI should be a constant

Re: PyMyth: Global variables are evil... WRONG!

2013-11-12 Thread Rick Johnson
On Tuesday, November 12, 2013 11:00:37 AM UTC-6, Rick Johnson wrote: [snip] > We have all been brainwashed by authorities. First they > give us rules, then they give us the power to break > those rules. The devil himself said it best: http://www.youtube.com/watch?v=RGR4SFOimlk Hmm.

PyModule(G.py): Now Python has REAL globals -- and their scoped to boot!

2013-11-12 Thread Rick Johnson
# Copyright 2013, Rick "rantingrick" Johnson # # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies. # # THIS SOFTWARE IS PROVIDED "AS IS" AND WI

Re: PyMyth: Global variables are evil... WRONG!

2013-11-12 Thread Rick Johnson
On Tuesday, November 12, 2013 4:41:34 PM UTC-6, jongiddy wrote: > On Tuesday, November 12, 2013 5:00:37 PM UTC, Rick Johnson wrote: > >1. Accept that globals are useful, and make them > > available through a "real" global syntax, not > > some attr

PyModule(C.py): Now Python has REAL constants -- and they're scoped to boot!

2013-11-12 Thread Rick Johnson
# Copyright 2013, Rick "rantingrick" Johnson # # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies. # # THIS SOFTWARE IS PROVIDED "AS IS" AND WI

Re: Most discussion on comp.lang.python is about developing with Python

2013-11-13 Thread Rick Johnson
Hello Bob, I understand your concern but you need to realize there is not much that can (or should) be done *IF* we want to live in societies that are free from oppression. The minute we start drawing lines in the sand and punishing people for exercising their freedom of speech, is when we start

Re: PyMyth: Global variables are evil... WRONG!

2013-11-13 Thread Rick Johnson
On Wednesday, November 13, 2013 5:42:24 PM UTC-6, Rhodri James wrote: > On Tue, 12 Nov 2013 02:06:09 -0000, Rick Johnson wrote: > > PyMyth: Global variables are evil... WRONG! > That's not a PyMyth. It's a CompSciMyth, or to be more > accurate a good general Softw

Re: PyMyth: Global variables are evil... WRONG!

2013-11-13 Thread Rick Johnson
On Wednesday, November 13, 2013 4:00:15 PM UTC-6, Andrew Cooper wrote: > And what do you do when the wizards bend space-time to > make PI exactly 3, for the ease of other calculations when > building a sorting machine? Are you telling me that these wizards can't be bothered to write the integer "3

Re: PyMyth: Global variables are evil... WRONG!

2013-11-13 Thread Rick Johnson
On Wednesday, November 13, 2013 6:17:22 PM UTC-6, Tim Daneliuk wrote: > > But python modules can't be interfaces because interfaces > > should protect internal data, prevent external forces from > > meddling with internal state (EXCEPT via the rules of a > > predefined "contract"), hide dirty detai

Re: PyMyth: Global variables are evil... WRONG!

2013-11-13 Thread Rick Johnson
On Wednesday, November 13, 2013 7:09:42 PM UTC-6, Steven D'Aprano wrote: > On Wed, 13 Nov 2013 23:42:24 +, Rhodri James wrote: > > On Tue, 12 Nov 2013 02:06:09 -, Rick Johnson wrote: > >> Python has globals, but we just can't admit it! > > A diffe

Re: PyMyth: Global variables are evil... WRONG!

2013-11-13 Thread Rick Johnson
On Wednesday, November 13, 2013 8:45:16 PM UTC-6, Steven D'Aprano wrote: > A fully-auto machine gun with a hair-trigger and no > safety is no different from a single-barrel shotgun with > a safety and a trigger lock! You can blow your foot off > with both! Yes. But in the case of the shotgun

Re: PyMyth: Global variables are evil... WRONG!

2013-11-13 Thread Rick Johnson
And what's this? *picks up hat* Where did this hat come from??? Spectator interrupts: Maybe Steven threw his hat in? No, no. Can't be. Steven would not wear something this old. I mean, it looks like something a farmer would put on a scarecrow or something??? *scratched head* OH

Re: Automation

2013-11-13 Thread Rick Johnson
On Sunday, November 3, 2013 5:32:46 PM UTC-6, Denis McMahon wrote: > Seems to me like you're using a sledgehammer to shell a peanut. And hopefully he knows whether or not he has a peanut allergy before he commits to enjoying the fruits of his labor. -- https://mail.python.org/mailman/listinfo/

Re: Automation

2013-11-13 Thread Rick Johnson
bob gailer wrote: > Does this have anything to do with statistics? Quantum > theory? Telephony? > > P = Pluto, V = Venus, S = Saturn? > > Help us understand - then we *might* be able to help you. bob later gailer wrote: > Oh ... will you please explain in good English and a lot > more detail. I

Re: PyMyth: Global variables are evil... WRONG!

2013-11-13 Thread Rick Johnson
On Wednesday, November 13, 2013 10:33:22 PM UTC-6, Roy Smith wrote: > Wait, aren't you the guy who's into MUDs? Yes he is. But that's his second favorite hobby. His first is filling the "Devils Advocate" slot when Steven is too busy -- doing WHATEVER Steven does when he's not here. God only

Re: PyMyth: Global variables are evil... WRONG!

2013-11-14 Thread Rick Johnson
On Wednesday, November 13, 2013 11:50:40 PM UTC-6, Steven D'Aprano wrote: > On Wed, 13 Nov 2013 19:45:42 -0800, Rick Johnson wrote: > > On Wednesday, November 13, 2013 8:45:16 PM UTC-6, Steven D'Aprano wrote: > >> A fully-auto machine gun with a hair-trigger and no

Re: PyMyth: Global variables are evil... WRONG!

2013-11-15 Thread Rick Johnson
e why sharing globals between sub-packages is really so bad that we have to import things over and over? And if so, would you like to offer a cleaner solution for the problem? And don't give me the messy import thing, because that's not elegant! WHY IS IT NOT ELEGANT RICK? Because wh

Re: Fire Method by predefined string!

2013-11-17 Thread Rick Johnson
On Sunday, November 17, 2013 3:46:16 PM UTC-6, Tamer Higazi wrote: > class(object): > def Fire(self,param) > #possible ?! > self.__param(): > def _DoSomething(self): > print 'I did it!' 1. First off your class declaration is not valid -- it needs an identifier! 2.

Re: Fire Method by predefined string!

2013-11-17 Thread Rick Johnson
On Sunday, November 17, 2013 4:23:11 PM UTC-6, Rick Johnson wrote: > 2. Never start a function or method with a lowercase letter. > Please read PEP8 Urm... let me correct that: 2. Never start a function or method with a UPPERCASE letter. Initial uppercase should be reserved for class name

Re: Oh look, another language (ceylon)

2013-11-17 Thread Rick Johnson
On Saturday, November 16, 2013 9:41:07 PM UTC-6, Gregory Ewing wrote: > The type system looks very interesting! Indeed. I went to the site assuming this would be another language that i would never like, however, after a few minutes reading the tour, i could not stop! I read through the entire t

Re: Oh look, another language (ceylon)

2013-11-18 Thread Rick Johnson
I've never *really* been crazy about the plus operator concatenating strings anyhow, however, the semantics of "+" seem to navigate the "perilous waters of intuition" far better than "*". Addition of numeric types is well defined in maths: Take N inputs values and *reduce* them into a sing

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-23 Thread Rick Johnson
On Friday, November 22, 2013 8:18:03 PM UTC-6, Steven D'Aprano wrote: > [snip] I look forward to the day that "rice" is the plural of "ri" Yes and i look forward to the day when "thread hijacking" perpetrated under the guise of "exploring linguistic minutia" perpetrated under the guise of "vanit

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-23 Thread Rick Johnson
der the guise of "political correctness" then no one will benefit. The speaker will continue using the language improperly and his audience will continue to be confused. "But Rick, we don't want to offend people!" Piss off you spineless invertebrate!I would be more offe

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-25 Thread Rick Johnson
On Saturday, November 23, 2013 7:38:47 PM UTC-6, Steven D'Aprano wrote: > Where do you, an American, What the hell makes you believe I'm an American? Because i speak fluent English? Because i embrace capitalism? Because i wish to be free of tyranny? Well, if that's all it takes to be an American,

Re: Excute script only from another file

2013-11-25 Thread Rick Johnson
On Monday, November 25, 2013 4:52:46 AM UTC-6, Himanshu Garg wrote: > My motive is "I will give scripts to somebody else and he > should not run the script directly without running the > parent script". The only sure fire method to prevent a file containing Python code from executing on a machin

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-25 Thread Rick Johnson
On Monday, November 25, 2013 2:10:04 PM UTC-6, Ned Batchelder wrote: > Let's please avoid veering off into rants about language > and philosophy now. Hello Ned. I respect the fact that you want to keep threads on-topic, and i greatly appreciate the humbleness of your request. However, i feel as t

Re: Excute script only from another file

2013-11-25 Thread Rick Johnson
> to do with file names? Hmm, I did not see his "command line snip-it" and assumed his users where not "command line savvy", therefor they would be running the script via a mouse click -- still probably not "sure fire" advice either. Okay, Rick was wrong once.

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-26 Thread Rick Johnson
But even IF you *can* show me one, or even a couple of measly examples, do you *REALLY* expect that your hand-full of examples can tilt the balances of reason and logic in your favor AGAINST the mountains of evidence that clearly judges the OP's use

Re: Excute script only from another file

2013-11-26 Thread Rick Johnson
On Tuesday, November 26, 2013 5:09:13 PM UTC-6, Chris Angelico wrote: > My point was that Rick had made the assumption that the GUI was > *everything* and that users were able to do nothing beyond > double-clicking on icons For some people the GUI *is* everything. Most people are una

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-16 Thread Rick Johnson
On Tuesday, December 10, 2013 7:35:47 PM UTC-6, Dennis Lee Bieber wrote: > NAILS Nails were verboten in my high school wood > working class... We used dowels and glue; chisels to carve > dove-tails; etc. That could be a result of two possibilities: 1. Your high school years were before t

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-16 Thread Rick Johnson
On Monday, December 9, 2013 2:53:30 PM UTC-6, bob gailer wrote: > Taking the opposite perspective from Gene: I think Python > is great as an intro to computing and programming. Give a > student a tool with which he can be productive quickly. > and with minimal effort. Understanding the real machine

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-16 Thread Rick Johnson
On Monday, December 16, 2013 8:33:11 PM UTC-6, Steven D'Aprano wrote: > Of course, this is very hard to measure: different languages require > different amounts of code to get something useful done. Different > languages get used for different things -- there are no operating system > kernels writ

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-16 Thread Rick Johnson
On Sunday, December 15, 2013 11:01:53 AM UTC-6, Steven D'Aprano wrote: > On Sun, 15 Dec 2013 14:53:45 +, Grant Edwards wrote: > > On 2013-12-14, Steven D'Aprano wrote: > > > > You seem to be equating "was compiled from" with "includes an > > implemenation of". Do you say that CPython "ships wi

Re: New to Python, Help to get script working?

2013-12-17 Thread Rick Johnson
On Monday, December 16, 2013 1:09:38 AM UTC-6, Mark wrote: > On Sunday, December 15, 2013 9:33:17 PM UTC-5, Chris Angelico wrote: > > I went and looked at the post linked to, and it has > > buggy indentation. (Quite possibly indicates that the > > author has two-space tabs, and didn't notice a bug

Re: cascading python executions only if return code is 0

2013-12-22 Thread Rick Johnson
On Sunday, December 22, 2013 12:37:04 PM UTC-6, Frank Cui wrote: > I have a requirement where I need to sequentially execute > a bunch of executions, each execution has a return code. > the followed executions should only be executed if the > return code is 0. is there a cleaner or more pythonic wa

Re: How can i return more than one value from a function to more than one variable

2013-12-23 Thread Rick Johnson
On Sunday, December 22, 2013 4:54:46 PM UTC-6, dec...@msn.com wrote: > basically what I wanna do is this : > x = 4 > > y = 7 > def switch (z,w): > ***this will switch z to w and vice verca*** > c= z > z=w > w=c > print 'Now x =', w, 'and y = ' , z > return w > x = switch(x

Re: cascading python executions only if return code is 0

2013-12-23 Thread Rick Johnson
On Sunday, December 22, 2013 5:02:51 PM UTC-6, Mark Lawrence wrote: > On 22/12/2013 22:51, Chris Angelico wrote: > if a() == 0: > > if b() == 0: > > c() > > I can only see one way that you can possibly intepret it. Hmm, I guess i should not assume color vision to be ubiquitous. > [

Re: Recovering deleted files

2013-12-26 Thread Rick Johnson
On Wednesday, December 25, 2013 10:44:39 PM UTC-6, George Tang wrote: > I am new to python and was trying to program with txt > files, and tried to move the txt file to a new directory. > i did not read very carefully about what shutil.move(src, > dst) does and it deleted some of my files. How do i

Re: On a scrollbar for tkinter

2014-01-02 Thread Rick Johnson
I know you're using Python3.x, so there may be new functionality in Tkinter that i am not aware of yet. I still have oodles of Python2.x dependencies and really don't see a need to make the jump yet -- so keep that in mind when taking my advice below. In the old days of Tkinter, if you wanted

Re: Tkinter GUI Error

2014-01-13 Thread Rick Johnson
On Monday, January 13, 2014 12:49:07 PM UTC-6, Lewis Wood wrote: > labelent1 = Label(main, text="Correct!",fg="green").grid(row = 0, column = 3) > > [snip] > > UnboundLocalError: local variable 'labelent1' referenced before assignment Observe the following interactive session and prepare to be e

Re: buggy python interpretter or am I missing something here?

2014-01-27 Thread Rick Johnson
On Monday, January 27, 2014 3:32:43 AM UTC-6, me wrote: > On Mon, 27 Jan 2014 20:01:33 +1100, Chris Angelico wrote: > > [snip chris reply] > > You feel better now that you too have vented? I had a > productive discussion with a couple of top level posters > who helped me solve my problem and the

Re: buggy python interpretter or am I missing something here?

2014-01-27 Thread Rick Johnson
On Monday, January 27, 2014 9:53:37 AM UTC-6, Chris Angelico wrote: > Heh. If you'd said Pike instead of REXX, I might have > believed you :) I've said more about Pike than is perhaps > appropriate, but of late, I've actually not been the one > to most often quote REXX code. Yes in my haste to inj

piping with subprocess

2014-02-01 Thread Rick Dooling
I spent half a day trying to convert this bash script (on Mac) textutil -convert html $1 -stdout | pandoc -f html -t markdown -o $2 into Python using subprocess pipes. It works if I save the above into a shell script called convert.sh and then do subprocess.check_call(["convert.sh", file, markd

Re: piping with subprocess

2014-02-01 Thread Rick Dooling
On Saturday, February 1, 2014 6:54:09 AM UTC-6, Peter Otten wrote: > Rick Dooling wrote: > > > > > I spent half a day trying to convert this bash script (on Mac) > > > > > > textutil -convert html $1 -stdout | pandoc -f html -t markdown -o $2 > > &g

Re: piping with subprocess

2014-02-01 Thread Rick Dooling
On Saturday, February 1, 2014 7:54:34 AM UTC-6, Rick Dooling wrote: > On Saturday, February 1, 2014 6:54:09 AM UTC-6, Peter Otten wrote: > > > Rick Dooling wrote: > > > > > > > > > > > > > I spent ha

Re: piping with subprocess

2014-02-01 Thread Rick Dooling
On Saturday, February 1, 2014 8:00:59 AM UTC-6, Rick Dooling wrote: > On Saturday, February 1, 2014 7:54:34 AM UTC-6, Rick Dooling wrote: > > > On Saturday, February 1, 2014 6:54:09 AM UTC-6, Peter Otten wrote: > > > > Rick Dooling wrote: > > > > > I spent

PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!)

2014-02-10 Thread Rick Johnson
## START CODE ### def foo(): # foo represents a patternless function # or method that returns a Boolean value # based on some internal test. # if 1==1: return True return False # # The fun begins when two tiny chars are forgott

Re: I can't understand re.sub

2015-11-29 Thread Rick Johnson
On Sunday, November 29, 2015 at 3:37:34 PM UTC-6, Mr Zaug wrote: > The items I'm searching for are few and they do not change. They are > "CONTENT_PATH", "ENV" and "NNN". These appear on a few lines in a template > file. They do not appear together on any line and they only appear once on > eac

Re: Is vars() the most useless Python built-in ever?

2015-11-30 Thread Rick Johnson
On Monday, November 30, 2015 at 7:01:14 PM UTC-6, Steven D'Aprano wrote: > I'm trying to understand why vars() exists. Does anyone use it? I think your "mental dilemma" stems from the fact that python was originally created to be an easy language for noobs to learn (which it still mostly is), ho

Re: Is vars() the most useless Python built-in ever?

2015-12-01 Thread Rick Johnson
erfaces like the "print function" are making the same mistakes. The linking of abstraction layers is even *MORE* important than intuitive naming conventions. But sometimes the name is the only path by which you can provide the link. As is the case with the print function. > > Ric

Re: Is vars() the most useless Python built-in ever?

2015-12-01 Thread Rick Johnson
On Tuesday, December 1, 2015 at 10:56:27 AM UTC-6, John Gordon wrote: > Rick Johnson writes: > > Your lament does remind me of a pet peeve i have concerning Python, and > > that is, the lie about: "THERE SHOULD BE ONE (AND PREFERABLY ONLY ONE) > > WAY TO DO IT!". In

Re: Is vars() the most useless Python built-in ever?

2015-12-11 Thread Rick Johnson
On Tuesday, December 1, 2015 at 1:34:54 AM UTC-6, Marko Rauhamaa wrote: > Rick Johnson : > > > python was originally created to be an easy language for noobs to > > learn > > Really? That's would be a silly objective for a programming language. > > >

Re: Is vars() the most useless Python built-in ever?

2015-12-11 Thread Rick Johnson
On Tuesday, December 1, 2015 at 10:49:19 PM UTC-6, Ian wrote: > > It's a well know fact that GvR was inspired to create > > Python from his experiences working with a language > > called ABC -- and ABC was designed *EXCLUSIVELY* to be a > > beginners language. > Which is exactly what made ABC itsel

Re: Can anyone help me modify the code so the ball starts in random directions

2015-12-11 Thread Rick Johnson
On Friday, December 11, 2015 at 5:20:13 PM UTC-6, phamt...@gmail.com wrote: > Can anyone direct me in the direction where to start the code for the > randomized of the ball to start. No, because your problem needs to be simplified first. A good first step would be to create a new script that o

Re: Is vars() the most useless Python built-in ever?

2015-12-14 Thread Rick Johnson
On Friday, December 11, 2015 at 10:45:02 PM UTC-6, Steven D'Aprano wrote: > On Sat, 12 Dec 2015 09:13 am, Rick Johnson wrote: > > > Intuitiveness and productivity have a > > synergy like peas and carrots! One cannot be productive if one is fighting > > an unintuiti

Re: Tk alternative to askopenfilename and askdirectory?

2015-12-16 Thread Rick Johnson
On Wednesday, December 16, 2015 at 7:19:25 AM UTC-6, Ulli Horlacher wrote: > Is there an alternative to Tk's askopenfilename() and askdirectory()? > > I want to select a files and directories within one widget, but > askopenfilename() let me only select files and askdirectory() let me only > selec

Re: How does one distribute Tkinter or Qt GUI apps Developed in Python

2015-12-16 Thread Rick Johnson
On Wednesday, December 16, 2015 at 6:03:55 PM UTC-6, Bruce Whealton wrote: > Surely, one is going to want to create GUI apps for users > that are not Python Developers. I would not think to ask > someone to install Python on their system and make sure it > is added to the path. Maybe it is not so

Re: Catogorising strings into random versus non-random

2015-12-21 Thread Rick Johnson
On Sunday, December 20, 2015 at 10:22:57 PM UTC-6, Chris Angelico wrote: > DuckDuckGo doesn't give a result count, so I skipped it. Yahoo search yielded: So why bother to mention it then? Is this another one of your "pikeish" propaganda campaigns? -- https://mail.python.org/mailman/listinfo/pyth

Re: Stupid Python tricks

2015-12-30 Thread Rick Johnson
On Wednesday, December 30, 2015 at 9:51:48 PM UTC-6, Steven D'Aprano wrote: > Fifteen years later, and Tim Peters' Stupid Python Trick is still the > undisputed champion! And should we be happy about that revelation, or sad? -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: There are no words for how broken everything is

2016-01-11 Thread Rick Johnson
On Monday, January 11, 2016 at 10:26:40 PM UTC-6, Steven D'Aprano wrote: > [...] > Took me three weeks to remove the last of the malware, and another two weeks > to track down the cause of an annoying glitch where every 30 seconds the PC > would freeze up for a fraction of a second. It was one of

Re: Stop writing Python 4 incompatible code

2016-01-13 Thread Rick Johnson
On Wednesday, January 13, 2016 at 6:11:06 PM UTC-6, Steven D'Aprano wrote: > But [GvR] has definitely ruled that 4.0 (assuming there is > one) will not be a major backwards-incompatible version > like 3.0 was. Well for the sake of Python's future, let's all hope so! I typically don't give much we

Re: Stop writing Python 4 incompatible code

2016-01-13 Thread Rick Johnson
On Wednesday, January 13, 2016 at 8:11:40 PM UTC-6, Michael Torrie wrote: > Hmm, so Guido moved to Dropbox because Google fired him? > [...] I can find zero evidence to support your assertion, Feel free to post evidence that will *DISPROVE* my statement. > Dishonesty is a harsh accusation, but wh

Re: Stop writing Python 4 incompatible code

2016-01-13 Thread Rick Johnson
On Wednesday, January 13, 2016 at 9:08:40 PM UTC-6, Chris Angelico wrote: > You're talking about a very serious matter between two legal entities > - if someone was *fired* because of social, technological, or other > problems with Python, that has implications that could matter in a > court of law

Re: Stop writing Python 4 incompatible code

2016-01-14 Thread Rick Johnson
On Wednesday, January 13, 2016 at 11:19:16 PM UTC-6, Michael Torrie wrote: > The only one speculating is you. Everything I've read points to this > idea of yours about GvR and Google being untrue. Providing speculation is not the same as providing facts. Please provide facts. And enumerate the

Re: Stop writing Python 4 incompatible code

2016-01-14 Thread Rick Johnson
On Wednesday, January 13, 2016 at 11:46:30 PM UTC-6, Terry Reedy wrote: > On 1/13/2016 8:02 PM, Rick Johnson wrote: > > and a leader who lost his cushy job at Google > > Unless you have access to facts that I do not, 'lost' is > impolite speculation. But lets move on.

Re: When I need classes?

2016-01-14 Thread Rick Johnson
On Tuesday, January 12, 2016 at 11:27:23 PM UTC-6, Steven D'Aprano wrote: > On Wednesday 13 January 2016 14:36, Rustom Mody wrote: > > > 1. Python the LANGUAGE, is rather even-handed in paradigm choice: > > Choose OO, imperative, functional or whatever style pleases/suits > > you 2. Python LIBRARI

Re: Stop writing Python 4 incompatible code

2016-01-14 Thread Rick Johnson
On Thursday, January 14, 2016 at 11:41:21 AM UTC-6, Chris Angelico wrote: > Prove this. Find "general public consensus" that Python is > dead. And then, imitate rats and abandon this sinking > ship. I don't need to "imitate" anything, it has already begun. > I decided to give 3D modelling a go, a

Re: Stop writing Python 4 incompatible code

2016-01-14 Thread Rick Johnson
On Thursday, January 14, 2016 at 4:04:48 PM UTC-6, Steven D'Aprano wrote: > Into the sin-bin you go for another three months. Enjoy your time in > the kill-file. https://www.youtube.com/watch?v=CuDEP6eFkeA -- https://mail.python.org/mailman/listinfo/python-list

Re: Stop writing Python 4 incompatible code

2016-01-14 Thread Rick Johnson
On Thursday, January 14, 2016 at 4:53:42 PM UTC-6, Ian wrote: > On Thu, Jan 14, 2016 at 8:52 AM, Rick Johnson > > [...] > > > I wonder if he's considered the possibility that Google may > > swoop in an purchase Dropbox at some time in the near > > future, an

Re: Stop writing Python 4 incompatible code

2016-01-15 Thread Rick Johnson
On Friday, January 15, 2016 at 10:23:43 AM UTC-6, Emile van Sebille wrote: > Hmm, sounds like they're stealing plays from Micro$oft. "Stealing plays", hardly, they've stolen the *WHOLE* playbook! Corporations are like drug dealers: First they get you hooked on the free stuff, then they empty your

Re: Stop writing Python 4 incompatible code

2016-01-15 Thread Rick Johnson
On Friday, January 15, 2016 at 2:49:49 PM UTC-6, Gregory Ewing wrote: > > On 1/14/2016 3:55 PM, Rick Johnson wrote: > > > >> And if the owners refuse to sell, no problem, you offer > >> their customers the same services at bargain basement > >> discount

Re: psss...I want to move from Perl to Python

2016-01-28 Thread Rick Johnson
On Thursday, January 28, 2016 at 6:28:25 PM UTC-6, Nathan Hilterbrand wrote: > Python 2 vs python 3 is anything but "solved". You will hear arguments > in favor of both. I will not make a suggestion, because I do not have > on my flame-resistant clothing Indeed. About the only subject more vol

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Rick Johnson
On Friday, January 29, 2016 at 6:21:21 AM UTC-6, Ulli Horlacher wrote: > I nearly gave up with Python at the very beginning before > I realised that OO-programming is optional in Python! :-) > Most tutorials I found so far makes OO mandatory. Just more evidence that old dogs are incapable of learn

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Rick Johnson
On Friday, January 29, 2016 at 2:49:24 PM UTC-6, sohca...@gmail.com wrote: > I'm convinced that anyone who actually prefers Perl's > syntax over Python is suffering from Stockholm Syndrome. > > [...] > > Readability counts. I'd say readability is one of the > most important features of a language

Re: psss...I want to move from Perl to Python

2016-01-30 Thread Rick Johnson
On Friday, January 29, 2016 at 9:38:23 PM UTC-6, Rustom Mody wrote: > JustForTheRecord[1]: Rick is someone who I sometimes agree with... Thanks for reacting in a rational, cool-headed manner. Many folks, especially the new members of this group, may not understand *WHY* i react so passionat

Re: psss...I want to move from Perl to Python

2016-02-02 Thread Rick Johnson
On Sunday, January 31, 2016 at 9:35:17 PM UTC-6, MRAB wrote: > In [jmf's] defence, he _was_ the one who drew attention to > the unexpected slowness of the FSR under certain > circumstances in the Windows build of Python 3.3, albeit > in a rather over-dramatized way. Thanks MRAB. You and Terry may

Re: psss...I want to move from Perl to Python

2016-02-02 Thread Rick Johnson
On Sunday, January 31, 2016 at 9:15:38 PM UTC-6, Chris Angelico wrote: > That said, though, I would GREATLY prefer Rick to post > less provocatively. I'll admit that my tone can "sometimes" be acerbic, but it's not like i was attacking someone for *NO* justifiable reason

[STORY-TIME] THE BDFL AND HIS PYTHON PETTING ZOO

2016-02-02 Thread Rick Johnson
[STORY-TIME] THE BDFL AND HIS PYTHON PETTING ZOO A long, long time a ago, in a sleepy little Scandinavian village, somewhere outside of Stockholm, a wee little boy was born,

Re: [STORY-TIME] THE BDFL AND HIS PYTHON PETTING ZOO

2016-02-06 Thread Rick Johnson
On Wednesday, February 3, 2016 at 12:02:35 AM UTC-6, John Ladasky wrote: > Rick, you don't like Python? If i didn't like Python, then i would happily let it self- destruct, yes? The problem is, i *DO* like Python. Python2 was a great language, but python3 has been a disaster. H

Re: I cannot open IDLE

2016-02-13 Thread Rick Johnson
On Friday, February 12, 2016 at 7:06:45 AM UTC-6, anthony averett wrote: > I have downloaded python but I cannot open up idle. I really need this > issue resolved for I have work do for one of my computer science class. Sorry, but you failed to provide enough information. Here are a few possibilit

Re: How do i instantiate a class_name passed via cmd line

2016-02-13 Thread Rick Johnson
On Saturday, February 13, 2016 at 10:41:20 PM UTC-6, Veek. M wrote: > how do i replace the 'Ebay' bit with a variable so that I > can load any class via cmd line. Is this what you're trying to do? (Python2.x code) >>> import Tkinter as tk >>> classNames = ["Button", "Label"] >>> root = tk.Tk() >

Re: How do i instantiate a class_name passed via cmd line

2016-02-13 Thread Rick Johnson
On Saturday, February 13, 2016 at 11:39:56 PM UTC-6, Veek. M wrote: > Nope - this is what i'm doing: > > class Foo(): > pass > > x = 'Foo' > > How do i use 'x' to create an instance of class Foo? Use the builtin function `getattr` on the module that contains the class named "Foo". For exampl

Re: [STORY-TIME] THE BDFL AND HIS PYTHON PETTING ZOO

2016-02-15 Thread Rick Johnson
On Friday, February 12, 2016 at 1:51:35 AM UTC-6, John Ladasky wrote: Reguarding a migration from Python2 to Pyhton3, John said: > I had to wait until my favorite packages were ported > (numpy, scipy, matplotlib, pandas). WxPython is not ported either, much to my chagrin. > But once that happen

Re: Make a unique filesystem path, without creating the file

2016-02-15 Thread Rick Johnson
On Sunday, February 14, 2016 at 10:55:11 PM UTC-6, Steven D'Aprano wrote: > If you want to guarantee that these faux pathnames can't > leak out of your test suite and touch the file system, > prepend an ASCII NUL to them. That will make it an illegal > path on all file systems that I'm aware of. H

Re: Changing sound volume

2016-02-15 Thread Rick Johnson
On Monday, February 15, 2016 at 4:58:04 AM UTC-6, izik43 wrote: > i had had to play some wav files and the volume was very > poor. i used "audacity" and used amplify effect to change > the basic amplitude. Yes, you can achieve a more powerful punch that way, but it's not the same as what the OP ne

Re: A mistake which almost went me mad

2016-03-09 Thread Rick Johnson
On Thursday, March 3, 2016 at 4:22:07 AM UTC-6, ast wrote: > Hello > > This has to be told > > I created a file pickle.py in order to test some files > read/write with objects and put it in a directory > which is on my python path. > > Then the nightmare began > > - Idle no longer works, windo

Re: Adding Icon To Tkinter Window

2016-03-09 Thread Rick Johnson
On Saturday, March 5, 2016 at 12:08:27 PM UTC-6, Grant Edwards wrote: > You'll have to be a lot more specific about what you mean by "add an > icon to a window". Do you just want to display an .ico file within a > window? I think he wants to use his *OWN* icon on a window's title bar, instead of

Re: Adding Icon To Tkinter Window

2016-03-09 Thread Rick Johnson
On Saturday, March 5, 2016 at 3:39:00 PM UTC-6, Terry Reedy wrote: > No single simple statement work for all situations. You should have > specified OS, Python version, and tcl/tk version. (IDLE's Help -> About > IDLE displays full tk version). Yes, because Tkinter is not as cross-platform as

Re: exit from Tkinter mainloop Python 2.7

2016-03-09 Thread Rick Johnson
On Friday, March 4, 2016 at 3:50:43 PM UTC-6, kevin...@gmail.com wrote: > Thanks for your attention to this matter. > My code now look like this: [...] All of the help offered in this thread ignores the elephant in the room. What are you trying to achieve here Kevin? To me, this looks like some so

Re: it doesn't want to open

2016-03-09 Thread Rick Johnson
On Wednesday, March 9, 2016 at 12:48:45 PM UTC-6, Grant Edwards wrote: > Um, twist it the other way? I don't think he's trying to open a can Grant, this sounds like a *REAL* emergency. My guess is that he is emailing us from the toilet because he needs advice on how to free a stuck zipper. Unfor

Re: Encapsulation in Python

2016-03-10 Thread Rick Johnson
On Thursday, March 10, 2016 at 9:28:06 AM UTC-6, Ian wrote: > Encapsulation in Python is based on trust rather than the > authoritarian style of C++ / Java. The maxim in the Python > community is that "we're all consenting adults". If I > don't intend an attribute to be messed with, then I'll > ma

Re: A mistake which almost went me mad

2016-03-10 Thread Rick Johnson
On Thursday, March 10, 2016 at 12:13:39 AM UTC-6, Rustom Mody wrote: > As usual Rick I find myself agreeing with your direction [also it seems > Random832's direction] Somehow i missed Random's remark... Hmm, he does have a good idea! Introducing a new "import state

Re: Encapsulation in Python

2016-03-11 Thread Rick Johnson
On Thursday, March 10, 2016 at 1:36:48 PM UTC-6, Mark Lawrence wrote: > On 10/03/2016 14:57, Dan Strohl via Python-list wrote: > >> I've been studying Object Oriented Theory using Java. Theoretically, all > >> attributes should be private, meaning no one except the methods itself can > >> access th

Re: Encapsulation in Python

2016-03-11 Thread Rick Johnson
On Friday, March 11, 2016 at 3:28:40 AM UTC-6, Steven D'Aprano wrote: > That's one theory. Another theory is: no they shouldn't, all attributes > should be public. That most accurately models actual physical objects and > maximizes the usefulness of the attribute. > > People over-use private, and

Re: Encapsulation in Python

2016-03-11 Thread Rick Johnson
(NOTE: My apologies to the group if this same message was sent twice. From my end, it appears to have been lost, so i'm sending again. Thanks) On Thursday, March 10, 2016 at 1:36:48 PM UTC-6, Mark Lawrence wrote: > On 10/03/2016 14:57, Dan Strohl via Python-list wrote: > >> I've been studying Obj

Re: Encapsulation in Python

2016-03-11 Thread Rick Johnson
On Friday, March 11, 2016 at 9:48:22 AM UTC-6, Ian wrote: > On Thu, Mar 10, 2016 at 5:45 PM, Rick Johnson > The honorable Rick Johnson wrote: > > Many times, i would have preferred to define my module space > > across multiple files, multiple files that could share state > &

Re: Encapsulation in Python

2016-03-11 Thread Rick Johnson
On Friday, March 11, 2016 at 9:48:22 AM UTC-6, Ian wrote: > On Thu, Mar 10, 2016 at 5:45 PM, Rick Johnson wrote: > > Many times, i would have preferred to define my module space > > across multiple files, multiple files that could share state > > without resorting to t

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