[Tutor] simple question about scope

2019-05-18 Thread marcus lütolf
Dear experts in learning the principles of Python I came across scope in the control structure's section. There I read the notion that variables createted inside a control structute can't be seen or accessed from outside that structure, Python would raise a Name Error. However in for loops - al

[Tutor] Case Insensitive Globing

2019-05-18 Thread Richard Damon
I am working on a program to process some files created by an old windows program that created it files with varying case with a python program. Using glob.glob on Windows seems to ignore the case, and find all the matching files. The same directory, running the same program under Mac OS X, which

Re: [Tutor] simple question about scope

2019-05-18 Thread Alan Gauld via Tutor
On 18/05/2019 09:20, marcus lütolf wrote: > in learning the principles of Python I came across scope in the > control structure's section. > There I read the notion that variables createted inside a > control structute can't be seen or accessed from outside that > structure, Python would raise a

Re: [Tutor] Case Insensitive Globing

2019-05-18 Thread Alan Gauld via Tutor
On 18/05/2019 03:14, Richard Damon wrote: > The same directory, running the same program under Mac OS X, which also > is a case insensitive file system, That is your mistake. Darwin, the core of the MacOS X system is a version of BSD Unix and like all Unix OS is very much case sensitive. Some o

Re: [Tutor] simple question about scope

2019-05-18 Thread Mats Wichmann
On 5/18/19 2:20 AM, marcus lütolf wrote: > Dear experts > > in learning the principles of Python I came across scope in the > control structure's section. > There I read the notion that variables createted inside a > control structute can't be seen or accessed from outside that > structure, Pytho

Re: [Tutor] Case Insensitive Globing

2019-05-18 Thread Mats Wichmann
On 5/17/19 8:14 PM, Richard Damon wrote: > I am working on a program to process some files created by an old > windows program that created it files with varying case with a python > program. > > Using glob.glob on Windows seems to ignore the case, and find all the > matching files. > > The same

Re: [Tutor] simple question about scope SOLVED

2019-05-18 Thread marcus lütolf
Many thanks for this quick answer. I unfortunatly misread the tutorial (edx Course CS1301xII, Computing in Python II: Control Structures) concerning scope insofar as a NameError arises if a variable is accessed which was not created inside the control structure. Marcus. -Ursprüngliche Nachri

Re: [Tutor] [SPAM?] Re: Case Insensitive Globing

2019-05-18 Thread Richard Damon
On 5/18/19 6:52 AM, Alan Gauld via Tutor wrote: > On 18/05/2019 03:14, Richard Damon wrote: > >> The same directory, running the same program under Mac OS X, which also >> is a case insensitive file system, > That is your mistake. Darwin, the core of the MacOS X system > is a version of BSD Unix a

[Tutor] How arguments to the super() function works?

2019-05-18 Thread Arup Rakshit
I am writing an Flask app following a book, where a piece of python concept I am not getting how it works. Code is: class Role(db.Model): __tablename__ = 'roles' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(64), unique=True) default = db.Column(db.Boolea

Re: [Tutor] How arguments to the super() function works?

2019-05-18 Thread Alan Gauld via Tutor
On 18/05/2019 17:21, Arup Rakshit wrote: > class Role(db.Model): > > def __init__(self, **kwargs): > super(Role, self).__init__(**kwargs) > > Here, why super(Role, self).__init__(**kwargs) is used instead > of super().__init__(**kwargs) ? I suspect you are reading an older tutoria

Re: [Tutor] How arguments to the super() function works?

2019-05-18 Thread Mark Lawrence
On 18/05/2019 17:21, Arup Rakshit wrote: I am writing an Flask app following a book, where a piece of python concept I am not getting how it works. Code is: class Role(db.Model): __tablename__ = 'roles' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(64),

Re: [Tutor] How arguments to the super() function works?

2019-05-18 Thread Steven D'Aprano
On Sat, May 18, 2019 at 09:51:39PM +0530, Arup Rakshit wrote: > Here, why super(Role, self).__init__(**kwargs) is used instead of > super().__init__(**kwargs) ? What that Role and self argument is > instructing the super() ? The Role and self arguments are the owning class and current instance.

Re: [Tutor] Case Insensitive Globing

2019-05-18 Thread Steven D'Aprano
On Sat, May 18, 2019 at 11:52:29AM +0100, Alan Gauld via Tutor wrote: > On 18/05/2019 03:14, Richard Damon wrote: > > > The same directory, running the same program under Mac OS X, which also > > is a case insensitive file system, > > That is your mistake. Darwin, the core of the MacOS X system

Re: [Tutor] Case Insensitive Globing

2019-05-18 Thread Steven D'Aprano
On Sun, May 19, 2019 at 10:37:56AM +1000, Steven D'Aprano wrote: > That's not quite right -- case sensitivity of the OS isn't important, > case sensitivity of the *file system* is. And the standard file system > on Mac OS, HFS+, defaults to case-preserving but case-insensitive. > > (There is an

Re: [Tutor] How arguments to the super() function works?

2019-05-18 Thread Arup Rakshit
> On 19-May-2019, at 4:46 AM, Mark Lawrence wrote: > > On 18/05/2019 17:21, Arup Rakshit wrote: >> I am writing an Flask app following a book, where a piece of python concept >> I am not getting how it works. Code is: >> class Role(db.Model): >> __tablename__ = 'roles' >> id = db.Column

Re: [Tutor] Looking for some direction

2019-05-18 Thread David L Neil
On 13/05/19 6:13 AM, Alan Gauld via Tutor wrote: On 12/05/2019 10:15, David L Neil wrote: Interestingly, I split these into two - my laziness for running/testing is 'Save, Alt-Tab, Up-arrow, Enter' which would be 'ruined' by using the cmdLN for anything else. In a bash shell I use Ctr-R (for

Re: [Tutor] Looking for some direction

2019-05-18 Thread David L Neil
On 18/05/19 4:15 AM, Alan Gauld via Tutor wrote: On 16/05/2019 04:17, Alex Kleider wrote: Alt-Tab and the X cut 'n paste mechanism provides enough integration between windows. I tried this (Ubuntu 18.4) and Alt-Tab cycles between terminal and browser but I can't make it cycle from one termina

Re: [Tutor] Two Scripts, Same Commands, One Works, One Doesn't

2019-05-18 Thread DL Neil
Stephen, On 16/05/19 12:16 AM, Stephen P. Molnar wrote: I am writing scripts to semi-automate some of my Quantum Chemistry software and have encountered a problem that has me baffled. The two scripts have the same form, the only difference being the commands. One script works, the other bombs

Re: [Tutor] Looking for some direction

2019-05-18 Thread DL Neil
On 13/05/19 10:56 AM, boB Stepp wrote: On Sun, May 12, 2019 at 5:19 PM boB Stepp wrote: On Sun, May 12, 2019 at 1:05 PM David L Neil wrote: I'm using Gnome Terminal under Fedora (Linux). This allows multiple terminals in tabs (and thus Ctrl-Tab rapid-switching). However, it irritates me that