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