Re: learning Python

2024-10-29 Thread rbowman via Python-list
On Tue, 29 Oct 2024 16:05:53 -0600, Mats Wichmann wrote: > Frankly, the mountain of resources is so vast that none of us can have > experience of more than a small fraction, and effective learning is a > factor not only of the quality of the teacher/book/training course, but > how it meshes with y

Re: learning Python

2024-10-29 Thread Mats Wichmann via Python-list
On 10/27/24 16:51, o1bigtenor via Python-list wrote: Greetings There are mountains of books out there. Any suggestions for documents for a just learning how to program and starting with Python (3)? Preference to a tool where I would be learning by doing - - - that works well for me. TIA Fra

Re: learning Python

2024-10-27 Thread dn via Python-list
On 28/10/24 11:51, o1bigtenor via Python-list wrote: Greetings There are mountains of books out there. Any suggestions for documents for a just learning how to program and starting with Python (3)? Preference to a tool where I would be learning by doing - - - that works well for me. Coursera

Re: learning python ...

2021-05-30 Thread 황병희
hw writes: > Hi, > > I'm starting to learn python and have made a little example program > following a tutorial[1] I'm attaching. > > Running it, I'm getting: > > > Traceback (most recent call last): > File "[...]/hworld.py", line 18, in > print(isinstance(int, float)) > TypeError: isinsta

Re: learning python ...

2021-05-28 Thread Michael Torrie
On 5/27/21 12:29 PM, hw wrote: > When the idea is to learn something, it's not exactly helpful to abandon > that idea when encountering the first obstacle or when someone tells you > you don't like it as much as they do ... We've had many new users approach the mailing list over the years. Alway

RE: learning python ...

2021-05-27 Thread Avi Gross via Python-list
if this is > that important, use something else and do NOT suggest diddling with unused > bits in one implementation of NA to store your additional metadata as there > is no guarantee it will get the result you want and it is not a documented > guaranteed implementation and may break

Re: learning python ...

2021-05-27 Thread Christian Gollwitzer
Am 25.05.21 um 06:08 schrieb hw: On 5/25/21 12:37 AM, Greg Ewing wrote: Python does have references to *objects*. All objects live on the heap and are kept alive as long as there is at least one reference to them. If you rebind a name, and it held the last reference to an object, there is no wa

Re: learning python ...

2021-05-27 Thread Michael F. Stemper
On 27/05/2021 16.13, Christian Gollwitzer wrote: Am 25.05.21 um 06:08 schrieb hw: On 5/25/21 12:37 AM, Greg Ewing wrote: Python does have references to *objects*. All objects live on the heap and are kept alive as long as there is at least one reference to them. If you rebind a name, and it he

Re: learning python ...

2021-05-27 Thread Peter J. Holzer
On 2021-05-27 20:59:47 +0200, hw wrote: > On 5/25/21 3:09 PM, Greg Ewing wrote: > > On 25/05/21 5:56 pm, Avi Gross wrote: > > > Var = read in something from a file and make some structure like a > > > data.frame > > > Var = remove some columns from the above thing pointed to by Var > > > Var = make

Re: learning python ...

2021-05-27 Thread hw
On 5/25/21 3:09 PM, Greg Ewing wrote: On 25/05/21 5:56 pm, Avi Gross wrote: Var = read in something from a file and make some structure like a data.frame Var = remove some columns from the above thing pointed to by Var Var = make some new calculated columns ditto Var = remove some rows ... Var

Re: learning python ...

2021-05-27 Thread hw
-Original Message- From: Python-list On Behalf Of Cameron Simpson Sent: Monday, May 24, 2021 5:34 AM To: python-list@python.org Subject: Re: learning python ... On 24May2021 08:21, hw wrote: On 5/24/21 12:03 AM, Cameron Simpson wrote: On 23May2021 21:02, Stestagg wrote: On Sun, 23 May

Re: learning python ...

2021-05-26 Thread Greg Ewing
On 26/05/21 7:15 pm, hw wrote: it could at least figure out which, the type or the variable, to use as parameter for a function that should specify a variable type when the name is given.  Obviously, python knows what's expected, so why not chose that. It knows, but not until *after* the func

Re: learning python ...

2021-05-26 Thread Chris Angelico
On Wed, May 26, 2021 at 5:49 PM hw wrote: > > On 5/25/21 10:32 AM, Chris Angelico wrote: > > On Tue, May 25, 2021 at 1:00 PM hw wrote: > >> > >> On 5/24/21 3:54 PM, Chris Angelico wrote: > >>> You keep using that word "unfinished". I do not think it means what > >>> you think it does. > >> > >> W

Re: learning python ...

2021-05-26 Thread hw
On 5/25/21 10:32 AM, Chris Angelico wrote: On Tue, May 25, 2021 at 1:00 PM hw wrote: On 5/24/21 3:54 PM, Chris Angelico wrote: You keep using that word "unfinished". I do not think it means what you think it does. What do you think I think it means? I think it means that the language is h

Re: learning python ...

2021-05-26 Thread hw
On 5/25/21 9:42 AM, Greg Ewing wrote: On 25/05/21 2:59 pm, hw wrote: Then what is 'float' in the case of isinstance() as the second parameter, and why can't python figure out what 'float' refers to in this case? You seem to be asking for names to be interpreted differently when they are used

Re: learning python ...

2021-05-25 Thread Greg Ewing
On 2021-05-24, Alan Gauld via Python-list wrote: Although wouldn't it be "expected boolean expression" rather than conditional expression? Python doesn't care how the argument to 'if' is arrived at so long as it's a boolean. This isn't really true either. Almost every object in Python has an

Re: learning python ...

2021-05-25 Thread Greg Ewing
On 26/05/21 3:33 am, Dennis Lee Bieber wrote: the OBJECTS have a type and can not change type. Well... built-in types can't, but... >>> class A: ... pass ... >>> class B: ... pass ... >>> a = A() >>> type(a) >>> a.__class__ = B >>> type(a) -- Greg -- https://mail.python.org/mailman/listi

Re: learning python ...

2021-05-25 Thread Manfred Lotz
On Mon, 24 May 2021 08:14:39 +1200 Ron.Lauzon@f192.n1.z21.fsxnet (Ron Lauzon) wrote: > -=> hw wrote to All <=- > > hw> Traceback (most recent call last): > hw>File "[...]/hworld.py", line 18, in > hw> print(isinstance(int, float)) > hw> TypeError: isinstance() arg 2 must be a type

Re: learning python ...

2021-05-25 Thread Michael F. Stemper
On 24/05/2021 18.30, Alan Gauld wrote: On 24/05/2021 16:54, Michael F. Stemper wrote: In my early days of writing python, I created lists named "list", dictionaries named "dict", and strings named "str". I mostly know better now, but sometimes still need to restrain my fingers. I think most n

Re: learning python ...

2021-05-25 Thread Grant Edwards
On 2021-05-25, Michael F. Stemper wrote: > On 24/05/2021 23.08, hw wrote: >> On 5/25/21 12:37 AM, Greg Ewing wrote: >> >> Are all names references?  When I pass a name as a parameter to a >> function, does the object the name is referring to, when altered by the >> function, still appear altere

Re: learning python ...

2021-05-25 Thread Michael F. Stemper
On 24/05/2021 23.08, hw wrote: On 5/25/21 12:37 AM, Greg Ewing wrote: Python does have references to *objects*. All objects live on the heap and are kept alive as long as there is at least one reference to them. If you rebind a name, and it held the last reference to an object, there is no wa

Re: learning python ...

2021-05-25 Thread Grant Edwards
On 2021-05-25, Greg Ewing wrote: > On 25/05/21 5:56 pm, Avi Gross wrote: >> Var = read in something from a file and make some structure like a data.frame >> Var = remove some columns from the above thing pointed to by Var >> Var = make some new calculated columns ditto >> Var = remove some rows ..

Re: learning python ...

2021-05-25 Thread Grant Edwards
On 2021-05-24, Alan Gauld via Python-list wrote: > On 24/05/2021 19:48, Grant Edwards wrote: > >>> Traceback ( File "", line 1 >>> if = 1.234 >>>^ >>> SyntaxError: invalid syntax >> >> I must admit it might be nice if the compiler told you _why_ the >> syntax is invalid (e.g. "expect

Re: learning python ...

2021-05-25 Thread Greg Ewing
On 25/05/21 5:56 pm, Avi Gross wrote: Var = read in something from a file and make some structure like a data.frame Var = remove some columns from the above thing pointed to by Var Var = make some new calculated columns ditto Var = remove some rows ... Var = set some kind of grouping on the above

Re: learning python ...

2021-05-25 Thread Greg Ewing
On 25/05/21 2:59 pm, hw wrote: Then what is 'float' in the case of isinstance() as the second parameter, and why can't python figure out what 'float' refers to in this case? You seem to be asking for names to be interpreted differently when they are used as parameters to certain functions.

Re: learning python ...

2021-05-25 Thread Alan Gauld via Python-list
On 25/05/2021 00:41, Jon Ribbens via Python-list wrote: > What would you call the argument to a function that > returns, say, an upper-cased version of its input? Probably 'candidate' or 'original' or 'initial' or somesuch. Or even just 's'. Single character names are OK when there is no signifi

Re: learning python ...

2021-05-25 Thread Michael Torrie
On 5/24/21 9:53 PM, hw wrote: > That seems like an important distinction. I've always been thinking of > variables that get something assigned to them, not as something that is > being assigned to something. Your thinking is not incorrect. Assignment is how you set a variable to something. Fo

Re: learning python ...

2021-05-25 Thread Richard Damon
On 5/25/21 12:08 AM, hw wrote: > > Are all names references?  When I pass a name as a parameter to a > function, does the object the name is referring to, when altered by > the function, still appear altered after the function has returned?  I > wouldn't expect that ... If you mutate the object th

Shadowing, was Re: learning python ...

2021-05-25 Thread Peter Otten
On 25/05/2021 05:20, hw wrote: We're talking about many different things. If it's simply "num = ..." followed by "num = ...", then it's not a new variable or anything, it's simply rebinding the same name. But when you do "int = ...", it's shadowing the builtin name. Why?  And how is that "shad

Re: learning python ...

2021-05-25 Thread Chris Angelico
On Tue, May 25, 2021 at 1:00 PM hw wrote: > > On 5/24/21 3:54 PM, Chris Angelico wrote: > > You keep using that word "unfinished". I do not think it means what > > you think it does. > > What do you think I think it means? I think it means that the language is half way through development, doesn'

RE: learning python ...

2021-05-24 Thread Avi Gross via Python-list
sons and many LIKE IT the way it is, ... -Original Message- From: Python-list On Behalf Of Cameron Simpson Sent: Monday, May 24, 2021 5:34 AM To: python-list@python.org Subject: Re: learning python ... On 24May2021 08:21, hw wrote: >On 5/24/21 12:03 AM, Cameron Simpson wrote: &g

Re: learning python ...

2021-05-24 Thread Cameron Simpson
On 25May2021 06:08, hw wrote: >On 5/25/21 12:37 AM, Greg Ewing wrote: >>If you rebind a name, and it held the last reference to an >>object, there is no way to get that object back. > >Are all names references? Yes. >When I pass a name as a parameter to a function, does the object the >name is

Re: learning python ...

2021-05-24 Thread Cameron Simpson
On 25May2021 05:53, hw wrote: >That seems like an important distinction. I've always been thinking of >variables that get something assigned to them, not as something that is >being assigned to something. They are what you thought. But it's references to objects what are being passed around.

Re: learning python ...

2021-05-24 Thread hw
On 5/25/21 12:37 AM, Greg Ewing wrote: On 25/05/21 9:27 am, Cameron Simpson wrote: On 24May2021 16:17, hw wrote: > Or it doesn't forget about the old one and the old one becomes inaccessible (unless you have a reference to it, if there is such a thing in python).  How do you call that? You

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 4:28 PM, Michael Torrie wrote: On 5/24/21 8:17 AM, hw wrote: What does python actually do in the first example? Does it overshadow a variable or does it change one? If it overshadows a variable, it would be dubious, if it doesn't, it won't be dubious. Are you referring to this?

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 4:37 PM, Chris Angelico wrote: On Tue, May 25, 2021 at 12:31 AM Michael Torrie wrote: On 5/24/21 8:24 AM, Chris Angelico wrote: On Tue, May 25, 2021 at 12:18 AM hw wrote: There are more alternatives: Python might create a new variable with the same name and forget about the old

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 4:41 PM, Michael Torrie wrote: On 5/24/21 8:21 AM, Michael Torrie wrote: Given your posts thus far, hw, I don't think Python is a good fit for you. You're better off learning a language that more closely aligns with the statically-typed languages you already know. Maybe it is, maybe

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 3:54 PM, Chris Angelico wrote: On Mon, May 24, 2021 at 11:35 PM hw wrote: On 5/24/21 9:52 AM, Chris Angelico wrote: Does C give you a warning if you create a function-local variable called "printf"? No, and it shouldn't. Does any other language complain if you use its scoping rules

Re: learning python ...

2021-05-24 Thread Jon Ribbens via Python-list
On 2021-05-24, Alan Gauld wrote: > On 24/05/2021 16:54, Michael F. Stemper wrote: > >> In my early days of writing python, I created lists named "list", >> dictionaries named "dict", and strings named "str". I mostly know better >> now, but sometimes still need to restrain my fingers. > > I think

Re: learning python ...

2021-05-24 Thread Alan Gauld via Python-list
On 24/05/2021 19:48, Grant Edwards wrote: >> Traceback ( File "", line 1 >> if = 1.234 >>^ >> SyntaxError: invalid syntax > > I must admit it might be nice if the compiler told you _why_ the > syntax is invalid (e.g. "expected conditional expression while parsing > 'if' statement").

Re: learning python ...

2021-05-24 Thread Alan Gauld via Python-list
On 24/05/2021 16:54, Michael F. Stemper wrote: > In my early days of writing python, I created lists named "list", > dictionaries named "dict", and strings named "str". I mostly know better > now, but sometimes still need to restrain my fingers. I think most newbie programmers make that mistake.

Re: learning python ...

2021-05-24 Thread Dan Stromberg
On Sun, May 23, 2021 at 12:35 PM hw wrote: > I don't know about shadowing. If I have defeated a whole variable type > by naming a variable like a variable type, I would think it is a bad > idea for python to allow this without warning. It seems like a recipie > for creating chaos. > It strikes

Re: learning python ...

2021-05-24 Thread Greg Ewing
On 25/05/21 9:27 am, Cameron Simpson wrote: On 24May2021 16:17, hw wrote: > Or it doesn't forget about the old one and the old one becomes inaccessible (unless you have a reference to it, if there is such a thing in python). How do you call that? You're conflating values (objects, such as a

Re: learning python ...

2021-05-24 Thread Cameron Simpson
On 24May2021 16:17, hw wrote: >On 5/24/21 11:33 AM, Cameron Simpson wrote: >>Note that in this function: >> >> x = 1 >> y = 2 >> >> def f(a): >> x = 3 >> print(x, y) >> >>"x" is local, because the function contains an assignment to it. "y" >>comes from an outer scope (i

Re: learning python ...

2021-05-24 Thread Grant Edwards
On 2021-05-24, Dennis Lee Bieber wrote: > Attempting to rebind a keyword in Python will produce an error... > if = 1.234 > Traceback ( File "", line 1 > if = 1.234 >^ > SyntaxError: invalid syntax I must admit it might be nice if the compiler told you _why_ the syntax is

Re: learning python ...

2021-05-24 Thread Alan Gauld via Python-list
On 24/05/2021 07:21, hw wrote: >> Inside the function f() the name 'x" shadows the global "x"; references >> to "x" are to the function's local vairable. Which is very desireable. > > If it works that way, I would consider it an entirely different > variable. Remember that in Python variables

Re: learning python ...

2021-05-24 Thread Michael F. Stemper
On 24/05/2021 09.32, Rob Cliffe wrote: One day you may want to write (as you can in Python)     class int(int):         . to shadow the built-in 'int' type with a modified version.  I'm not suggesting this has many real world applications, but it can be fun to play with.  Python has a

Re: learning python ...

2021-05-24 Thread Rob Cliffe via Python-list
Please don't be put off by your experience so far.  Everyone stumbles along the way and runs into "gotchas" when learning a new language.  Python is a fantastic language for development.  One of my early "epiphany" moments was experimenting with different algorithms to try to find the right one

Re: learning python ...

2021-05-24 Thread Michael Torrie
On 5/24/21 8:42 AM, Schachner, Joseph wrote: > OMG that is awful abuse of Python! You have overloaded two Python > keywords by making variables of that name. Nitpick. hw did not overload keywords. Python does not allow keywords to be overloaded. Instead hw overwrote type names. Upon learning th

Re: learning python ...

2021-05-24 Thread Rob Cliffe via Python-list
On 24/05/2021 14:34, hw wrote: Your claim that I'm insulting python or anoyone is ridiculous. According to your logic, C is insulting python.  I suggest you stop making assumptions. Calling a mature, widely used language "unfinished" because of what *you* see as a defect *is* insulting. (Of

Re: learning python ...

2021-05-24 Thread Michael Torrie
On 5/24/21 8:37 AM, Chris Angelico wrote: > We're talking about many different things. Indeed. The context of that original question about whether this was shadowing or not seemed to be specifically about the num=input(); num=int(num) example that Cameron Simpson posted. Although hw was not cle

RE: learning python ...

2021-05-24 Thread Schachner, Joseph
float)). The first argument is the variable, the second should be type name. --- Joseph S. Teledyne Confidential; Commercially Sensitive Business Data -Original Message- From: hw Sent: Sunday, May 23, 2021 3:34 PM To: python-list@python.org Subject: Re: learning python ... On 5/23/21 7:

Re: learning python ...

2021-05-24 Thread Michael Torrie
On 5/24/21 8:21 AM, Michael Torrie wrote: > Given your posts thus far, hw, I don't think Python is a good fit for > you. You're better off learning a language that more closely aligns with > the statically-typed languages you already know. That was unnecessarily harsh; my apologies. I can see now

Re: learning python ...

2021-05-24 Thread Chris Angelico
On Tue, May 25, 2021 at 12:31 AM Michael Torrie wrote: > > On 5/24/21 8:24 AM, Chris Angelico wrote: > > On Tue, May 25, 2021 at 12:18 AM hw wrote: > >> There are more alternatives: Python might create a new variable with > >> the same name and forget about the old one. Or it doesn't forget abo

Re: learning python ...

2021-05-24 Thread Michael Torrie
On 5/24/21 8:17 AM, hw wrote: > What does python actually do in the first example? Does it overshadow a > variable or does it change one? If it overshadows a variable, it would > be dubious, if it doesn't, it won't be dubious. Are you referring to this? num = input("Enter a number: ")

Re: learning python ...

2021-05-24 Thread Michael Torrie
On 5/24/21 8:24 AM, Chris Angelico wrote: > On Tue, May 25, 2021 at 12:18 AM hw wrote: >> There are more alternatives: Python might create a new variable with >> the same name and forget about the old one. Or it doesn't forget about >> the old one and the old one becomes inaccessible (unless you

Re: learning python ...

2021-05-24 Thread Chris Angelico
On Tue, May 25, 2021 at 12:18 AM hw wrote: > There are more alternatives: Python might create a new variable with > the same name and forget about the old one. Or it doesn't forget about > the old one and the old one becomes inaccessible (unless you have a > reference to it, if there is such a t

Re: learning python ...

2021-05-24 Thread Michael Torrie
On 5/24/21 7:34 AM, hw wrote: > Perhaps you can't see how both examples are different because you're > looking at things from a python perspective. Sorry but they aren't all that different. In both cases you're shadowing printf. The difference is that C is a statically-typed, compiled language,

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 11:33 AM, Cameron Simpson wrote: On 24May2021 08:21, hw wrote: On 5/24/21 12:03 AM, Cameron Simpson wrote: On 23May2021 21:02, Stestagg wrote: On Sun, 23 May 2021 at 20:37, hw wrote: I don't know about shadowing. Shadowing is effectively saying “within this bit of code, (scope

Re: learning python ...

2021-05-24 Thread Chris Angelico
On Mon, May 24, 2021 at 11:35 PM hw wrote: > > On 5/24/21 9:52 AM, Chris Angelico wrote: > > Does C give you a warning if you create a function-local variable > > called "printf"? No, and it shouldn't. Does any other language > > complain if you use its scoping rules to reuse a name? Nope. Does >

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 9:52 AM, Chris Angelico wrote: On Mon, May 24, 2021 at 3:25 PM hw wrote: On 5/23/21 10:02 PM, Stestagg wrote: On Sun, 23 May 2021 at 20:37, hw mailto:h...@adminart.net>> wrote: On 5/23/21 7:28 PM, Peter Otten wrote: > On 23/05/2021 06:37, hw wrote: >> >> H

Re: learning python ...

2021-05-24 Thread Cameron Simpson
On 24May2021 08:21, hw wrote: >On 5/24/21 12:03 AM, Cameron Simpson wrote: >>On 23May2021 21:02, Stestagg wrote: >>>On Sun, 23 May 2021 at 20:37, hw wrote: I don't know about shadowing. >>> >>>Shadowing is effectively saying “within this bit of code, (scope) I’m going >>>to use an already-us

Re: learning python ...

2021-05-24 Thread Peter J. Holzer
On 2021-05-24 07:20:39 +0200, hw wrote: > python is too unfinished to be used. You have to realize that different programming languages have different goals and develop in different directions. Python is not an "unfinished Java" (and neither is Java an "unfinished Python"). The scoping and binding

Re: learning python ...

2021-05-24 Thread Chris Angelico
On Mon, May 24, 2021 at 3:25 PM hw wrote: > > On 5/23/21 10:02 PM, Stestagg wrote: > > > > > > On Sun, 23 May 2021 at 20:37, hw > > wrote: > > > > On 5/23/21 7:28 PM, Peter Otten wrote: > > > On 23/05/2021 06:37, hw wrote: > > >> > > >> Hi, > > >>

Re: learning python ...

2021-05-23 Thread hw
On 5/24/21 12:03 AM, Cameron Simpson wrote: On 23May2021 21:02, Stestagg wrote: On Sun, 23 May 2021 at 20:37, hw wrote: I don't know about shadowing. Shadowing is effectively saying “within this bit of code, (scope) I’m going to use an already-used name for my own value” An example might

Re: learning python ...

2021-05-23 Thread hw
PS: On 5/24/21 7:20 AM, hw wrote: There is even no indication from the output from the program before it aborts with an error message that something might be wrong:  For 'type(float)', it prints "" just like it does for int. How is anyone supposed to debug stuff like that? Ok, it prints ""

Re: learning python ...

2021-05-23 Thread Igor Korot
Hi, On Mon, May 24, 2021 at 12:26 AM hw wrote: > > On 5/23/21 10:02 PM, Stestagg wrote: > > > > > > On Sun, 23 May 2021 at 20:37, hw > > wrote: > > > > On 5/23/21 7:28 PM, Peter Otten wrote: > > > On 23/05/2021 06:37, hw wrote: > > >> > > >> Hi, > >

Re: learning python ...

2021-05-23 Thread hw
On 5/23/21 10:02 PM, Stestagg wrote: On Sun, 23 May 2021 at 20:37, hw > wrote: On 5/23/21 7:28 PM, Peter Otten wrote: > On 23/05/2021 06:37, hw wrote: >> >> Hi, >> >> I'm starting to learn python and have made a little example program

Re: learning python ...

2021-05-23 Thread Cameron Simpson
On 23May2021 21:02, Stestagg wrote: >On Sun, 23 May 2021 at 20:37, hw wrote: >> I don't know about shadowing. > >Shadowing is effectively saying “within this bit of code, (scope) I’m going >to use an already-used name for my own value” An example might make this clearer: x = 1 # global vari

Re: learning python ...

2021-05-23 Thread Stestagg
On Sun, 23 May 2021 at 20:37, hw wrote: > On 5/23/21 7:28 PM, Peter Otten wrote: > > On 23/05/2021 06:37, hw wrote: > >> > >> Hi, > >> > >> I'm starting to learn python and have made a little example program > >> following a tutorial[1] I'm attaching. > >> > >> Running it, I'm getting: > >> > >>

Re: learning python ...

2021-05-23 Thread MRAB
On 2021-05-23 20:34, hw wrote: On 5/23/21 7:28 PM, Peter Otten wrote: On 23/05/2021 06:37, hw wrote: Hi, I'm starting to learn python and have made a little example program following a tutorial[1] I'm attaching. Running it, I'm getting: Traceback (most recent call last):    File "[...]/h

Re: learning python ...

2021-05-23 Thread hw
On 5/23/21 7:28 PM, Peter Otten wrote: On 23/05/2021 06:37, hw wrote: Hi, I'm starting to learn python and have made a little example program following a tutorial[1] I'm attaching. Running it, I'm getting: Traceback (most recent call last):    File "[...]/hworld.py", line 18, in pri

Re: learning python ...

2021-05-23 Thread Peter Otten
On 23/05/2021 06:37, hw wrote: Hi, I'm starting to learn python and have made a little example program following a tutorial[1] I'm attaching. Running it, I'm getting: Traceback (most recent call last):   File "[...]/hworld.py", line 18, in     print(isinstance(int, float)) TypeError: is

Re: learning python building 2nd app, need advices

2021-01-13 Thread Phil Boutros
Loris Bennett wrote: > As an Emacs user, personally I would use the command > > M-x untabify > > within Emacs. I assume that Vim has something similar. It does. ':retab' is what you want. If you have tabstop set to a specific value, it'll use that. If not, you can do ':retab ', where

Re: learning python building 2nd app, need advices

2021-01-11 Thread Grant Edwards
On 2021-01-11, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: > On 2021-01-11 at 06:34:42 -0800, > pascal z via Python-list wrote: > >> On Monday, January 11, 2021 at 2:07:03 PM UTC, Chris Angelico wrote: > >> > Easy fix: stop looking at the Google Group page. >>

Re: learning python building 2nd app, need advices

2021-01-11 Thread Grant Edwards
On 2021-01-11, pascal z via Python-list wrote: > tab to space on linux is not something easy to do, Nonsense, there's a command _specifically_ for that: $ man expand -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python building 2nd app, need advices

2021-01-11 Thread Terry Reedy
On 1/11/2021 6:46 AM, pascal z via Python-list wrote: tab to space on linux is not something easy to do, IDLE has a tab to spaces command on the format menu. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python building 2nd app, need advices

2021-01-11 Thread 2QdxY4RzWzUUiLuE
On 2021-01-11 at 06:34:42 -0800, pascal z via Python-list wrote: > On Monday, January 11, 2021 at 2:07:03 PM UTC, Chris Angelico wrote: > > Easy fix: stop looking at the Google Group page. > > > > ChrisA > ok, emails show post fine. 10 years ago or something, I was quite > involved to comp.lan

Re: learning python building 2nd app, need advices

2021-01-11 Thread pascal z via Python-list
On Monday, January 11, 2021 at 2:07:03 PM UTC, Chris Angelico wrote: > On Tue, Jan 12, 2021 at 1:01 AM pascal z via Python-list > wrote: > > > > On Monday, January 11, 2021 at 1:45:31 PM UTC, Greg Ewing wrote: > > > On 12/01/21 1:12 am, pascal z wrote: > > > > As alternative, I pasted it into

Re: learning python building 2nd app, need advices

2021-01-11 Thread Chris Angelico
On Tue, Jan 12, 2021 at 1:01 AM pascal z via Python-list wrote: > > On Monday, January 11, 2021 at 1:45:31 PM UTC, Greg Ewing wrote: > > On 12/01/21 1:12 am, pascal z wrote: > > > As alternative, I pasted it into github and pasted it back into this > > > page, it's ok when pasting but when postin

Re: learning python building 2nd app, need advices

2021-01-11 Thread pascal z via Python-list
On Monday, January 11, 2021 at 1:45:31 PM UTC, Greg Ewing wrote: > On 12/01/21 1:12 am, pascal z wrote: > > As alternative, I pasted it into github and pasted it back into this page, > > it's ok when pasting but when posting it fails keeping spaces... > The indentation in your last three posts lo

Re: learning python building 2nd app, need advices

2021-01-11 Thread Greg Ewing
On 12/01/21 1:12 am, pascal z wrote: As alternative, I pasted it into github and pasted it back into this page, it's ok when pasting but when posting it fails keeping spaces... The indentation in your last three posts looks fine here in the comp.lang.python newsgroup. If it doesn't look right

Re: learning python building 2nd app, need advices

2021-01-11 Thread pascal z via Python-list
On Monday, January 11, 2021 at 12:00:28 PM UTC, Loris Bennett wrote: > pascal z writes: > > > tab to space on linux is not something easy to do > > I would argue that you are mistaken, although that depends somewhat on > your definition of 'easy'. > > > , I had to launch windows and use not

Re: learning python building 2nd app, need advices

2021-01-11 Thread pascal z via Python-list
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import locale import os import csv from tkinter import messagebox as msg try: from tkinter import * import ttk except: import tkinter as tk #GUI package from tkinter import ttk def fx_BasicListing(): #argx mode = 1 pour basic li

Re: learning python building 2nd app, need advices

2021-01-11 Thread Loris Bennett
pascal z writes: > tab to space on linux is not something easy to do I would argue that you are mistaken, although that depends somewhat on your definition of 'easy'. > , I had to launch windows and use notepad++. There is the Linux command 'expand' , which I have never used, but which sounds

Re: learning python building 2nd app, need advices

2021-01-11 Thread pascal z via Python-list
tab to space on linux is not something easy to do, I had to launch windows and use notepad++. Anyway, indentation should all be converted to spaces below #!/usr/bin/env python3 # -*- coding: utf-8 -*- import locale import os import csv from tkinter import messagebox as msg try: from tkinte

Re: learning python building 2nd app, need advices

2021-01-11 Thread pascal z via Python-list
tab to space on linux is not something easy to do, I had to launch windows and use notepad++. Anyway, indentation should all be converted to spaces below #!/usr/bin/env python3 # -*- coding: utf-8 -*- import locale import os import csv from tkinter import messagebox as msg try: from tkinter

Re: learning python building 2nd app, need advices

2021-01-08 Thread Richard Damon
On 1/8/21 6:10 PM, pascal z via Python-list wrote: > any way to attach a file because I loose indentation? Don't post via googlegroups, it thinks the world is HTML, which treats spaces in a funny matter. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python building 2nd app, need advices

2021-01-08 Thread Greg Ewing
On 9/01/21 12:10 pm, pascal z wrote: any way to attach a file because I loose indentation? Indentation usually makes it through here if you indent with spaces rather than tabs. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python building 2nd app, need advices

2021-01-08 Thread pascal z via Python-list
And something important to this app, is about listing files, how to avoid listing small application files parts .ini and binary files so if it's an application it would tell the size of of the folder of this application and not list the content or make it optionnal? -- https://mail.python.org/m

Re: learning python building 2nd app, need advices

2021-01-08 Thread pascal z via Python-list
any way to attach a file because I loose indentation? -- https://mail.python.org/mailman/listinfo/python-list

Re: Learning Python

2018-06-05 Thread Stephen Tucker
I have found Learning Python by Mark Lutz helpful. I have the 4th edition (2009). Its ISBN is 978-0-596-15806-4. A lot will depend on your learning style. This book reads more like a set of course notes than a reference book, but it does contain tables and summaries, too. On Tue, Jun 5, 2018 at 5

Re: Learning Python

2018-06-05 Thread Ned Batchelder
On 6/5/18 12:51 PM, T Berger wrote: Can someone learn Python through a book such as Head Start Python? Would an online course from MIT or google be better? This is really a question about your own learning style.  It is possible to learn from a book.  Not too long ago, that was one of the onl

Re: Learning python data types

2016-10-02 Thread Rustom Mody
On Monday, October 3, 2016 at 3:38:24 AM UTC+5:30, Crane Ugly wrote: > I am not new in scripting in general. > And about a year I create scripts in python, but my approach was always based > on my habits from UNIX shell, where data types are not obvious. > Going deeper with python I see necessity

Re: learning python. learning defining functions . need help

2016-07-22 Thread Steven D'Aprano
On Sat, 23 Jul 2016 01:21 am, justin walters wrote: > That should illustrate why. This is because simply typing '{}' could be > interpreted as > either a dict or a set. No. {} is always an empty dict. That is a language guarantee. Any programming language where {} is not an empty disk is not val

Re: learning python. learning defining functions . need help

2016-07-22 Thread MRAB
On 2016-07-22 16:41, D'Arcy J.M. Cain wrote: On Fri, 22 Jul 2016 08:21:17 -0700 justin walters wrote: You could also replace that line with: if stock is None or type(stock) != dict: Use isinstance(). That handles classes that subclass dict as well. If you're checking that it's a dict,

Re: learning python. learning defining functions . need help

2016-07-22 Thread D'Arcy J.M. Cain
On Fri, 22 Jul 2016 08:21:17 -0700 justin walters wrote: > You could also replace that line with: > > if stock is None or type(stock) != dict: Use isinstance(). That handles classes that subclass dict as well. -- D'Arcy J.M. Cain System Administrator, Vex.Net http://www.Vex.Net/ IM:da...@

Re: learning python. learning defining functions . need help

2016-07-22 Thread Random832
On Fri, Jul 22, 2016, at 11:21, justin walters wrote: > Try opening the interactive terminal on your command line and type the > following: > > type({}) == dict() > > That should illustrate why. That doesn't illustrate anything relevant at all. The reason this is false is because dict() is

Re: learning python. learning defining functions . need help

2016-07-22 Thread Chris Angelico
On Sat, Jul 23, 2016 at 1:21 AM, justin walters wrote: > Hi Chris, > > Try opening the interactive terminal on your command line and type the > following: > > type({}) == dict() > > That should illustrate why. This is because simply typing '{}' could be > interpreted as > either a dict or a se

Re: learning python. learning defining functions . need help

2016-07-22 Thread justin walters
On Fri, Jul 22, 2016 at 6:24 AM, Chris Angelico wrote: > On Fri, Jul 22, 2016 at 11:13 PM, Dennis Lee Bieber > wrote: > > Now... Going much beyond the assignment (if you were having > trouble > > with the assignment, this will seem like magic) [Python 2.7]: > > I'm not sure, but I think

  1   2   3   4   >