Re: Python installer hangs in Windows 7
On Tuesday, December 5, 2017 at 2:14:48 AM UTC+5:30, christia...@gmail.com wrote: > Same with me, except that I tried to install Python 3.6.3. Unchecking > "Install launcher for all users" helped, however. Thank you. It helped me. -- https://mail.python.org/mailman/listinfo/python-list
Re: From parsing a class to code object to class to mappingproxy to object (oh my!)
adam.pre...@gmail.com wrote: I've figured from this that I could do most variable access by just generating LOAD/STORE_NAME and the FAST is an (important) optimization. Yes, that's possible, although access to intermediate scopes (i.e. nonlocal) will need something else. An important exception there would be for built-ins and presumably imported stuff, right? No, importing things just binds names in your module namespace, so LOAD_GLOBAL does for them too. Also builtins, since if LOAD_GLOBAL doesn't find something in the module namespace, it looks in the builtins. I'm asking because right now I've literally hard-coded some logic that tells me if I'm generating a class body so I know to use names. I just feel kind of silly doing that. There's nothing silly about that -- it's effectively what CPython does. -- Greg -- https://mail.python.org/mailman/listinfo/python-list
Re: I want understand how this word wrap program playing on input
Hello, DL, the book I am reading is https://leanpub.com/python-journeyman .. It is an awesome book. The code is in page #351. David and Chris, The analogy you used to answer my questions were super helpful. I could answer my own question by putting some effort by dry running the code ofcourse. In that case, I am 100% sure the analogies were used in this email would never come to me. Thanks again to all of you. Thanks, Arup Rakshit a...@zeit.io > On 05-Apr-2019, at 1:24 AM, DL Neil wrote: > > Arup, > > On 5/04/19 7:33 AM, Arup Rakshit wrote: >> I am reading a Python book, where the author used a simple word wrap program >> to explain another concept. But I am not understanding some parts of the >> program. > ... > > A technique for solving this sort of comprehension-problem is to simulate the > operations of the computer/CPU on-paper. Instruction-by-instruction, write > down the names of the objects instantiated and their (current) values. As you > loop through the code, those (current) values change, and you will see > exactly how they change - divining (and defining) the 'why', as you go... > > Of course, only old-***s (like me) have the skills to handle pen/pencil and > paper technology! So, may I recommend an excellent tool which will > (hopefully) achieve the same ends for you: http://pythontutor.com/ > > > PS don't be shy about mentioning your "book", its "author", and its title > (hey, go 'full-APA' adding ISBN, pageNR...). Such will be a credit to the > author(s) and a possible recommendation/inspiration to fellow Pythonista! > > -- > Regards =dn > -- > https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
Re: I really liked this Javscript FizzBuzz can it be as nice in Python?
On Sun, Apr 7, 2019 at 4:04 AM Dennis Lee Bieber wrote: > >output = "" > >for num in n: > >if (num % 3 == 0): output += "Fizz" > >if (num % 5 == 0): output += "Buzz" > >print(output or num) > > > You aren't initializing the output /inside/ the loop. > > Note that 0 is considered a false, so the if() become, in essence: if > false equal false... Not sure the significance of this. Modulo between two integers will either return zero (if one is a multiple of the other) or a nonzero value (if there's some remainder). Comparing that value to zero will give back true if a multiple, or false if not, which is exactly what's wanted here. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: I want understand how this word wrap program playing on input
Arup, Good choice! (thought I recognised the example-problem) The three books in the "Python Craftsman" series/bundle: "Apprentice", "Journeyman", and "Master" are a thoroughly recommendable resource. As the titles infer, they start at a beginner level and become more complex over time. Even seasoned pythonista can learn from them. Did you start with "Apprentice" and work 'up'? How are you finding them? Are they recommendable to others? Did the Python Tutor help you 'see' what was happening and how values were changing whilst the code executed? Web-Ref: https://leanpub.com/b/python-craftsman Disclaimer: I have no relationship with either resource, other than as a happy user. On 7/04/19 3:38 AM, Arup Rakshit wrote: Hello, DL, the book I am reading is https://leanpub.com/python-journeyman .. It is an awesome book. The code is in page #351. David and Chris, The analogy you used to answer my questions were super helpful. I could answer my own question by putting some effort by dry running the code ofcourse. In that case, I am 100% sure the analogies were used in this email would never come to me. Thanks again to all of you. Thanks, Arup Rakshit a...@zeit.io On 05-Apr-2019, at 1:24 AM, DL Neil wrote: Arup, On 5/04/19 7:33 AM, Arup Rakshit wrote: I am reading a Python book, where the author used a simple word wrap program to explain another concept. But I am not understanding some parts of the program. ... A technique for solving this sort of comprehension-problem is to simulate the operations of the computer/CPU on-paper. Instruction-by-instruction, write down the names of the objects instantiated and their (current) values. As you loop through the code, those (current) values change, and you will see exactly how they change - divining (and defining) the 'why', as you go... Of course, only old-***s (like me) have the skills to handle pen/pencil and paper technology! So, may I recommend an excellent tool which will (hopefully) achieve the same ends for you: http://pythontutor.com/ PS don't be shy about mentioning your "book", its "author", and its title (hey, go 'full-APA' adding ISBN, pageNR...). Such will be a credit to the author(s) and a possible recommendation/inspiration to fellow Pythonista! -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list
Re: I want understand how this word wrap program playing on input
Hi DL, I started from here https://docs.python.org/3/tutorial/index.html .. And then found out there should be more which is not covered here, so I was looking for a book. And then got the journeyman book and started reading it. I am now on chapter 11. Yet not bored and distracted. The author really wrote the book well, as the title suggests. I used python tutor sometime when I was reading the scope. It helped there. Since then I have not used that, and wrote here when something book didn’t explain. But that was not the Book’s fault, it uses an example from binging of the chapter and end with the same example by improving it with the concept as it teaches. The questions I asked was not the related directly to the subject it was teaching, but to me it was required to move on, so I came here. :) Also I didn’t buy the whole series. Being an Indian, $ is really expensive to us. :) The whole series will cost me INR 2768.55. Thanks, Arup Rakshit a...@zeit.io > On 07-Apr-2019, at 2:02 AM, DL Neil wrote: > > Arup, > > Good choice! (thought I recognised the example-problem) The three books in > the "Python Craftsman" series/bundle: "Apprentice", "Journeyman", and > "Master" are a thoroughly recommendable resource. As the titles infer, they > start at a beginner level and become more complex over time. Even seasoned > pythonista can learn from them. > > Did you start with "Apprentice" and work 'up'? How are you finding them? Are > they recommendable to others? > > Did the Python Tutor help you 'see' what was happening and how values were > changing whilst the code executed? > > > Web-Ref: > https://leanpub.com/b/python-craftsman > > Disclaimer: > I have no relationship with either resource, other than as a happy user. > > > On 7/04/19 3:38 AM, Arup Rakshit wrote: >> Hello, >> DL, the book I am reading is https://leanpub.com/python-journeyman .. It is >> an awesome book. The code is in page #351. >> David and Chris, The analogy you used to answer my questions were super >> helpful. I could answer my own question by putting some effort by dry >> running the code ofcourse. In that case, I am 100% sure the analogies were >> used in this email would never come to me. >> Thanks again to all of you. >> Thanks, >> Arup Rakshit >> a...@zeit.io >>> On 05-Apr-2019, at 1:24 AM, DL Neil wrote: >>> >>> Arup, >>> >>> On 5/04/19 7:33 AM, Arup Rakshit wrote: I am reading a Python book, where the author used a simple word wrap program to explain another concept. But I am not understanding some parts of the program. >>> ... >>> >>> A technique for solving this sort of comprehension-problem is to simulate >>> the operations of the computer/CPU on-paper. Instruction-by-instruction, >>> write down the names of the objects instantiated and their (current) >>> values. As you loop through the code, those (current) values change, and >>> you will see exactly how they change - divining (and defining) the 'why', >>> as you go... >>> >>> Of course, only old-***s (like me) have the skills to handle pen/pencil and >>> paper technology! So, may I recommend an excellent tool which will >>> (hopefully) achieve the same ends for you: http://pythontutor.com/ >>> >>> >>> PS don't be shy about mentioning your "book", its "author", and its title >>> (hey, go 'full-APA' adding ISBN, pageNR...). Such will be a credit to the >>> author(s) and a possible recommendation/inspiration to fellow Pythonista! >>> >>> -- >>> Regards =dn >>> -- >>> https://mail.python.org/mailman/listinfo/python-list > > -- > Regards =dn > -- > https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list