Re: about main()

2018-07-08 Thread Abdur-Rahmaan Janhangeer
non native speakers try to do their best as for ... who can't be bothered to use correct grammar in English, and probably are comparably sloppy in their code. ... maybe but check INADA NAOKI Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ or the practicality of killfiling people who

Re: about main()

2018-07-08 Thread Abdur-Rahmaan Janhangeer
i appreciate every suggestions though ^^_ Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Ahh, yes. The elegant purity of reading every email that goes through > this mailing list, or the practicality of killfiling people who can't > be bothered to use correct grammar in English, and p

Re: about main()

2018-07-07 Thread Gene Heskett
On Friday 06 July 2018 14:27:16 Grant Edwards wrote: > On 2018-07-06, Gene Heskett wrote: > > In that case, I hate to say it, but your education is sorely lacking > > in the fundamentals. Smelting for instance was discussed at length > > in the high school physics books I was reading by the time

Re: about main()

2018-07-06 Thread Gregory Ewing
Robin Becker wrote: The villagers will shout "hey siri I need a compiler" and one will be provided Then one day someone says "Hey, Siri, make me an artificial intelligence that can respond to voice commands", and then it's not long before the AIs are breeding by themselves and take over. Berri

Re: about main()

2018-07-06 Thread Steven D'Aprano
On Fri, 06 Jul 2018 18:27:16 +, Grant Edwards wrote: > On 2018-07-06, Gene Heskett wrote: > >> In that case, I hate to say it, but your education is sorely lacking in >> the fundamentals. Smelting for instance was discussed at length in the >> high school physics books I was reading by the t

Re: about main()

2018-07-06 Thread Jim Lee
On 07/06/18 12:57, Terry Reedy wrote: On 7/5/2018 9:40 PM, Jim Lee wrote: On 07/05/18 18:25, Steven D'Aprano wrote: On Thu, 05 Jul 2018 11:27:09 -0700, Jim Lee wrote: Take a village of people.  They live mostly on wild berries. Because of course a community of people living on one food is

Re: about main()

2018-07-06 Thread Grant Edwards
On 2018-07-06, Jim Lee wrote: > On 07/06/18 11:25, Grant Edwards wrote: >> On 2018-07-06, Jim Lee wrote: >> >>> Pedantics again. Didn't even get the point before tearing apart the >>> *analogy* rather than the *point itself*. >> Jim Lee, this is the Internet. >> >> Intenet, this is Jim Lee. >> >>

Re: about main()

2018-07-06 Thread Terry Reedy
On 7/5/2018 9:40 PM, Jim Lee wrote: On 07/05/18 18:25, Steven D'Aprano wrote: On Thu, 05 Jul 2018 11:27:09 -0700, Jim Lee wrote: Take a village of people.  They live mostly on wild berries. Because of course a community of people living on one food is so realistic. Even the Eskimos and Inuit

Re: about main()

2018-07-06 Thread Jim Lee
On 07/06/18 11:25, Grant Edwards wrote: On 2018-07-06, Jim Lee wrote: Pedantics again. Didn't even get the point before tearing apart the *analogy* rather than the *point itself*. Jim Lee, this is the Internet. Intenet, this is Jim Lee. :) You have an inaccurate anthropomorphic referenc

Re: about main()

2018-07-06 Thread Grant Edwards
On 2018-07-06, Jim Lee wrote: > > Pedantics again. Didn't even get the point before tearing apart the > *analogy* rather than the *point itself*. Jim Lee, this is the Internet. Intenet, this is Jim Lee. :) -- Grant Edwards grant.b.edwardsYow! I'm encased in the

Re: about main()

2018-07-06 Thread Grant Edwards
On 2018-07-06, Gene Heskett wrote: > In that case, I hate to say it, but your education is sorely lacking in > the fundamentals. Smelting for instance was discussed at length in the > high school physics books I was reading by the time I was in the 3rd > grade. Don't they teach anything in sch

Re: about main()

2018-07-06 Thread Grant Edwards
On 2018-07-05, Jim Lee wrote: > Take a village of people. They live mostly on wild berries. It's completely orthogonal to your point of course, but I thought villages happened precisely because people had stopped living off wild stuff and had adopted organized agriculture... -- Grant Edwards

Re: about main()

2018-07-06 Thread Robin Becker
On 05/07/2018 21:43, Jim Lee wrote: ... identifying the poisonous berries. I would respect your analogy more if every compiler used today were forty years old and not being developed by anyone other than its original creator(s). ChrisA It's not about compilers - it's about skills. 

Re: about main()

2018-07-06 Thread Mark Lawrence
On 06/07/18 07:04, Gregory Ewing wrote: Steven D'Aprano wrote: Even the Eskimos and Inuit, living in some of the harshest environments on earth, managed to have a relatively wide variety of foods in their diet. They might be living on a very wide variety of berries. Or perhaps, in their lang

Re: about main()

2018-07-06 Thread Mark Lawrence
On 06/07/18 02:40, Jim Lee wrote: On 07/05/18 18:25, Steven D'Aprano wrote: On Thu, 05 Jul 2018 11:27:09 -0700, Jim Lee wrote: Take a village of people.  They live mostly on wild berries. Because of course a community of people living on one food is so realistic. Even the Eskimos and Inuit,

Re: about main()

2018-07-05 Thread Gregory Ewing
Steven D'Aprano wrote: Even the Eskimos and Inuit, living in some of the harshest environments on earth, managed to have a relatively wide variety of foods in their diet. They might be living on a very wide variety of berries. Or perhaps, in their language, "berry" simply means "food". -- Gr

Re: about main()

2018-07-05 Thread Steven D'Aprano
On Thu, 05 Jul 2018 18:40:11 -0700, Jim Lee wrote: > On 07/05/18 18:25, Steven D'Aprano wrote: >> On Thu, 05 Jul 2018 11:27:09 -0700, Jim Lee wrote: >> >>> Take a village of people.  They live mostly on wild berries. >> Because of course a community of people living on one food is so >> realistic.

Re: about main()

2018-07-05 Thread Gene Heskett
On Thursday 05 July 2018 21:25:31 Steven D'Aprano wrote: > On Thu, 05 Jul 2018 11:27:09 -0700, Jim Lee wrote: > > Take a village of people.  They live mostly on wild berries. > > Because of course a community of people living on one food is so > realistic. Even the Eskimos and Inuit, living in som

Re: about main()

2018-07-05 Thread Jim Lee
On 07/05/18 18:25, Steven D'Aprano wrote: On Thu, 05 Jul 2018 11:27:09 -0700, Jim Lee wrote: Take a village of people.  They live mostly on wild berries. Because of course a community of people living on one food is so realistic. Even the Eskimos and Inuit, living in some of the harshest env

Re: about main()

2018-07-05 Thread Jim Lee
On 07/05/18 18:14, Michael Torrie wrote: On 07/05/2018 11:47 AM, Calvin Spealman wrote: That wasn't me, but I do agree with the sentiment in that its often silly to focus on them at the wrong time and without constraints that warrant that focus. Premature optimization is the root of all evil,

Re: about main()

2018-07-05 Thread Steven D'Aprano
On Thu, 05 Jul 2018 11:27:09 -0700, Jim Lee wrote: > Take a village of people.  They live mostly on wild berries. Because of course a community of people living on one food is so realistic. Even the Eskimos and Inuit, living in some of the harshest environments on earth, managed to have a relat

Re: about main()

2018-07-05 Thread Michael Torrie
On 07/05/2018 11:47 AM, Calvin Spealman wrote: > That wasn't me, but I do agree with the sentiment in that its often silly > to focus on them at the wrong time and without constraints that warrant > that focus. Premature optimization is the root of all evil, the saying goes. I see this kind of th

Re: about main()

2018-07-05 Thread Steven D'Aprano
On Thu, 05 Jul 2018 10:41:36 -0700, Jim Lee wrote: > The horde of > programmers a generation or two from now may have no clue how to do > these things. That's okay, the horde of programmers have never known how to do these things (optimization). They either don't do it at all, or they run riot

Re: about main()

2018-07-05 Thread Cameron Simpson
On 05Jul2018 11:22, Rhodri James wrote: On 05/07/18 09:43, Abdur-Rahmaan Janhangeer wrote: just when to use main() in if __name__ == '__main__' : main() is far is it good in py? or should file intended to be run just not include it? It's a matter of taste. If your "file intended to be

Re: about main()

2018-07-05 Thread Jim Lee
On 07/05/18 14:15, MRAB wrote: On 2018-07-05 21:43, Jim Lee wrote: On 07/05/18 12:58, Chris Angelico wrote: On Fri, Jul 6, 2018 at 4:27 AM, Jim Lee wrote: On 07/05/18 10:47, Calvin Spealman wrote: You say "pitfall", but I say "allow developers to focus on higher-level problems and en

Re: about main()

2018-07-05 Thread MRAB
On 2018-07-05 21:43, Jim Lee wrote: On 07/05/18 12:58, Chris Angelico wrote: On Fri, Jul 6, 2018 at 4:27 AM, Jim Lee wrote: On 07/05/18 10:47, Calvin Spealman wrote: You say "pitfall", but I say "allow developers to focus on higher-level problems and enable developers to specialize among

Re: about main()

2018-07-05 Thread Jim Lee
On 07/05/18 12:58, Chris Angelico wrote: On Fri, Jul 6, 2018 at 4:27 AM, Jim Lee wrote: On 07/05/18 10:47, Calvin Spealman wrote: You say "pitfall", but I say "allow developers to focus on higher-level problems and enable developers to specialize among tasks so every single one of us does

Re: about main()

2018-07-05 Thread Chris Angelico
On Fri, Jul 6, 2018 at 4:27 AM, Jim Lee wrote: > > > On 07/05/18 10:47, Calvin Spealman wrote: >> >> >> >> You say "pitfall", but I say "allow developers to focus on higher-level >> problems and enable developers to specialize among tasks so every single one >> of us doesn't have to be a jack of a

Re: about main()

2018-07-05 Thread Jim Lee
On 07/05/18 10:47, Calvin Spealman wrote: You say "pitfall", but I say "allow developers to focus on higher-level problems and enable developers to specialize among tasks so every single one of us doesn't have to be a jack of all trades just to build a todo list app". Sure, that's the

Re: about main()

2018-07-05 Thread Calvin Spealman
On Thu, Jul 5, 2018 at 1:41 PM, Jim Lee wrote: > > > On 07/05/18 10:15, Calvin Spealman wrote: > > On Thu, Jul 5, 2018 at 12:59 PM, Jim Lee wrote: > >> >> >> On 07/05/18 05:14, Marko Rauhamaa wrote: >> >>> Abdur-Rahmaan Janhangeer : >>> * Create as many functions as you can > perfo

Re: about main()

2018-07-05 Thread Jim Lee
On 07/05/18 10:15, Calvin Spealman wrote: On Thu, Jul 5, 2018 at 12:59 PM, Jim Lee > wrote: On 07/05/18 05:14, Marko Rauhamaa wrote: Abdur-Rahmaan Janhangeer mailto:arj.pyt...@gmail.com>>: * Create as many functions as you can

Re: about main()

2018-07-05 Thread Calvin Spealman
On Thu, Jul 5, 2018 at 12:59 PM, Jim Lee wrote: > > > On 07/05/18 05:14, Marko Rauhamaa wrote: > >> Abdur-Rahmaan Janhangeer : >> >>> * Create as many functions as you can >>> performance? >>> >> Python? >> >> Seriously, though. The principle of expressive encapsulation is one of >> the basi

Re: about main()

2018-07-05 Thread Jim Lee
On 07/05/18 05:14, Marko Rauhamaa wrote: Abdur-Rahmaan Janhangeer : * Create as many functions as you can performance? Python? Seriously, though. The principle of expressive encapsulation is one of the basic cornerstones of writing computer programs. Performance barely ever becomes a questi

Re: about main()

2018-07-05 Thread Chris Angelico
On Thu, Jul 5, 2018 at 10:47 PM, Abdur-Rahmaan Janhangeer wrote: > that's what happens when you type from mobile > > btw i have top posted since some days only in this thread > > as for my english well i got distinction in cambridge ucles in gp for high > school but practicality beats purity Ahh,

Re: about main()

2018-07-05 Thread Chris Angelico
On Thu, Jul 5, 2018 at 9:20 PM, Marko Rauhamaa wrote: > Rhodri James : >> I'm not a big fan of "main()" functions myself; creating a function >> which will be called exactly once seems rather wasteful. > > A function is the encapsulation of a distinct ... well ... function. > Functions that are ca

Re: about main()

2018-07-05 Thread Abdur-Rahmaan Janhangeer
that's what happens when you type from mobile btw i have top posted since some days only in this thread as for my english well i got distinction in cambridge ucles in gp for high school but practicality beats purity Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ > > > -- https://ma

Re: about main()

2018-07-05 Thread Mark Lawrence
On 05/07/18 11:39, Abdur-Rahmaan Janhangeer wrote: i once saw a python course (by academics) advertising main() in it's promotional flier that's put me in doubt as whether it's that recommended or not Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ I can remember back to the good

Re: about main()

2018-07-05 Thread Marko Rauhamaa
Abdur-Rahmaan Janhangeer : >> * Create as many functions as you can > performance? Python? Seriously, though. The principle of expressive encapsulation is one of the basic cornerstones of writing computer programs. Performance barely ever becomes a question, and even more rarely has anything to d

Re: about main()

2018-07-05 Thread Abdur-Rahmaan Janhangeer
no about wrapping everything in functions Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ On Thu, 5 Jul 2018, 15:55 Joel Goldstick, wrote: > On Thu, Jul 5, 2018 at 7:45 AM, Abdur-Rahmaan Janhangeer > wrote: > > performance? > > You are asking basic file layout questions in the learn

Re: about main()

2018-07-05 Thread Joel Goldstick
On Thu, Jul 5, 2018 at 7:45 AM, Abdur-Rahmaan Janhangeer wrote: > performance? You are asking basic file layout questions in the learning process of understand how to code in python. Performance should be very low on your list of concerns. The only thing that happens when the file is loaded is

Re: about main()

2018-07-05 Thread Abdur-Rahmaan Janhangeer
performance? Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ * Create as many functions as you can -- https://mail.python.org/mailman/listinfo/python-list

Re: about main()

2018-07-05 Thread Bart
On 05/07/2018 11:22, Rhodri James wrote: On 05/07/18 09:43, Abdur-Rahmaan Janhangeer wrote: just when to use main() in if __name__ == '__main__' : main() is far is it good in py? or should file intended to be run just not include it? It's a matter of taste.  If your "file intended to b

Re: about main()

2018-07-05 Thread Marko Rauhamaa
Rhodri James : > I'm not a big fan of "main()" functions myself; creating a function > which will be called exactly once seems rather wasteful. A function is the encapsulation of a distinct ... well ... function. Functions that are called just once are desirable. So I'm saying the opposite: * H

Re: about main()

2018-07-05 Thread Marko Rauhamaa
Abdur-Rahmaan Janhangeer : > just when to use main() in > > if __name__ == '__main__' : > main() > > is far is it good in py? > > or should file intended to be run just not include it? I think all Python programs should have it. Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: about main()

2018-07-05 Thread Abdur-Rahmaan Janhangeer
i once saw a python course (by academics) advertising main() in it's promotional flier that's put me in doubt as whether it's that recommended or not Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ > main() > > > > is far is it good in py? > > > > or should file intended to be ru

Re: about main()

2018-07-05 Thread Rhodri James
On 05/07/18 09:43, Abdur-Rahmaan Janhangeer wrote: just when to use main() in if __name__ == '__main__' : main() is far is it good in py? or should file intended to be run just not include it? It's a matter of taste. If your "file intended to be run" also contains things that might be

about main()

2018-07-05 Thread Abdur-Rahmaan Janhangeer
just when to use main() in if __name__ == '__main__' : main() is far is it good in py? or should file intended to be run just not include it? Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ -- https://mail.python.org/mailman/listinfo/python-list

Re: Just a quick question about main()

2017-10-27 Thread Ian Kelly
On Oct 27, 2017 5:38 PM, "Ian Kelly" wrote: In addition to what others have answered, if the code in question has any variables then I'll prefer to put it inside a function and call the function. This ensures that the variables are local and not going. It's a minor code hygiene point, but a good

Re: Just a quick question about main()

2017-10-27 Thread Ian Kelly
In addition to what others have answered, if the code in question has any variables then I'll prefer to put it inside a function and call the function. This ensures that the variables are local and not going. It's a minor code hygiene point, but a good practice in my opinion. -- https://mail.pytho

Re: Just a quick question about main()

2017-10-27 Thread Ned Batchelder
On 10/27/17 2:05 PM, ROGER GRAYDON CHRISTMAN wrote: While teaching my introductory course in Python, I occasionally see submissions containing the following two program lines, even before I teach about functions and modules: if __name__ = '__main__': ... main() When I ask about it, I hear thin

Re: Just a quick question about main()

2017-10-27 Thread Grant Edwards
On 2017-10-27, Chris Angelico wrote: > On Sat, Oct 28, 2017 at 5:05 AM, ROGER GRAYDON CHRISTMAN wrote: >> While teaching my introductory course in Python, I occasionally see >> submissions containing the following two program lines,[...] >> if __name__ = '__main__': >> ... main() > If it's JUS

Re: Just a quick question about main()

2017-10-27 Thread Thomas Jollans
On 27/10/17 20:05, ROGER GRAYDON CHRISTMAN wrote: > While teaching my introductory course in Python, I occasionally see > submissions containing the following two program lines, even before > I teach about functions and modules: > > if __name__ = '__main__': > ... main() > > When I ask about it,

Re: Just a quick question about main()

2017-10-27 Thread Chris Angelico
On Sat, Oct 28, 2017 at 5:23 AM, Chris Angelico wrote: > On Sat, Oct 28, 2017 at 5:05 AM, ROGER GRAYDON CHRISTMAN wrote: >> While teaching my introductory course in Python, I occasionally see >> submissions containing the following two program lines, even before >> I teach about functions and mod

Re: Just a quick question about main()

2017-10-27 Thread Chris Angelico
On Sat, Oct 28, 2017 at 5:05 AM, ROGER GRAYDON CHRISTMAN wrote: > While teaching my introductory course in Python, I occasionally see > submissions containing the following two program lines, even before > I teach about functions and modules: > > if __name__ = '__main__': > ... main() > > When I

Just a quick question about main()

2017-10-27 Thread ROGER GRAYDON CHRISTMAN
While teaching my introductory course in Python, I occasionally see submissions containing the following two program lines, even before I teach about functions and modules: if __name__ = '__main__': ... main() When I ask about it, I hear things like they got these from other instructors, or from